centos7部署saltstack
这里演示centos7安装saltstack
| 角色 | ip地址 |
| salt-master | 192.16.30.100 |
| salt-minon | 192.16.30.101 |
| salt-minion | 192.16.30.102 |
环境
saltstack 官网 : https://repo.saltproject.io/index.html#rhel
找到对应的版本

然后照着文档操作
1. 在各个节点导入yum源
sudo rpm --import https://repo.saltproject.io/py3/redhat/7/x86_64/3004/SALTSTACK-GPG-KEY.pub curl -fsSL https://repo.saltproject.io/py3/redhat/7/x86_64/3004.repo | sudo tee /etc/yum.repos.d/salt.repo
2. 在 master节点执行
yum install salt-master -y
3. 在minion节点执行
yum install salt-minion -y
4. 修改配置文件
master
vim /etc/salt/master
interface: 0.0.0.0
publish_port: 4505
user: root
ret_port: 4506
pki_dir: /etc/salt/pki/master
auto_accept: True
syndic_master: 8.218.46.109
syndic_master_port: 4506
syndic_pidfile: /var/run/salt-syndic.pid
syndic_log_file: /var/log/salt/syndic
log_level: info
file_roots:
base:
- /srv/salt
minion 192.16.30.101
cat /etc/salt/minion master: 192.16.30.100 id: 192.168.30.101
minion 192.16.30.102
cat /etc/salt/minion master: 192.16.30.100 id: 192.168.30.102
启动服务
在salt master 上执行如下命令
[root@k8s-master ~]# salt-key -L Accepted Keys: Denied Keys: Unaccepted Keys: 192.16.30.101 192.16.30.102 192.168.30.101 Rejected Keys:
接受两个minion的key
salt-key -A
验证
[root@k8s-master ~]# salt "*" test.ping
192.16.30.102:
True
192.16.30.101:
True

浙公网安备 33010602011771号