Saltstack Learning Note 12-Other components

Source: Internet
Author: User
Tags saltstack

Saltstack also contains a number of other functional components, including two more contacts with more than two


Mine

Mine is a component of Saltstack phone Minion data storage to master, it functions like grains, mine can specify any minion module to collect data. But Master can only store the last segment of data collected by Minion, and mine's main application scenario is to dynamically generate mine reporting information with the front-end load balancer for dynamic generation of configuration files


The official website dynamically generates HAPROXY.CFG files by mine.get the network card address of the specified business device


Mine also supports the address of the Get Docker container, which allows for the simple dynamic addition of business


Mine configuration is currently supported in two ways, the first is defined in the Minion configuration file, and the other is the way to distribute the Mine Collection task through the module

For more usage of the mine module, you can use the Sys.doc Mine command to view


Below we have a module to distribute a collection of DOCKER0 network card address of the task:


Salt ' minion ' mine.send Network.ip_addrs Interface=docker0


Salt ' minion ' mine.get ' Minion ' Network.ip_addrs

Through the mode of the module we easily issued mine collection tasks, Mine.get usage is very simple, followed by the module name and function can be


Mine also supports the way defined by the Minion file

Mine_functions:

Network.ip_addrs:

Interface:eth0

Mine_interval is defined mine acquisition cycle, Mine_functions is a reference module into the collection, about the network module usage can be used Sys.doc view

After modifying the Minion configuration file, restart the Minion service, and finally we mine.get the way to read the mine information.


Salt ' minion1 ' mine.get ' Minion1 ' Network.ip_addrs

-------------------------------------------------------------------------------

Peer

The peer component is a component of Minion publishing tasks to master in Saltstack, and using peer we can publish some tasks to master directly on Minion, as we do on master.


The default peer is not configured, and configuring peer is very simple, just modify the master file to

Peer

Minion1:

-Test.ping

Peer_run:

Minion1:

-Manage.up


Peer is the control Minion execution module, Peer_run is the control minion execution runner

The above example specifies that Minion can publish test.ping and runner Manage.up two task permissions to master

Module and ID This batch supports regular expressions

Control minion can publish all the functions of the test module, configure Test.* to

The master service needs to be restarted after peer configuration is complete

Let's start by publishing a task to master on minion, first we perform the test.ping task

Salt-call publish.publish ' Minion1 ' test.ping

Run the other modules

Salt-call publish.publish ' minion1 ' Test.echo saltstack

found that the Test.echo module does not have any return, because Master does not have permission to configure Test.echo, let's test the call runner

Salt-call Publish.runner Manage.up


Try running runner Manage.down again.

Salt-call Publish.runner Manage.down


No return is found because Master does not have the EXECUTE permission configured for runner Manage.down

This article from "Eight Miles" blog, declined reprint!

Saltstack Learning Note 12-Other components

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.