一. Saltstack 双master
master1 -------------------master2
|
minion
master1
1.yum -y install salt-master
2.vim /etc/salt/master
auto_accept: True
master2
1.yum -y install salt-master
2.vim /etc/salt/master
auto_accept: True
拷贝 maser1的
/etc/salt/pki/master/master.pem
/etc/salt/pki/master/master.pub
以上两个文件覆盖掉
minion
1.yum -y install salt-minion
2.vim /etc/salt/minion 添加下面内容
master:
- master1
- master2
id: minion
当其中一台master挂了 另一台依然可以使用
二. Saltstack syndic集群架构
master 192.168.90.177
syndic1 192.168.90.178
syndic2 192.168.90.185
minion 192.168.90.186
master
# salt-key -L
Accepted Keys:
192.168.90.178
syndic1
# salt-key -L
Accepted Keys:
192.168.90.185
Denied Keys:
syndic2
#salt-key -L
Accepted Keys:
192.168.90.186
192.168.90.177 master (安装salt-master)
192.168.90.178 syndic1 (安装salt-mater和salt-syndic)
192.168.90.185 syndic2 (安装salt-mater和salt-syndic )
192.168.90.186 minion (安装salt-minion)
1.master
# cat /etc/salt/master |grep -v "#" |grep -v "^ *$"
ipv6: False
interface: 192.168.90.177
auto_accept: True
state_top: top.sls
file_roots:
base:
- /etc/salt/base
prod:
- /etc/salt/prod
pillar_roots:
base:
- /etc/salt/pillar/base
prod:
- /etc/salt/pillar/prod
order_masters: True
2.syndic1
# cat /etc/salt/master |grep -v "#" |grep -v "^ *$"
interface: 192.168.90.178
ipv6: False
auto_accept: True
file_roots:
prod:
- /etc/salt/prod
order_masters: True
syndic_master: 192.168.90.177
3.syndic2
# cat /etc/salt/master |grep -v "#" |grep -v "^ *$"
ipv6: False
auto_accept: True
file_roots:
prod:
- /etc/salt/prod
syndic_master: 192.168.90.178
4.minion
# cat /etc/salt/minion |grep -v "#" |grep -v "^ *$"
master: 192.168.90.185
id: 192.168.90.186
当在master上执行
#salt '192.168.90.186' state.highstate 时 会去执行syndic2上 配置的top.sls文件,不会执行master上和syndic1上的file_roots、pillar和grains定义的内容。
三.混合的
大致相同。
本文转自潘阔 51CTO博客,原文链接:http://blog.51cto.com/pankuo/1984227,如需转载请自行联系原作者