欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

salt出错Job for salt-master.service failed because the control process exited with

程序员文章站 2022-07-10 12:18:50
问题 &emsap;?在虚拟机上使用salt的时候,因为一边看文档一边学习,突然之前salt就用不了了,然后 ps aux | grep salt &emsap;?发...

问题

&emsap;?在虚拟机上使用salt的时候,因为一边看文档一边学习,突然之前salt就用不了了,然后

ps aux | grep salt

&emsap;?发现salt-maste和salt-minion都在,准备重启一下salt-master服务试试:

sudo service salt-master restart

但是提示报错:

Job for salt-master.service failed because the control process exited with error code. See "systemctl status salt-master.service" and "journalctl -xe" for details.

salt出错Job for salt-master.service failed because the control process exited with
使用提示的命令看出错信息:

root@ubuntu:/home/nick# systemctl status salt-master.service
● salt-master.service - The Salt Master Server
   Loaded: loaded (/lib/systemd/system/salt-master.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2018-03-09 16:13:34 CST; 13min ago
     Docs: man:salt-master(1)
           file:///usr/share/doc/salt/html/contents.html
           https://docs.saltstack.com/en/latest/contents.html
  Process: 2408 ExecStart=/usr/bin/salt-master (code=exited, status=4)
 Main PID: 2408 (code=exited, status=4)

Mar 09 16:13:33 ubuntu systemd[1]: Stopped The Salt Master Server.
Mar 09 16:13:33 ubuntu systemd[1]: Starting The Salt Master Server...
Mar 09 16:13:34 ubuntu salt-master[2408]: [WARNING ] Unable to bind socket 192.168.164.134:4505, error: [Errno
Mar 09 16:13:34 ubuntu salt-master[2408]: The salt master is shutdown. The ports are not available to bind
Mar 09 16:13:34 ubuntu systemd[1]: salt-master.service: Main process exited, code=exited, status=4/NOPERMISSIO
Mar 09 16:13:34 ubuntu systemd[1]: Failed to start The Salt Master Server.
Mar 09 16:13:34 ubuntu systemd[1]: salt-master.service: Unit entered failed state.
Mar 09 16:13:34 ubuntu systemd[1]: salt-master.service: Failed with result 'exit-code'.



//以及
root@ubuntu:/home/nick# journalctl -xe
Mar 09 15:41:45 ubuntu systemd[1]: Stopped The Salt Master Server.
-- Subject: salt-master.service 单元已结束停止操作
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- salt-master.service 单元已结束停止操作。
Mar 09 15:41:45 ubuntu systemd[1]: Starting The Salt Master Server...
-- Subject: salt-master.service 单元已开始启动
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- salt-master.service 单元已开始启动。
Mar 09 15:41:45 ubuntu salt-master[2862]: [WARNING ] Unable to bind socket 192.168.164.134:4507, error: [Errno 99] Cannot assign requested address; Is there another salt-master running?
Mar 09 15:41:46 ubuntu salt-master[2862]: The salt master is shutdown. The ports are not available to bind
Mar 09 15:41:46 ubuntu systemd[1]: salt-master.service: Main process exited, code=exited, status=4/NOPERMISSION
Mar 09 15:41:46 ubuntu systemd[1]: Failed to start The Salt Master Server.
-- Subject: salt-master.service 单元已失败
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- salt-master.service 单元已失败。
--
-- 结果为“failed”。
Mar 09 15:41:46 ubuntu systemd[1]: salt-master.service: Unit entered failed state.
Mar 09 15:41:46 ubuntu systemd[1]: salt-master.service: Failed with result 'exit-code'.

??根据提示,显示无法绑定4505(安装salt时默认使用4505端口,可以再/etc/salt/master中修改)端口,然后使用

netstat -lnput

??查看端口号,发现并没有进程占用4505端口,然后去网上找了好多方法——无果。
??最终发现自己IP变了,因为用的虚拟机,IP他就突兀的变了,不给我一点点防备。
??在/etc/salt/master中修改完IP就好了(因为之前为了其他服务的正常运行,我将默认的0:0:0:0改成了虚拟机的IP,所以虚拟机IP改变之后就无法成功运行)。

??告诫大家,如果在虚拟机上学习使用salt,没有别的要求的话别动master里面的IP设置

半小时后更新:
记得改minion里面的IP,同样在/etc/salt/minion中,不说了,哭晕在厕所,呜呜呜~~