Efficient operation and maintenance 1:saltstack installation configuration

Source: Internet
Author: User
Tags saltstack

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

    • The CMD module contains the output of the shell on the controlled side, such as Cmd.run and Cmd.run_all

# salt ' * ' cmd.run date# salt ' * ' cmd.run uptime# salt ' * ' Cmd.run ' df-h ' # salt ' * ' cmd.run ' ls-l/etc '
    • The PKG function automatically maps the package management of the local system to the SALT function

# salt ' * ' pkg.install vim

Vii.. Salt-key parameters

1. Salt-key Common options

    • -L,--list-all

#列出所有的公钥
    • -A ACCEPT,--accept=accept

#接受指定的公钥
    • -A,--accept-all

#接受所有正在请求的公钥
    • -R REJECT,--reject=reject

#拒绝指定的公钥
    • -R,--reject-all

#拒绝所有正在请求的公钥
    • -D DELETE,--delete=delete

#删除指定的公钥
    • -D,--delete-all

#删除所有的公钥

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.