saltstack之salt-syndic分布式架构

salt-syndic分布式架构
环境说明:

主机ip
master192.168.10.20
syndic192.168.10.30
minion192.168.10.40
minion1192.168.10.50

syndic端安装salt-master与salt-syndic

[root@syndic ~]# rpm --import https://repo.saltproject.io/py3/redhat/8/x86_64/latest/SALTSTACK-GPG-KEY.pub
[root@syndic ~]# curl -fsSL https://repo.saltproject.io/py3/redhat/8/x86_64/latest.repo | tee /etc/yum.repos.d/salt.repo
[salt-latest-repo]
name=Salt repo for RHEL/CentOS 8 PY3
baseurl=https://repo.saltproject.io/py3/redhat/8/x86_64/latest
skip_if_unavailable=True
failovermethod=priority
enabled=1
enabled_metadata=1
gpgcheck=1
gpgkey=https://repo.saltproject.io/py3/redhat/8/x86_64/latest/SALTSTACK-GPG-KEY.pub
[root@syndic ~]# yum -y install salt-master salt-syndic

修改master的/etc/salt/master配置文件

[root@master ~]# vim /etc/salt/master
......
# masters' syndic interfaces.
order_masters: True  取消注释改为True  
......
[root@master ~]# systemctl restart salt-master

配置syndic的/etc/salt/master配置文件

[root@syndic ~]# vim /etc/salt/master
.....
syndic_master: 192.168.10.20   取消注释,将syndic_master的值设为master的IP
……

[root@syndic ~]# systemctl enable salt-master
Created symlink /etc/systemd/system/multi-user.target.wants/salt-master.service → /usr/lib/systemd/system/salt-master.service.
[root@syndic ~]# systemctl enable salt-syndic
Created symlink /etc/systemd/system/multi-user.target.wants/salt-syndic.service → /usr/lib/systemd/system/salt-syndic.service.
[root@syndic ~]# systemctl restart salt-master
[root@syndic ~]# systemctl restart salt-syndic

配置minion

配置minion,将master指向syndic所在主机
[root@minion1 ~]# vim /etc/salt/minion
......
master: 192.168.10.30
......
[root@minion1 ~]# systemctl restart salt-minion
[root@minion1 ~]# systemctl enable salt-minion
Created symlink /etc/systemd/system/multi-user.target.wants/salt-minion.service → /usr/lib/systemd/system/salt-minion.service.

在syndic上接受minion主机的key

[root@syndic ~]# salt-key -L
Accepted Keys:
Denied Keys:
Unaccepted Keys:
minion
minion1
Rejected Keys:
[root@syndic ~]# salt-key -A
The following keys are going to be accepted:
Unaccepted Keys:
minion
minion1
Proceed? [n/Y] y
Key for minion minion accepted.
Key for minion minion1 accepted.
[root@syndic ~]# salt-key -L
Accepted Keys:
minion
minion1
Denied Keys:
Unaccepted Keys:
Rejected Keys:

在master上接受syndic主机的key

[root@master ~]#  salt-key -ya syndic
The following keys are going to be accepted:
Unaccepted Keys:
syndic
Key for minion syndic accepted.
[root@master ~]# salt-key -L
Accepted Keys:
syndic
Denied Keys:
Unaccepted Keys:
master
Rejected Keys:

在master上检验有几个minion应答

[root@master ~]# salt '*' test.ping
minion1:
    True
minion:
    True
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值