Salt stack 自省到永远运行的状态?

Salt stack 自省到永远运行的状态?,salt-stack,Salt Stack,我一直在用盐做实验,我成功地锁定了我的最高统帅部。它已经运行了好几个小时了,尽管没有什么可以保证这样的时间 我所做的最后一个更改是修改nginx的服务.watch状态。目前案文如下: nginx: pkg.installed: - name: nginx service: - running - enable: True - restart: True - watch: - file: /etc/nginx/nginx.conf

我一直在用盐做实验,我成功地锁定了我的最高统帅部。它已经运行了好几个小时了,尽管没有什么可以保证这样的时间

我所做的最后一个更改是修改nginx的
服务.watch
状态。目前案文如下:

nginx:
  pkg.installed:
    - name: nginx
  service:
    - running
    - enable: True
    - restart: True
    - watch:
      - file: /etc/nginx/nginx.conf
      - file: /etc/nginx/sites-available/default.conf
      - pkg: nginx
我做的最后一个更改是将第二个
文件:
参数添加到
watch

在让它运行了一整夜,状态没有变化之后,我随后按Ctrl-C键启动了这个过程。sudo salt-v'web*'state.highstate-l debug的最后一个输出是:

[DEBUG   ] Checking whether jid 20140403022217881027 is still running
[DEBUG   ] get_returns for jid 20140403103702550977 sent to set(['web1.mysite.com']) will timeout at 10:37:04
[DEBUG   ] jid 20140403103702550977 found all minions
Execution is still running on web1.mysite.com
^CExiting on Ctrl-C
This job's jid is:                                                                                                                                     
20140403022217881027
The minions may not have all finished running and any remaining minions will return upon completion. To look up the return data for this job later run:
salt-run jobs.lookup_jid 20140403022217881027
立即再次运行,我得到以下结果:

$ sudo salt -v 'web*' state.highstate -l debug
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Missing configuration file: /home/eykd/.salt
[DEBUG   ] Configuration file path: /etc/salt/master
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Missing configuration file: /home/eykd/.salt
[DEBUG   ] LocalClientEvent PUB socket URI: ipc:///var/run/salt/master/master_event_pub.ipc
[DEBUG   ] LocalClientEvent PULL socket URI: ipc:///var/run/salt/master/master_event_pull.ipc
Executing job with jid 20140403103715454952
-------------------------------------------

[DEBUG   ] Checking whether jid 20140403103715454952 is still running
[DEBUG   ] get_returns for jid 20140403103720479720 sent to set(['web1.praycontinue.com']) will timeout at 10:37:22
[INFO    ] jid 20140403103720479720 minions set(['web1.mysite.com']) did not return in time
[DEBUG   ] Loaded no_out as virtual quiet
[DEBUG   ] Loaded json_out as virtual json
[DEBUG   ] Loaded yaml_out as virtual yaml
[DEBUG   ] Loaded pprint_out as virtual pprint
web1.praycontinue.com:
    Minion did not return
然后,我运行了相同的命令,并收到以下消息:

没有进程在PID 4417下运行。运行sudo salt run jobs.lookup_jid 20140403022217881027不显示任何内容

不幸的是,我无法通过ssh连接到仆从,因为salt尚未提供我的
授权密钥\


所以,我的问题是:到底是什么错了,我到底是怎么发现的呢?

所以,经过大量调试,这是由于Nginx服务配置不当造成的<代码>服务nginx start
被挂起,因此salt minion也被挂起。

我在使用Ctrl-C中止salt master上的state.highstate运行时发生了这种情况。结果表明,错误消息中引用的PID实际上是minion机器上salt minion进程的PID

我可以通过在minion上重新启动salt minion进程,然后在master上重新执行state.highstate来解决这个问题

$ sudo salt -v 'web*' state.highstate -l debug
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Missing configuration file: /home/eykd/.salt
[DEBUG   ] Configuration file path: /etc/salt/master
[DEBUG   ] Reading configuration from /etc/salt/master
[DEBUG   ] Missing configuration file: /home/eykd/.salt
[DEBUG   ] LocalClientEvent PUB socket URI: ipc:///var/run/salt/master/master_event_pub.ipc
[DEBUG   ] LocalClientEvent PULL socket URI: ipc:///var/run/salt/master/master_event_pull.ipc
Executing job with jid 20140403103729848942
-------------------------------------------

[DEBUG   ] Loaded no_out as virtual quiet
[DEBUG   ] Loaded json_out as virtual json
[DEBUG   ] Loaded yaml_out as virtual yaml
[DEBUG   ] Loaded pprint_out as virtual pprint
web1.mysite.com:
    Data failed to compile:
----------
    The function "state.highstate" is running as PID 4417 and was started at 2014, Apr 03 02:22:17.881027 with jid 20140403022217881027