Simple introduction to the saltstack of operation and maintenance automation

Source: Internet
Author: User
Tags saltstack

Simple introduction to the saltstack of operation and maintenance automation

  Vegetates and Idle, is decadent also, waste also. But look yesterday, the fee Dickens in addition to a bug will linger in the new, I do not know the east of the black, is a decadent decadent but abandoned. So today to repentance to the regret of yesterday.

Saltstack Introduction

Salt is a new foundation platform management tool. It takes just a few minutes to run, scalability is enough to support tens of thousands of servers, and data delivery can be done in seconds. is often described as a Func- enhanced version of +puppet Lite. So you may not understand, so simply say: Salt is a new way of infrastructure management, easy to deploy, in a few minutes to run, scalability, easy to manage tens of thousands of servers, fast enough, the server between the second level of communication. The salt bottom uses a dynamic connection bus that allows it to be used for orchestration, remote execution, configuration management, and so on.

Most importantly, the salt is open source, and it is an operational automation tool implemented by Python, which means that we can make some changes to it, build on it and add the features we want, and develop it two times. The source of salt is here. Interested friends can take a look. So is the installation of Saltstack simple? If you know the purpose of salt, then you will not ask. Just as many of the most powerful and useful engineering solutions are built on simple principles. Saltstack also made every effort to do that: K.I.S.S. (Keep It stupidly simple to stupid).

Environment Introduction

System: CentOS6.5 two units

Windows Server R2

Here is the machine of one of the CentOS system as master, the other CentOS computer and Windows computer as minion, according to the understanding of English translation is that one is used to control the other two.

Salt installation and configuration

Installation and configuration of the salt CentOS:

    1. First, if Epel is not currently enabled on your system, you need to start it with the following command (PS: The following command needs to be performed on both machines):
1 http://ftp.linux.ncsu.edu/pub/epel/6/i386/epel-release-6-8. noarch.rpm

2. next, because the salt master and the Minion package is separate, so the machine needs to install the appropriate package, usually, a master will correspond to multiple minion.

Run on Master:

1 Yum install Salt-master

run on Minion:

1 Yum install salt-minion

At this point, the master on the CentOS installation is ready.

3. Next, do not start, first to Minion configuration, in the/etc/salt/minion file, find the master line, remove the comments, and then the master's IP or hostname written after the colon. Then find the ID, also remove the comment, the machine's IP or hostname write up. Well, CentOS is finished.

Installation and configuration of Salt's windows:

First, download the Windows Salt-minion, which is linked here: Salt-minion-2014.7.0-x86-setup.exe.

1. After the download is complete, click Install, then, always next, until you meet an input box, the first line is to enter your master's IP, of course hostname is OK. The second line is your native IP or hostname.

2. After the installation, go to the Salt folder in the C drive to see if there is a PKI folder and two files under your Conf folder, one is Minion, and the other is minion_id file. If not, create a minion file yourself, without a suffix, and then write the master and ID in the same configuration as the Linux version.

Start the service

If you have completed the above steps, congratulations on your imminent victory, now, start your master:

1 Service Salt-master start

Next, launch your Minion,linux version to start as follows:

1 Service salt-minion start

  The Windows Startup method is to enter the Salt folder in the C drive, then start Salt-minion.exe, so that you start your salt, and then go to Master to execute the following command:

1 salt-key-l

If the steps are not a problem, you will see this interface:

1 [email protected] ~]# salt-key-l 2 Keys: 3 Keys: 4 172. 1. 1.  the 5 172. 1. .  - 6 Keys:

then execute the following command to accept the authentication request:

1 [email protected] ~]# salt-key-a2The following keys is going to beaccepted:3unacceptedKeys:4 172.1.1. the5 172.1. +. -6 Proceed? [n/y] Y7Key for Minion172. -.1. theaccepted.8Key for Minion172. -. +. -Accepted.

Next you can take a look at the Minion you can control now:

1 [email protected] ~]# salt-key-l 2 Keys: 3 172. . 1.  the 4 172. . .  - 5 Keys: 6 Keys:
View Code

To test

The simplest test follows: The following command is executed at master:

1 172. . .  - Test . Ping 2 172. . .  - : 3     True

Then here is the result of the feedback. Is true to show that control is already available, then we control minion install a software test.

In Minion detection software:

1 [email protected] ~]# Rpm-qa | grep mysql 2 mysql-server-5. 1. 3. el6_5.x86_643 mysql-libs-5. 1. 3. el6_5.x86_644 mysql-5. 1. 3. el6_5.x86_64

You can see only three MySQL-related. Then we control minion on master to install a package:

1[email protected] ~]# salt172. -. +. -Pkg.install sources='[{"MySQL": "http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm"}]'2 172. -. +. -:3     ----------4mysql-community-Release:5         ----------6         NEW:7el6-58         Old :
View Code

According to the feedback information, old is empty, stating that there was no such software, and new is the software we just installed. Next, let's go to minion to see if the software has been successfully installed:

1 [email protected] ~]# Rpm-qa | grep mysql2mysql-server-5.1. the-3. el6_5.x86_643mysql-libs-5.1. the-3. el6_5.x86_644mysql-5.1. the-3. el6_5.x86_645 [email protected] ~]# Rpm-qa | grep mysql6mysql-server-5.1. the-3. el6_5.x86_647mysql-community-release-el6-5. Noarch8mysql-libs-5.1. the-3. el6_5.x86_649mysql-5.1. the-3. el6_5.x86_64
View Code

  We can clearly see that there is a lot more software than before, which means we have successfully installed the software.

Above, is the simple introduction of salt and installation use.

If you want to learn more about salt, please go to the official website.

The new words of the kiss-resistant again in call me, after the pan went first.

PS: This blog welcome forwarding, but please specify the blog address and author ~

Blog Address: http://www.cnblogs.com/voidy/

<. ))) ≦

Simple introduction to the saltstack of operation and maintenance automation

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.