目录

Use Saltstack

准备

Centos6.6 192.168.99.234 web1.mulinux.com 192.168.99.235 web2.mulinux.com

部署测试

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[root@web1 ~]# yum install -y epel-release
[root@web1 ~]# yum install -y salt-master salt-minion
[root@web2 ~]# yum install -y epel-release
[root@web1 ~]# vi /etc/salt/minion
master: 192.168.99.234 #修改16行添加master的ip
[root@web1 ~]# /etc/init.d/salt-master start
[root@web1 ~]# /etc/init.d/salt-minion start
[root@web1 ~]# ps aux | grep salt
[root@web2 ~]# vi /etc/salt/minion
master: 192.168.99.234 #修改16行添加master的ip
[root@web2 ~]# /etc/init.d/salt-minion start
[root@web2 ~]# ps aux | grep salt
[root@web1 ~]# salt-key
Accepted Keys:
Denied Keys:
Unaccepted Keys:
web1.mulinux.com
web2.mulinux.com
Rejected Keys:
[root@web1 ~]# salt-key -a web2.mulinux.com
The following keys are going to be accepted:
Unaccepted Keys:
web2.mulinux.com
Proceed? [n/Y] y
Key for minion web2.mulinux.com accepted.
[root@web1 ~]# salt-key
Accepted Keys:
web2.mulinux.com
Denied Keys:
Unaccepted Keys:
web1.mulinux.com
Rejected Keys:
[root@web1 ~]# salt-key -a web1.mulinux.com
The following keys are going to be accepted:
Unaccepted Keys:
web1.mulinux.com
Proceed? [n/Y] y
Key for minion web1.mulinux.com accepted.
[root@web1 ~]# salt-key
Accepted Keys:
web1.mulinux.com
web2.mulinux.com
Denied Keys:
Unaccepted Keys:
Rejected Keys:
[root@web1 ~]# salt-key --help
[root@web2 ~]# ls /etc/salt/pki/minion/minion
minion_master.pub  minion.pem         minion.pub