The machine already exists in the salt, in order to standardize, need to rename this batch of host
Operation Flow: Remove the machine from master, modify the host name of the machine, rename the minion_id and PKI directories in the/etc/salt directory, and restart the Salt-minion service (after the Mster segment can monitor the host again, can delete the file renamed above)
Environment: http://www.cnblogs.com/zzzhfo/p/6126223.html
Rename the salt-client-01 to salt-minion-01
- Remove salt-client-01 from the salt-server.
[Email protected]/]# Salt-key-laccepted Keys:salt-client- onSalt-client- GenevaDenied keys:unaccepted keys:rejected keys:[[email protected]-server/]# salt-key-d'salt-client-01'-ydeleting The following keys:accepted Keys:salt-client- onKey forMinion salt-client- ondeleted. [[Email protected]-server/]# Salt-key-laccepted Keys:salt-client- GenevaDenied keys:unaccepted keys:salt-client-01
Rejected Keys:
Modify Host Name
[Email protected]/]# cat/etc/sysconfig/network #重启生效NETWORKING=yeshostname= salt-minion-[[email protected]-client-/]# hostname salt-minion-[[ Email protected]-client- /]# Bash
Delete minion_id and PKI (recommended MV command)
[Email protected]/]# cd/etc/salt/[[email protected]-minion- Salt] #mv minion_id Minion_id.bak[[email protected]-minion- salt]# MV PKI Pki.bak[[email protected]-minion- salt]#/etc/init.d/salt-minion restartstopping Salt-Minion daemon: [ OK ] Starting salt-Minion daemon: [ OK ][[email protected]-minion- salt]# lsminion minion.d minion_id minion_id.bak PKI pki.bak
View log information for Minion
Error:salt Primary Cache node's public key, this salt minion will wait 10 seconds before attempting to authenticate
[[Email protected] onsalt]# Tail/var/log/salt/Minion .- the- in xx: About: -,173[Salt.crypt] [ERROR] [1525] The Salt Master has cached the PublicKey for ThisNode ThisSalt minion would wait for TenSeconds before attempting to re-Authenticate .- the- in xx: About: $,199[Salt.crypt] [ERROR] [1525] The Salt Master has cached the PublicKey for ThisNode ThisSalt minion would wait for TenSeconds before attempting to re-Authenticate .- the- in xx: $: -,227[Salt.crypt] [ERROR] [1525] The Salt Master has cached the PublicKey for ThisNode ThisSalt minion would wait for TenSeconds before attempting to re-Authenticate .- the- in xx: $: -,255[Salt.crypt] [ERROR] [1525] The Salt Master has cached the PublicKey for ThisNode ThisSalt minion would wait for TenSeconds before attempting to re-Authenticate .- the- in xx: $: -,283[Salt.crypt] [ERROR] [1525] The Salt Master has cached the PublicKey for ThisNode ThisSalt minion would wait for TenSeconds before attempting to re-Authenticate .- the- in xx: $:Panax Notoginseng,308[Salt.crypt] [ERROR] [1525] The Salt Master has cached the PublicKey for ThisNode ThisSalt minion would wait for TenSeconds before attempting to re-Authenticate .- the- in xx: $: -,336[Salt.crypt] [ERROR] [1525] The Salt Master has cached the PublicKey for ThisNode ThisSalt minion would wait for TenSeconds before attempting to re-Authenticate .- the- in xx: $: $,364[Salt.crypt] [ERROR] [1525] The Salt Master has cached the PublicKey for ThisNode ThisSalt minion would wait for TenSeconds before attempting to re-Authenticate .- the- in xx: -: -,382[Salt.crypt] [ERROR] [1525] The Salt Master has cached the PublicKey for ThisNode ThisSalt minion would wait for TenSeconds before attempting to re-Authenticate .- the- in xx: -: -,409[Salt.crypt] [ERROR] [1525] The Salt Master has cached the PublicKey for ThisNode ThisSalt minion would wait for TenSeconds before attempting to re-authenticate
Re-authentication on master (there may be delays, multiple refreshes several times)
[Email protected] master]# Salt-key-laccepted keys:salt-client-GenevaDenied keys:unaccepted Keys: Salt-client--minion-rejected Keys:
[Email protected] master]# salt-key-a'salt-minion-01'-ythe following keys is going to be accepted:unaccepted Keys:salt-minion- onKey forMinion salt-minion- onaccepted. [[Email protected]-server master]# Salt-key-laccepted Keys:salt-client- GenevaSalt-minion- onDenied keys:unaccepted Keys:salt-client- onrejected Keys:[[email protected]-server master]# Salt'*'Test.pingsalt-minion- on: Truesalt-client- Geneva: True
Above with Salt-key-l to see salt-client-01 waiting for authentication, is because of the reason of the cache
[[Email protected]Server master]# pwd/etc/salt/pki/Master[[email protected]-Server master]# ll minions #通过认证的keytotal8-rw-r--r--.1Root root451Sep - xx: -salt-client- Geneva-rw-r--r--.1Root root451Sep in xx: Asalt-minion- on[[Email protected]-server master]# ll minions_pre waiting for certified keytotal4-rw-r--r--.1Root root451Sep in xx: *salt-client- on[[Email protected]-Server master]# CD Minions_pre[[email protected]-Server minions_pre]# Lssalt-client- on#把它删除 See it again, it won't be there [email protected]-server minions_pre]# RM-RF salt-client- on[[Email protected]-server minions_pre]# ls[[email protected]-server minions_pre]# Salt-key-laccepted Keys:salt-client- GenevaSalt-minion- onDenied keys:unaccepted keys:rejected Keys:
[Email protected] minions_pre]# Salt-key-laccepted Keys:salt-client- GenevaSalt-minion- onDenied keys:unaccepted keys:rejected keys:[[email protected]-server minions_pre]# Salt'*'Test.pingsalt-minion- on: Truesalt-client- Geneva: True[[email protected]-server minions_pre]# Salt'*'Cmd.run'df-h'Salt-minion- on: Filesystem Size used Avail use%mounted on/dev/sda3 18G 917M 16G6% /tmpfs 495M 12K 495M1%/dev/SHM/DEV/SDA1 485M 31M 429M7% /Bootsalt-client- Geneva: Filesystem Size used Avail use%mounted on/dev/sda3 18G 916M 16G6% /tmpfs 495M 12K 495M1%/dev/SHM/DEV/SDA1 485M 31M 429M7%/boot
Saltstack (hostname renamed)