SaltStack配置
SaltStack配置
内容:实现master和minions的配置及远程命令
配置环境如下:
主机系统:ubuntu 14.04
192.168.136.128 master ub
192.168.136.130 minion1 ub1 [webserver]
192.168.136.131 minion2 ub2 [dbserver]
修改/etc/hosts
192.168.136.128 ub 192.168.136.130 ub1 192.168.136.131 ub2
1.配置Master
修改/etc/salt/master
interface: 192.168.136.128
然后重启salt-master服务
service salt-master restart
在每个minion中配置/etc/salt/minion
master: 192.168.136.128
重启salt-minion服务
然后重启salt-master服务
service salt-minion restart
2.启动salt
2.1.master
然后重启salt-master服务
#salt-master
minion
#salt-minion
3.key management
3.1 master
#salt-key -L Accepted Keys: Unaccepted Keys: ub1 ub2 Rejected Keys:
接受minions的keys
root@ubuntu:~# salt-key -A The following keys are going to be accepted: Unaccepted Keys: ub1 ub2 Proceed? [n/Y] Y Key for minion ub1 accepted. Key for minion ub2 accepted. root@ubuntu:~# salt-key -L Accepted Keys: ub1 ub2 Unaccepted Keys: Rejected Keys:
4.发送命令
master
root@ubuntu:~# salt 'ub1' test.ping ub1: True root@ubuntu:~# salt '*' test.ping ub1: True ub2: True
相关推荐
80327065 2020-06-28
80327065 2020-06-08
SSCCGo 2020-04-10
88403461 2020-03-28
88403461 2020-03-28
83317360 2020-03-28
82413564 2020-03-28
80183857 2020-03-28
SSCCGo 2020-03-28
SSCCGo 2020-03-26
SSCCGo 2020-03-23
80327065 2020-03-09
80183857 2020-02-27
80327065 2020-02-20
80327065 2020-02-03
SSCCGo 2019-12-28
80327065 2019-12-23
quguang 2019-12-02