架构

server1  master     写好httpd  nginx 等salt

server2 3 minion  

server4  top master

 

server1

salt-key -d server4

server4

vim /etc/salt/master

order_masters: True

 

server1

yum install salt-syndic -y

vim /etc/salt/master

syndic_master: server4

systemctl start salt-syndic

systemctl restart salt-master

server4

[[email protected] ~]# salt-key -L


salt-key -A

server4 

salt server2 test.ping

[[email protected] ~]# salt '*' test.ping
server1:
    True
server2:
    True
server3:
    True

salt server2 state.sls httpd.service

相当于级联,server4不需要salt文件就可以通过master下达指令

saltstack架构拓展syndic||ssh

[[email protected] ~]# salt '*' state.highstate
server2:
----------
          ID: /etc/httpd/conf/httpd.conf
    Function: file.managed
      Result: True
     Comment: File /etc/httpd/conf/httpd.conf is in the correct state
     Started: 09:35:34.869931
    Duration: 245.621 ms

SSH方式

不如ansible的ssh方便

无需安装minion,

全部关闭minion

systemctl stop salt-minion

server1

yum install salt-ssh  -y

vim     /etc/salt/roster

server2:
  172.25.11.2

[[email protected] ~]# salt-ssh server2  test.ping -i
Permission denied for host server2, do you want to deploy the salt-ssh key? (password required):
[Y/n] y
Password for [email protected]:
server2:
    True

[[email protected] ~]# salt-ssh server2  test.ping
server2:
    True

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

相关文章:

  • 2021-12-23
  • 2021-09-28
  • 2021-09-04
  • 2022-12-23
  • 2021-04-30
  • 2021-08-30
  • 2021-12-28
  • 2021-10-15
猜你喜欢
  • 2021-08-27
  • 2021-06-04
  • 2021-04-14
  • 2021-10-28
  • 2021-07-31
  • 2022-12-23
相关资源
相似解决方案