I. Introduction of Saltstack
Saltstack is a new basic setup management approach that is easy to deploy, works in minutes, scales well, and easily manages tens of thousands of servers, fast enough, and second-level communication between servers. By deploying the Saltstack environment, we can execute batch commands on thousands of servers, configure centralized management according to different business features, distribute files , collect server data , Operating system base and software package management , Saltstack is the operation and maintenance personnel to improve work efficiency, standardize business configuration and operations of the weapon.
second, the experimental environment
1. Version
System version: CentOS 6.4 64bitPython version: Native version 2.6Salt version: 2014.7.1
2. Experimental architecture
salt-master:192.168.1.225 soft:salt-mastersalt-minion01:192.168.1.226 soft:salt-minionsalt-minion02:192.168.1.228 soft:salt-minion
Third, start to install salt
This installation Saltstack uses Yum installation, so third-party yum sources (Epel and rpmforge) are required
1. Install Epel source
# RPM-IVH http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm# sed-i ' [email protected]^#@@ '/ etc/yum.repos.d/epel.repo# sed-i ' [email protected]@#[email protected] '/etc/yum.repos.d/epel.repo
2. Install Rpmforge source
# RPM-UVH http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
3. Install dependent packages
# yum-y Install PYTHON-JINJA2
4. Install Saltstack Package
Server Installation Salt-master Package # Yum-y Install Salt-master remaining managed end installed Salt-minion Package # yum-y Install Salt-minion
Iv. start configuration of Saltstack
1. Modify the Minion configuration file
# vim/etc/salt/minionmaster:192.168.0.106id:saltstack_minion_01#master IP Address, note that there must be a space after the colon, otherwise syntax error # Client identification Used to display the Salt-key in the Public key list, otherwise the IP address is displayed; must have a space after the colon
2. Optional parameters
# vim/etc/salt/masterauto_accept:true# to True indicates that the master side automatically accepts requests, or false to accept authentication requests manually, otherwise it has been verified
V. Launch of Saltstack Service
1. Server Start salt-master Service #/etc/init.d/salt-master Start2, controlled end start salt-minion Service #/etc/init.d/salt-minion start
Vi. Use of Saltstack
1. View the list of public keys on the master side
[Email protected] ~]# salt-key-laccepted keys:saltstack_minion_01 saltstack_minion_02 unaccepte D keys:rejected Keys:
2. Test the connectivity of the host, the usage of the hard disk, the network interface address
# salt ' * ' test.ping# salt ' * ' disk.usage# salt ' * ' network.interfaces
3. Execute command Test remotely
# salt ' * ' cmd.run date# salt ' * ' cmd.run uptime# salt ' * ' Cmd.run ' df-h ' # salt ' * ' cmd.run ' ls-l/etc '
# salt ' * ' pkg.install vim
Vii.. Salt-key parameters
1. Salt-key Common options
#列出所有的公钥
#接受指定的公钥
#接受所有正在请求的公钥
#拒绝指定的公钥
#拒绝所有正在请求的公钥
#删除指定的公钥
#删除所有的公钥
2. Salt-key return information
Accepted Keys: Accepted list of public keys or controlled host
unaccepted keys: List of non-accepted public keys
Rejected keys: List of denied public keys
This article is from the "Zheng" blog, make sure to keep this source http://467754239.blog.51cto.com/4878013/1620989
Efficient operation and maintenance 1:saltstack installation configuration