salt-minion状态报错

1、报错内容

查看salt-minion的运行状态,显示salt-master已经缓存了这个minion,但是minion在重新认证之前将要等待10秒,其实此情况是正常情况,因为salt-master没有接收minion的认证,但是由于master上无法查看minion的应有id而是显示了错误的id导致

  1. [root@devops ~]# systemctl status salt-minion.service
  2. salt-minion.service - The Salt Minion
  3. Loaded: loaded (/usr/lib/systemd/system/salt-minion.service; enabled; vendor preset: disabled)
  4. Active: active (running) since Mon 2016-08-22 09:44:54 CST; 10min ago
  5. Main PID: 22576 (salt-minion)
  6. CGroup: /system.slice/salt-minion.service
  7. ├─22576 /usr/bin/python /usr/bin/salt-minion
  8. ├─22587 /usr/bin/python /usr/bin/salt-minion
  9. └─22589 /usr/bin/python /usr/bin/salt-minion
  10. Aug 22 09:53:27 devops salt-minion[22576]: [ERROR ] The Salt Master has cached the public key for this node, this salt minion will wait fo...enticate
  11. Aug 22 09:53:37 devops salt-minion[22576]: [ERROR ] The Salt Master has cached the public key for this node, this salt minion will wait fo...enticate
  12. Aug 22 09:53:47 devops salt-minion[22576]: [ERROR ] The Salt Master has cached the public key for this node, this salt minion will wait fo...enticate
  13. Aug 22 09:53:57 devops salt-minion[22576]: [ERROR ] The Salt Master has cached the public key for this node, this salt minion will wait fo...enticate
  14. Aug 22 09:54:07 devops salt-minion[22576]: [ERROR ] The Salt Master has cached the public key for this node, this salt minion will wait fo...enticate
  15. Aug 22 09:54:17 devops salt-minion[22576]: [ERROR ] The Salt Master has cached the public key for this node, this salt minion will wait fo...enticate

查看salt-minion日志,日志显示和状态显示一样

  1. [root@devops pki]# tailf /var/log/salt/minion
  2. 2016-08-22 10:15:00,923 [salt.cli.daemons ][WARNING ][23384] IMPORTANT: Do not use md5 hashing algorithm! Please set "hash_type" to sha256 in Salt Minion config!
  3. 2016-08-22 10:15:00,952 [salt.crypt ][ERROR ][23384] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
  4. 2016-08-22 10:15:10,955 [salt.crypt ][ERROR ][23384] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
  5. 2016-08-22 10:15:20,961 [salt.crypt ][ERROR ][23384] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
  6. 2016-08-22 10:15:30,966 [salt.crypt ][ERROR ][23384] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
  7. 2016-08-22 10:15:40,969 [salt.crypt ][ERROR ][23384] 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的debug信息,可以看到已经缓存了10.0.0.7这个ip地址,导致salt-master无法识别devops这个id,此问题是由于装机系统的时候ip就是10.0.0.7,装机后重新划分的ip是10.4.12.117,本地缓存了10.0.0.7,所以导致salt-master无法更新到minion_id的变化。

  1. [root@devops pki]# salt-minion -l debug
  2. [DEBUG ] Reading configuration from /etc/salt/minion
  3. [DEBUG ] Using cached minion ID from /etc/salt/minion_id: 10.0.0.7
  4. [DEBUG ] Configuration file path: /etc/salt/minion
  5. [WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
  6. [INFO ] Setting up the Salt Minion "10.0.0.7"
  7. [ERROR ] Salt minion is already running. Exiting.
  8. None
  9. [INFO ] The salt minion is shutting down..
  10. [INFO ] The Salt Minion is shut down

2、解决办法

删除minion_id,重启salt-minion服务

  1. [root@devops pki]# rm -f /etc/salt/minion_id
  2. [root@devops ~]# systemctl restart salt-minion.service

查看salt-master的情况

  1. [root@zq-salt-zabbix minions_pre]# salt-key -L
  2. Accepted Keys:
  3. zq-salt-zabbix.idc.hexun.com
  4. Denied Keys:
  5. Unaccepted Keys:
  6. 10.0.0.7
  7. devops
  8. Rejected Keys:

此时只要在salt-master端删除10.0.0.7即可

  1. [root@zq-salt-zabbix minions_pre]# salt-key -d 10.0.0.7
  2. The following keys are going to be deleted:
  3. Unaccepted Keys:
  4. 10.0.0.7
  5. Proceed? [N/y] y
  6. No minions matched the target. No command was sent, no jid was assigned.
  7. Key for minion 10.0.0.7 deleted.

重新查看minion端的状态,ERROR已消失,在master上添加认证devops即可

  1. [root@devops ~]# systemctl status salt-minion.service
  2. salt-minion.service - The Salt Minion
  3. Loaded: loaded (/usr/lib/systemd/system/salt-minion.service; enabled; vendor preset: disabled)
  4. Active: active (running) since Mon 2016-08-22 11:27:37 CST; 18s ago
  5. Main PID: 12800 (salt-minion)
  6. CGroup: /system.slice/salt-minion.service
  7. ├─12800 /usr/bin/python /usr/bin/salt-minion
  8. ├─12811 /usr/bin/python /usr/bin/salt-minion
  9. └─12813 /usr/bin/python /usr/bin/salt-minion
  10. Aug 22 11:27:37 devops systemd[1]: Started The Salt Minion.
  11. Aug 22 11:27:37 devops systemd[1]: Starting The Salt Minion...
  12. Aug 22 11:27:37 devops salt-minion[12800]: [WARNING ] IMPORTANT: Do not use md5 hashing algorithm! Please set "hash_type" to sha256 in Sal... config!
  13. Hint: Some lines were ellipsized, use -l to show in full.
1
未经许可,不得转载,否则将受到作者追究,博主联系方式见首页右上角

该文章由 发布

这货来去如风,什么鬼都没留下!!!
发表我的评论
取消评论
代码 贴图 加粗 链接 删除线 签到

(1)条精彩评论:
  1. 匿名
    :mrgreen: :neutral: :twisted: :arrow: :shock: :smile: :???: :cool: :evil: :grin: :oops: :razz: :roll: :wink: :cry: :eek: :mad: :sad: :?: :?: :evil: :grin: :???: :cool: :grin: :idea: :smile: :???: :cool: :???: :???: :???: :???: :???: :???: :???: :???: :???: :???: :???: :???: :???: :???:
    匿名2017-03-19 12:58 回复