centos7下配置saltstack

一、下载阿里云

使用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
相关文章
相关标签/搜索