天天看點

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      

仍然沒有解決問題。

不要着急,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      

繼續閱讀