centos7下配置saltstack
阿新 • • 發佈:2018-01-01
int firewall 配置文件 開機自啟動服務 roc centos7 gpo mct lld
1、下載
使用yum方式即可,可以更換下yum源,這裏使用的阿裏雲的
[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
2、設置開機自啟動服務
systemctl enable salt-minion.service systemctl enable salt-master.service
這裏我在一臺機器上安裝了一個master和一個minion
3、啟動服務
systemctl start salt-master.service
systemctl start salt-minion.service
4、關閉防火墻
systemctl disable firewalld.service setenforce 0
5、查看是否認證成功
修改master和minion端的配置文件,這裏直接使用sed修改
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
修改完成後需要重啟下服務,然後再來驗證是否認證成功
[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
centos7下配置saltstack