在salt master端執(zhí)行salt '*' test.ping時,某一節(jié)點出現(xiàn)如下報錯:
Minion did not return. [No response]
登陸到這一節(jié)點查看minion的日志,發(fā)現(xiàn)如下的問題
$ tail -f /var/log/salt/minion
The master may need to be updated if it is a version of Salt lower than 2015.5.3, 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
2015-11-23 23:30:02,645 [salt.crypt ][ERROR ][3530] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
2015-11-23 23:30:05,108 [salt.crypt ][ERROR ][3586] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
2015-11-23 23:30:15,136 [salt.crypt ][ERROR ][3586] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
大概的意思就是,minion端拿到的key與master端的不符,驗證無法通過。
解決方法是刪除minion端的key,再重新與master進行連接和認證。
minion
$ cat pki/minion/minion_master.pub
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtzq0AjuyQsVEgsx692GN
... ...
7fbuudp4yu5vcYcqksKIFcm0J3E+OR+rx/NUIHt0ZL8HLxcSn4Si/S6dVp/vE7Oc
swIDAQAB
-----END PUBLIC KEY-----
[root@localhost salt]# rm -fr pki/minion/minion_master.pub
[root@localhost salt]# service salt-minion restart
Stopping salt-minion daemon: [ OK ]
Starting salt-minion daemon: [ OK ]
master
salt-key -A
minion
$ cat pki/minion/minion_master.pub
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy46TJvK9BUqjvaYzmt5Q
... ...
ADw0hU6B/A1kRBeUbb6Fy+HljiSjD3O+mhoK7RE8rCnvJCHfuZSX/qMtLEyoh0vN
tQIDAQAB
-----END PUBLIC KEY-----
至此,master與minion端的通信正常。