Saltstack Batch Deployment Tool
What is saltstack about? What's the effect? We do not introduce here, if you do not understand the students can go to the Internet search, and understand the relevant technical information.
The host division of this time is:
1, master:192.168.30.131
2, slave-1:192.168.30.132
3, slave-2:192.168.30.133
First, before installing Saltstack, let's start by starting the CentOS environment we use and installing the required software:
The following actions are to be operated on three hosts:
1, install the compilation tool gcc, gcc-c++;
# yum-y Install gcc-c++
# yum-y Install Epel-release
Install the master server side:
# yum-y Install Salt-master
To modify a configuration file:
A, modify the master's listening address: that is, the server itself address
# sed-i "s/#interface:. *$/interface:192.168.30.131/g"/etc/salt/master
# Grep-ev "^$|^#"/etc/salt/master
interface:192.168.30.131
B, modify auto_accept to true: Automatic authentication, or use Salt-key to do manual verification
# sed-i "s/#auto_accept:. *$/auto_accept:true/g"/etc/salt/master
# Grep-ev "^$|^#"/etc/salt/master
interface:192.168.30.131
Auto_accept:true
install two customer Rui: Here is a sample of slave-1
# yum-y Install Salt-minion
To Modify a configuration file:
# Sed-i "s/#master:. *$/master:192.168.30.131/g"/etc/salt/minion # Master: Address
# sed-i "s/#id:.*$/id:slave-1/g "/etc/salt/minion# ID: Client flag, use hostname as indicator
# sed-i "/#loop_interval: 60/a schedule:\n highstate:\n function:state.highstate\n seconds:30"/etc/salt /minion
( #This parameter: Customer Rui every 30s to the server synchronization resources, time can be casual DIY, format: mintus:hours;same as client manually executing salt-call state.highstate command)
# Grep-ev "^$|^#" /etc/salt/minion
master:192.168.30.131
Id:slave-1
Schedule
highstate:
function:state.highstate
Seconds:30
Start the service:
A,/etc/init.d/salt-master start # Master service start: Log default address:/var/log/salt/master
B,/etc/init.d/salt-minion start # Slave service start: Log default address:/var/log/salt-minion
To view the master server listening port:
# Netstat-an |grep 4505
TCP 0 0 192.168.30.131:4505 0.0.0.0:* LISTEN
TCP 0 0 192.168.30.131:4505 192.168.30.133:59243 established
TCP 0 0 192.168.30.131:4505 192.168.30.132:33308 established
to view the slave client listening port:
# Netstat-an|grep 4505
TCP 0 0 192.168.30.132:33308 192.168.30.131:4505 established
Go to the server to verify that the certificate has come up:
# salt-key-l
Accepted Keys:
Slave-1
Slave-2
Denied Keys:
unaccepted Keys:
Rejected Keys:
The deployment to this saltstack has been completed, if there are more than one, only need to install and configure on the client!
Note: If you do not see any host information after running SALT-KEY-L, check the settings for iptables.
This article is from the "Elephant" blog, make sure to keep this source http://zlyang.blog.51cto.com/1196234/1792638
Saltstack Rapid Deployment