首页 > 代码库 > salt-minion dead but pid file exists 正确解决方法

salt-minion dead but pid file exists 正确解决方法

说明:

看了网上很多关于alt-minion dead but pid file exists 的解决方法,千篇一律的写一个shell脚本 killproc salt-minion 

见链接:http://732233048.blog.51cto.com/9323668/1693483

但是并没有什么用,我如何解决这个问题的呢,请容我慢慢道来。

 

系统版本:CentOS_6.7_64bit 环境已优化。

重装(第一次装)salt-minion,但是客户端却无法正常启动,如下报错:

[root@namenode ~]# /etc/init.d/salt-minion status

salt-minion dead but pid file exists

 

解决过程:

由报错知:

    minion进程已经死,但是进程文件还在

于是去找进程文件,在minion机的配置文件里/etc/init.d/salt-minion里发现进程文件是:

    /var/run/salt-minion.pid

 

然后尝试把进程文件删掉,再重新启动:

[root@namenode ~]# /etc/init.d/salt-minion restart

 

Stopping salt-minion daemon:                               [FAILED]

Starting salt-minion daemon:                               [  OK  ]

[root@namenode ~]# /etc/init.d/salt-minion status

salt-minion dead but pid file exists

仍然没有解决问题。

不要着急,debug一下:

[root@namenode ~]salt-minion -l debug

 

  [INFO    ] Setting up the Salt Minion "namenode"

  [DEBUG   ] Created pidfile: /var/run/salt-minion.pid

  [DEBUG   ] Reading configuration from /etc/salt/minion

  [DEBUG   ] Attempting to authenticate with the Salt Master at 192.168.1.53

  [DEBUG   ] Initializing new SAuth for (‘/etc/salt/pki/minion‘, ‘namenode‘, ‘tcp://192.168.1.53:4506‘)

  [ERROR   ] The master key has changed, the salt master could have been subverted, verify salt master‘s public key

  [CRITICAL] The Salt Master server‘s public key did not authenticate!

   The master may need to be updated if it is a version of Salt lower than 2015.5.5, or

   If you are confident that you are connecting to a valid Salt Master, then remove the master public key and restart the Salt Minion.

   The master public key can be found at:

   /etc/salt/pki/minion/minion_master.pub

 

查看salt-minion日志 :

[root@namenode ~]less /var/log/salt/minion

也发现同样的错误:

 

2015-12-15 16:35:06,519 [salt.crypt][CRITICAL][12704] The Salt Master server‘s public key did not authenticate!

  10647 The master may need to be updated if it is a version of Salt lower than 2015.5.5, or

  10648 If you are confident that you are connecting to a valid Salt Master, then remove the master public key and restart the Salt Minion.

  10649 The master public key can be found at:

  10650 /etc/salt/pki/minion/minion_master.pub

 

解决方法:

直接在客户端上来上一条

[root@namenode ~]# rm -rf /etc/salt/pki/minion/minion_master.pub
[root@namenode ~]/etc/init.d/salt-minion restart

 

万事大吉 !!!

技术分享

本文出自 “小陌成长之路” 博客,请务必保留此出处http://309173854.blog.51cto.com/7370240/1725788

salt-minion dead but pid file exists 正确解决方法