Install and use saltstack

Source: Internet
Author: User
Tags saltstack

Saltstack is a centralized and lightweight automated O & M management tool with puppet and func functions. It is written in Python and has powerful functions and can be quickly installed using epel. Compared with puppet, installation and configuration are easier and easier.

 

Epel install

[[email protected] ~]# rpm -Uvh  http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm###CentOS 5.x###rpm -Uvh https://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

 

1. Install salt-master (only installed on Master hosts)

[[Email protected] ~] # Yum-y install salt-master salt #### salt-minmion managed machine ### [email protected] ~] # Yum-y install salt-minion

 

2. Configure saltstack

############# Salt-master ################### [email protected] ~] # Awk '! /^ [\] $/'/Etc/salt/master # users running salt, which affects the execution permission of salt # User: Root # s alt running thread, the more open threads, the faster the processing speed, but generally the number of CPUs should not exceed # worker_threads: 10 # Management port of the master # publish_port: 4505 # communication port between the master and Minion, used for file service, authentication, acceptance of returned results, etc. # ret_port: 4506 # If the salt-syndic running on this master node is connected to a higher level master, then this parameter needs to be configured as the listening port of the connected high-level master # syndic_master_port: 4506 # specify the PID file location # pidfile: /var/run/salt-master.pid # saltstack can control the starting position of the file system # root_dir :/# Log File address # LOG_FILE:/var/log/salt_master.log # grouping setting # nodegroups: group_all: '*' # root directory when the salt state is executed # file_roots: base: -/etc/salt/file # Set the pillar root directory # pillar_roots: base: -/etc/salt/pillar ############### salt-Minion ################ # [[email protected] ~] # Awk '! /^ [\] $/'/Etc/salt/minion # minion identification ID, which can be an IP address, domain name, or a string that can be parsed by DNS # ID: 192.168.1.99 # user permissions for running salt # User: Root # ID of the master, which can be an IP address, domain name, or a string that can be parsed by DNS # Master: 192.168.1.99 # Master communication port # master_port: 4506 # backup mode. Minion is a local backup. When file management is performed, the file backup mode # backup_mode: minion # output mode when executing salt-call # output: Nested # Time for minion to wait for the master to receive authentication # acceptance_wait_time: 10 # number of failed reconnections, 0 indicates unlimited, if the value is not zero, the system keeps trying to set the value. # acceptance_wait_time_max: 0 # Re-authentication delay time, which can avoid SYN storms that require re-authentication by minion due to changes in the master key # random_reauth_delay: 60 # Log File Location # LOG_FILE: /var/logs/salt_minion.log # basic file path location # file_roots: Base:-/etc/salt/minion/file # basic position of pillar # pillar_roots: base: -/data/salt/minion/pillar #### start saltstack #### [email protected] ~] # Service salt-master startstarting salt-master daemon: [OK] [email protected] ~] # Service salt-Minion startstarting salt-Minion daemon: [OK] or [email protected] ~] # Python2.6/usr/bin/salt-master-d [[email protected] ~] # Python2.6/usr/bin/salt-Minion-D #### compatibility problems in Python 3.0 ####

 

3. Test saltstck

[[Email protected] ~] # Salt-keyaccepted keys: unaccepted keys: 192.168.1.99rejected keys: [[email protected] ~] # Salt-key-y-A 192.168.1.99the following keys are going to be accepted: unaccepted keys: 192.168.1.99key for Minion 192.168.1.99 accepted. # Remove authentication for salt-Minion # [email protected] ~] # Salt-key-y-D 192.168.1.99deleting the following keys: accepted keys: 192.168.1.99key for Minion 192.168.1.99 deleted. # test # [email protected] ~] # Salt '192. 168.1.99' test. Ping -- show-timeout192.168.1.99: True

 

» Reprinted copyright: It Chen Yi» "saltstack installation and use"» This article link address: http://www.ipython.me/centos/saltstack-install-and-using.html» copyright adopted: BY-NC-SA protocol for authorization, reprinted with the source. All articles on this site are original except it-tools, news, and special notes .» If you like: Click here to subscribe to this site

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.