1. Import the installation source
Centos5
-UVH http://FTP. Linux. NCSU. Edu/pub/epel/5/x86_64/epel-release-5 -4.noarch. RPM
Centos6
-UVH http://FTP. Linux. NCSU. Edu/pub/Epel/6/x86_64/epel-release-6 -8.noarch. RPM
2. Install the SALT package
Master side
Yum install salt-Master
Minion end (commonly known as client side)
Yum install salt-minion
3. Configuration changes
Master side
[[Email protected]~]# sed-e ' s/#.*//'-e '/^$/d '/etc/salt/masterInterface: 0.0.0.0Publish_port: 4505User:Rootmax_open_files: 100000Ret_port: 4506Pidfile: /Var/Run/salt-master. Pidsyndic_log_file: Syndic.: /var/< Span class= "PLN" >log/salt/masterkey_ Logfile: /var/log/salt/keylog_fmt_ Logfile: '% (asctime) s,% (msecs) 03.0f [% (name) -17s][% ( levelname) -8s]% (message) s '
Minion End
[[Email protected]~]# sed-e ' s/#.*//'-e '/^$/d '/etc/salt/minionMaster:Salt.Server.365dw.Cnmaster_port: 4506Pidfile: /Var/run/salt-minionpidpki_dir: /etc/salt/pki/ minionid: Client01.. 365dw. Cncachedir: /var/< Span class= "PLN" >cache/salt/minion
4. Restart the server and the client
Master side:
/etc/init. D/iptables stop/etc/init. D/salt-Master restart
Minion End:
/etc/init. D/iptables stop/etc/init. D/salt-Minion restart
5. Certificate Certification
Slat-Key-LView after discoveryunacceptedKeys[[Email protected]~]# salt-key-lAccepted Keys:unaccepted Keys:client01.Server.365dw.cnRejected Keys:Salt-Key-ACertificationProceedInputY[[Email protected]~]# salt-key-aTheFollowing keys is going to be accepted:unaccepted Keys:client01.Server.365dw.cnProceed? [N/Y]YKey ForMinion client01.Server.365dw.CN accepted.AgainSalt-Key-l View, unaccepted keys< Span class= "pun" > The unauthenticated client becomes a client accept[[email protected] ~] # salt-key-laccepted Keys:client01.. 365dw. Cnunaccepted keys:< Span class= "Typ" >rejected keys:
6. Test, use the salt built-in cmd.run command to ping the test.
[[Email protected]~]# salt ' * ' cmd.run ' ping-c1 www.365dw.cn 'client01.Server.365dw.cn:PING www.365dw.cn(112.124.43.79) 56(84)bytes of data. 64Bytes from112.124.43.79:Icmp_seq=1Ttl=128Time=12.5Ms---Www.365dw.CN Ping statistics --- 1, 1 received , 0% packet Loss, time 0ms RTT min/ avg/max/mdev = 12.534/12.534/12.534/0.000 Ms
CentOS Yum Installation saltstack