一、下載阿里雲
使用yum方式便可,能夠更換下yum源,這裏使用的阿里雲的spa
[root@salt-master ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum -y install epel-release
yum clean all
yum makecache
yum -y install salt-master salt-minion
二、設置開機自啓動服務code
systemctl enable salt-minion.service
systemctl enable salt-master.service
這裏我在一臺機器上安裝了一個master和一個minionblog
三、啓動服務get
systemctl start salt-master.service
systemctl start salt-minion.service
四、關閉防火牆io
systemctl disable firewalld.service setenforce 0
五、查看是否定證成功ast
修改master和minion端的配置文件,這裏直接使用sed修改class
sed -i 's/#interface: 0.0.0.0/interface: 192.168.235.133/g' /etc/salt/master sed -i 's/#master/master: 192.168.235.133/g' /etc/salt/minion sed -i 's/#id/id: m1/g' /etc/salt/minion
修改完成後須要重啓下服務,而後再來驗證是否定證成功test
[root@localhost ~]# salt-key -L Accepted Keys: Denied Keys: Unaccepted Keys: m1 Rejected Keys: [root@localhost ~]# salt-key -A The following keys are going to be accepted: Unaccepted Keys: m1 Proceed? [n/Y] y Key for minion m1 accepted. [root@localhost ~]# salt-key Accepted Keys: m1 Denied Keys: Unaccepted Keys: Rejected Keys: [root@localhost ~]# salt m1 test.ping m1: True