saltstack操作远程执行命令报错:“is running as PID 113257 and was started at”的解决
2017-10-24 09:36
666 查看
执行命令没有成功:
#测试和minion的连接,发现没有问题
根据文章的内容,停掉node1的salt服务:
[root@linux-node1 base]# salt '*' state.sls web.apache linux-node2.example.com: ---------- ID: apache-install Function: pkg.installed Name: httpd Result: True Comment: Package httpd is already installed Started: 13:10:00.987726 Duration: 5236.443 ms Changes: ---------- ID: apache-service Function: service.running Name: httpd Result: True Comment: The service httpd is already running Started: 13:10:06.247097 Duration: 1438.912 ms Changes: Summary for linux-node2.example.com ------------ Succeeded: 2 Failed: 0 ------------ Total states run: 2 Total run time: 6.675 s linux-node1.example.com: Minion did not return. [No response]怀疑是虚拟机里的连接有点问题。
#测试和minion的连接,发现没有问题
[root@linux-node1 base]# salt '*' test.ping linux-node2.example.com: True linux-node1.example.com: True#再次操作远程执行命令
[root@linux-node1 base]# salt '*' state.sls web.apache linux-node1.example.com: Data failed to compile: ---------- The function "state.sls" is running as PID 113257 and was started at 2017, Sep 09 13:38:17.636816 with jid 20170909133817636816 linux-node2.example.com: ---------- ID: apache-install Function: pkg.installed Name: httpd Result: True Comment: Package httpd is already installed Started: 13:15:57.492704 Duration: 1505.709 ms Changes: ---------- ID: apache-service Function: service.running Name: httpd Result: True Comment: The service httpd is already running Started: 13:15:59.002177 Duration: 186.313 ms Changes: Summary for linux-node2.example.com ------------ Succeeded: 2 Failed: 0 ------------ Total states run: 2 Total run time: 1.692 s ERROR: Minions returned with non-zero exit code在百度上搜索报错信息:“is running as PID 113257 and was started at”,找到一篇文档:http://blog.csdn.net/baidu_25506889/article/details/48050619——The function "state.highstate" is running as PID 4417的解决方法
根据文章的内容,停掉node1的salt服务:
[root@linux-node1 base]# systemctl stop salt-master [root@linux-node1 base]# systemctl stop salt-minion [root@linux-node1 base]# ps -ef|grep salt root 114208 110544 0 00:03 pts/1 00:00:00 grep --color=auto salt重新启动salt服务:
[root@linux-node1 base]# systemctl start salt-master [root@linux-node1 base]# systemctl start salt-minion报错信息变了:
[root@linux-node1 base]# salt '*' state.sls web.apache linux-node2.example.com: ---------- ID: apache-install Function: pkg.installed Name: httpd Result: True Comment: Package httpd is already installed Started: 00:04:57.512520 Duration: 861.558 ms Changes: ---------- ID: apache-service Function: service.running Name: httpd Result: True Comment: The service httpd is already running Started: 00:04:58.375123 Duration: 46.543 ms Changes: Summary for linux-node2.example.com ------------ Succeeded: 2 Failed: 0 ------------ Total states run: 2 Total run time: 908.101 ms linux-node1.example.com: ---------- ID: apache-install Function: pkg.installed Name: httpd Result: True Comment: Package httpd is already installed Started: 00:04:33.162908 Duration: 844.754 ms Changes: ---------- ID: apache-service Function: service.running Name: httpd Result: False Comment: Running scope as unit run-115498.scope. Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. Started: 00:04:34.008627 Duration: 147.766 ms Changes: Summary for linux-node1.example.com ------------ Succeeded: 1 Failed: 1 ------------ Total states run: 2 Total run time: 992.520 ms ERROR: Minions returned with non-zero exit code突然领悟到可能是“linux-node1”已经运行有80端口。检查后发现,果然如此。
[root@linux-node1 base]# netstat -lntup Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 2786/nginx: master tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2786/nginx: master tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 939/sshd tcp 0 0 0.0.0.0:4505 0.0.0.0:* LISTEN 114225/python tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1751/master tcp 0 0 0.0.0.0:4506 0.0.0.0:* LISTEN 114231/python tcp 0 0 0.0.0.0:49152 0.0.0.0:* LISTEN 11064/glusterfsd tcp 0 0 0.0.0.0:49153 0.0.0.0:* LISTEN 11193/glusterfsd tcp 0 0 0.0.0.0:49154 0.0.0.0:* LISTEN 11212/glusterfsd tcp 0 0 0.0.0.0:49155 0.0.0.0:* LISTEN 11338/glusterfsd tcp 0 0 0.0.0.0:49156 0.0.0.0:* LISTEN 11357/glusterfsd tcp 0 0 0.0.0.0:24007 0.0.0.0:* LISTEN 11039/glusterd tcp6 0 0 :::111 :::* LISTEN 1/systemd tcp6 0 0 :::80 :::* LISTEN 2786/nginx: master tcp6 0 0 :::22 :::* LISTEN 939/sshd tcp6 0 0 ::1:25 :::* LISTEN 1751/master udp 0 0 0.0.0.0:612 0.0.0.0:* 11037/rpcbind udp 0 0 0.0.0.0:111 0.0.0.0:* 11037/rpcbind udp6 0 0 :::612 :::* 11037/rpcbind udp6 0 0 :::111 :::* 11037/rpcbind停掉之前运行的nginx服务:
[root@linux-node1 base]# systemctl stop nginx这次就成功了:
[root@linux-node1 base]# salt '*' state.sls web.apache linux-node2.example.com: ---------- ID: apache-install Function: pkg.installed Name: httpd Result: True Comment: Package httpd is already installed Started: 00:05:43.237868 Duration: 920.891 ms Changes: ---------- ID: apache-service Function: service.running Name: httpd Result: True Comment: The service httpd is already running Started: 00:05:44.159808 Duration: 57.373 ms Changes: Summary for linux-node2.example.com ------------ Succeeded: 2 Failed: 0 ------------ Total states run: 2 Total run time: 978.264 ms linux-node1.example.com: ---------- ID: apache-install Function: pkg.installed Name: httpd Result: True Comment: Package httpd is already installed Started: 00:05:16.506796 Duration: 1640.554 ms Changes: ---------- ID: apache-service Function: service.running Name: httpd Result: True Comment: Service httpd has been enabled, and is running Started: 00:05:18.148225 Duration: 372.124 ms Changes: ---------- httpd: True Summary for linux-node1.example.com ------------ Succeeded: 2 (changed=1) Failed: 0 ------------ Total states run: 2 Total run time: 2.013 s
相关文章推荐
- saltstack远程执行命令.md
- RAC root.sh Oracle CRS stack is already configured and will be running under init(1M) 的解决方法
- Existing lock /var/run/yum.pid: another copy is running as pid 解决办法
- RAC root.sh Oracle CRS stack is already configured and will be running under init(1M) 的解决方法
- RAC root.sh Oracle CRS stack is already configured and will be running under init(1M) 的解决方法
- RAC root.sh Oracle CRS stack is already configured and will be running under init(1M) 的解决方法
- RAC root.sh Oracle CRS stack is already configured and will be running under init(1M) 的解决方法
- salt stack的远程命令如何执行-笔记
- RAC root.sh Oracle CRS stack is already configured and will be running under init(1M) 的解决方法
- fedora 7 yum 出现Existing lock /var/run/yum.pid: another copy is running as pid 3380. Aborting. 的解决办法
- RAC root.sh Oracle CRS stack is already configured and will be running under init(1M) 的解决方法
- saltstack执行远程命令
- RAC root.sh Oracle CRS stack is already configured and will be running under init(1M) 的解决方法
- The function "state.highstate" is running as PID 4417的解决方法
- Existing lock /var/run/yum.pid: another copy is running as pid 解决办法
- 2.7-saltstack远程执行命令
- mac下面通过brew安装东西的时候报Error: Running Homebrew as root is extremely dangerous and no longer supported的解决
- Saltstack-2:执行远程命令
- 集中化管理平台Saltstack远程执行命令
- saltstack的常用操作(三) 命令与模块的执行