SaltStack进阶之salt-syndic分布式架构
程序员文章站
2022-03-03 10:41:53
SaltStack进阶之salt-syndic分布式架构1. salt-syndic分布式架构1.1 salt-syndic架构图1.2 salt-syndic的优劣势2. salt-syndic部署2.1 在syndic上安装salt-syndic2.2 修改master配置文件2.3 修改syndic配置文件2.4 修改minion配置文件2.5 syndic端接收minion的key2.6 master端接收syndic的key2.7 在master端测试有几个minion端回应 1. s...
SaltStack进阶之salt-syndic分布式架构
1. salt-syndic分布式架构
1.1 salt-syndic架构图
1.2 salt-syndic的优劣势
优势:
- 可以通过syndic实现更复杂的salt架构
- 减轻master的负担
劣势:
- syndic的/srv目录下的salt和pillar目录内容要与最顶层的master下的一致,所以要进行数据同步,同步方案同salt-master高可用
-
最顶层的master不知道自己有几个syndic,它只知道自己有多少个minion,并不知道这些minion是由哪些syndic来管理的
2. salt-syndic部署
主机 | IP | 安装的应用 |
---|---|---|
master | 192.168.30.150/24 | salt-master |
syndic | 192.168.30.244/24 | salt-master salt-syndic |
minion | 192.168.30.245/24 | salt-minion |
2.1 在syndic上安装salt-syndic
[root@syndic ~]# yum -y install salt-master salt-syndic
2.2 修改master配置文件
//取消order_masters注释,并将值给为True
[root@master ~]# vim /etc/salt/master
......
order_masters: True ##改为True
[root@master ~]# systemctl restart salt-master
[root@master ~]# systemctl enable salt-master
2.3 修改syndic配置文件
//取消syndic_master注释.并改成master端IP
[root@syndic ~]# yum -y install salt-master salt-syndic
[root@syndic ~]# vim /etc/salt/master
......
syndic_master: 192.168.30.150 ##master端IP
[root@syndic ~]# systemctl start salt-syndic
[root@syndic ~]# systemctl start salt-master
[root@syndic ~]# systemctl enable salt-syndic
[root@syndic ~]# systemctl enable salt-master
2.4 修改minion配置文件
//将master指向syndic
[root@minion ~]# vim /etc/salt/minion
......
master: 192.168.30.244 ##改为syndic的IP
[root@minion ~]# systemctl start salt-minion
[root@minion ~]# systemctl enable salt-minion
2.5 syndic端接收minion的key
[root@syndic ~]# salt-key -L
Accepted Keys:
Denied Keys:
Unaccepted Keys:
minion //key
Rejected Keys:
[root@syndic ~]# salt-key -Ay
The following keys are going to be accepted:
Unaccepted Keys:
minion
Key for minion minion accepted.
[root@syndic ~]# salt-key -L
Accepted Keys:
minion //key
Denied Keys:
Unaccepted Keys:
Rejected Keys:
2.6 master端接收syndic的key
[root@master ~]# salt-key -L
Accepted Keys:
Denied Keys:
Unaccepted Keys:
syndic
Rejected Keys:
[root@master ~]# salt-key -Ay
The following keys are going to be accepted:
Unaccepted Keys:
syndic //key
Key for minion syndic accepted.
[root@master ~]# salt-key -L
Accepted Keys:
syndic //key
Denied Keys:
Unaccepted Keys:
Rejected Keys:
2.7 在master端测试有几个minion端回应
[root@master ~]# salt '*' test.ping
minion:
True
最顶层的master不知道自己有几个syndic,它只知道自己有多少个minion
本文地址:https://blog.csdn.net/zyy130988/article/details/108211371