现象
Minion端
Minion
关机重启。日志里显示:
#运行
tail -f /var/log/salt/minion
#结果
[salt.utils.parsers][WARNING ][19132] Minion received a SIGTERM. Exiting.
Master端
#运行
sudo salt-key -L
#结果
Accepted Keys:
test_pc
Denied Keys:
test_pc
Unaccepted Keys:
Rejected Keys:
原因
The primary time a key is "denied" is if a minion connects, and tries to authenticate with a public key other than the one the master already has accepted/cached.
So minions with duplicate IDs would cause this, as well as minions which were rebuilt or had new keys generated, but the key was not deleted on the master.
解决
删除Denied Keys
salt-key --list=denied -d test_pc
或者
去/etc/salt/pki/master/minions_denied
删除test_pc
。
重启Minion