1.1 Installing the Epel source
# cd/usr/local/src/
# wget http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
# RPM-IVH epel-release-6-8.noarch.rpm
1.2 installation Rpmforge
This step is important, there is no python-jinja2 on the Epel source of Redhat 6 and CentOS 6, and a change card is installed at the beginning .
1 wgethttp://apt.sw.be/redhat/el6/en/x86_64/rpmforge/rpms/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
RPM-UVH rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
2. Installing dependent packages
Yum Install PYTHON-JINJA2
3 Installing saltstack
only one installation master is required , and all other installations are minion.
3.1 Installation Salt-master
# yum-y Install Salt-master
3.2 Installation salt-minion
#yum-y Install Salt-minion
4 Configuring Saltstack
4.1 configuration of server-side Master
Vi/etc/salt/master
interface:121.41.80.171
See clearly interface front There are two spaces , This line of code means I want to connect the saltstack Master is 121.41.80.171
4.2 Minion Configuration
Vi/etc/salt/minion
master:121.41.80.171
See that there are two spaces in front of master, this line of code indicates that the master of the saltstack I want to connect to is 121.41.80.171
5 Start saltstack
5.1 start Master
Service Salt-master Start
5.2 Start minion
Service Salt-minion Start
Set boot auto-start
Chkconfig Salt-master on
Chkconfig salt-minion on
Salt-key
Accepted Keys:
Denied Keys:
unaccepted Keys:
Node2
Rejected Keys:
If there's something inside unaccepted keys,
Salt-key-a Node2
After executing this sentence, the Minion end appears minion_master.pub
Remote execution commands
Salt ' * ' Cmd.run "hostname"
Salt ' * ' Cmd.run "df-m"
This article is from the DBA Sky blog, so be sure to keep this source http://9425473.blog.51cto.com/9415473/1683882
Preliminary study on Saltstack