STORING JOB RESULTS IN AN EXTERNAL SYSTEM

After a job executes, job results are returned to the Salt Master by each Salt Minion. These results are stored in the Default Job Cache.

作业执行后,作业结果由每个salt minion返回给salt master。这些结果存储在默认作业缓存中。

In addition to the Default Job Cache, Salt provides two additional mechanisms to send job results to other systems (databases, local syslog, and others):

除了缺省的作业缓存之外,Salt还提供了两种附加的机制来将作业结果发送给其他系统(数据库、本地系统日志等):

  • External Job Cache 外部job缓存
  • Master Job Cache  Maste job缓存

The major difference between these two mechanism is from where results are returned (from the Salt Master or Salt Minion). Configuring either of these options will also make the Jobs Runner functions to automatically query the remote stores for information.

这两种机制之间的主要区别是从结果返回(从salt master或salt minion)。配置这些选项中的任何一个也将使Jobs Runner functions能自动查询远程存储的信息。

external job cache - minion-side returner

When an External Job Cache is configured, data is returned to the Default Job Cache on the Salt Master like usual, and then results are also sent to an External Job Cache using a Salt returner module running on the Salt Minion.

当配置外部作业缓存时,数据像往常一样返回到salt master上的缺省作业缓存,然后使用在salt minion上运行的salt返回器模块将结果发送到外部作业缓存。

  • Advantages: Data is stored without placing additional load on the Salt Master. 优点:数据存储,而不增加 Salt Master上的额外负载。
  • Disadvantages: Each Salt Minion connects to the external job cache, which can result in a large number of connections. Also requires additional configuration to get returner module settings on all Salt Minions. 缺点:每个salt minion连接到外部作业缓存,这可能导致大量的连接。还需要额外的配置,以获得返回模块设置在所有salt minions。

master job cache - master-side returner

New in version 2014.7.0.

Instead of configuring an External Job Cache on each Salt Minion, you can configure the Master Job Cache to send job results from the Salt Master instead. In this configuration, Salt Minions send data to the Default Job Cache as usual, and then the Salt Master sends the data to the external system using a Salt returner module running on the Salt Master.

代替配置每个salt minion上的外部作业缓存,可以配置Master job cache以salt master发送作业结果。在这种配置中,salt  minion像往常一样将数据发送到默认作业缓存,然后salt master使用运行在salt master上的salt返回器模块将数据发送到外部系统。

  • Advantages: A single connection is required to the external system. This is preferred for databases and similar systems.优点:外部系统需要一个连接。这对于数据库和类似系统是优选的。
  • Disadvantages: Places additional load on your Salt Master. 缺点:给你的salt master 增加额外的负担。

configure an external or master job cache

step 1: understand salt returners 了解salt returners

Before you configure a job cache, it is essential to understand Salt returner modules ("returners"). Returners are pluggable Salt Modules that take the data returned by jobs, and then perform any necessary steps to send the data to an external system. For example, a returner might establish a connection, authenticate, and then format and transfer data.

在配置job cache之前,了解Salt returner 模块("returners")是绝对有必要的。Returners 是可插拔的Salt模块,它接收作业返回的数据,然后执行任何必要的步骤将数据发送到外部系统。例如,返回者可以建立连接、认证、然后格式化和传输数据。

The Salt Returner system provides the core functionality used by the External and Master Job Cache systems, and the same returners are used by both systems.

Salt Returnner系统提供ExternalMaster Job Cache系统所使用的核心功能,并且两个系统都使用相同的returnners。

Salt currently provides many different returners that let you connect to a wide variety of systems. A complete list is available at all Salt returners. Each returner is configured differently, so make sure you read and follow the instructions linked from that page.

Salt目前提供了许多不同的returners, 让你连接到各种各样的系统。所有Salt returners都有一份完整的清单。每个return的配置不同,所以请务必阅读并遵循从该页面链接的指令。

For example, the MySQL returner requires: 比如,MySQL returnner的规定:

  • A database created using provided schema (structure is available at MySQL returner)
  • A user created with privileges to the database
  • Optional SSL configuration

A simpler returner, such as Slack or HipChat, requires:

  • An API key/version
  • The target channel/room
  • The username that should be used to send the message

step 2: configure the returner

After you understand the configuration and have the external system ready, the configuration requirements must be declared.

在了解配置并使外部系统准备好之后,必须声明配置要求。

EXTERNAL JOB CACHE

The returner configuration settings can be declared in the Salt Minion configuration file, the Minion's pillar data, or the Minion's grains.

returner声明设置可以在salt minion配置文件配置,Minion的pillar数据或Minion的grains声明。

If external_job_cache configuration settings are specified in more than one place, the options are retrieved in the following order. The first configuration location that is found is the one that will be used.

如果在多个地方指定外部 external_job_cache,则按以下顺序检索选项。找到的第一个配置位置是将被使用的位置。

  • Minion configuration file
  • Minion's grains
  • Minion's pillar data

MASTER JOB CACHE

The returner configuration settings for the Master Job Cache should be declared in the Salt Master's configuration file.

Master Job Cache 的返回器配置设置应在Salt Master'的配置文件中声明。

CONFIGURATION FILE EXAMPLES

MySQL requires:

mysql.host: 'salt'
mysql.user: 'salt'
mysql.pass: 'salt'
mysql.db: 'salt'
mysql.port: 3306

Slack requires:

slack.channel: 'channel'
slack.api_key: 'key'
slack.from_name: 'name'

After you have configured the returner and added settings to the configuration file, you can enable the External or Master Job Cache.

在配置returnner并将配置添加到配置文件之后,可以启用 External or Master Job Cache。

step 3: enable the external or master job cache

Configuration is a single line that specifies an already-configured returner to use to send all job data to an external system.

配置是一个单行,指定已配置的returner用于将所有作业数据发送到外部系统。

EXTERNAL JOB CACHE

To enable a returner as the External Job Cache (Minion-side), add the following line to the Salt Master configuration file:

若要使returner作为 External Job Cache (Minion-side),请将以下行添加到Salt Master 配置文件中:

ext_job_cache: <returner>

For example: 例如:

ext_job_cache: mysql

注意:
When configuring an External Job Cache (Minion-side), the returner settings are added to the Minion configuration file, but the External Job Cache setting is configured in the Master configuration file.
当配置 External Job Cache (Minion-side)时,将returner设置添加到 Minion配置文件中,但 External Job Cache设置在Master配置文件中配置。

master job cache

To enable a returner as a Master Job Cache (Master-side), add the following line to the Salt Master configuration file:

若要使returner 作为Master Job Cache (Master-side), 请将以下行添加到Salt Master 配置文件中:

master_job_cache: <returner>

For example:  例如:

master_job_cache: mysql

Verify that the returner configuration settings are in the Master configuration file, and be sure to restart the salt-master service after you make configuration changes. (service salt-master restart).

验证returner配置设置在Master配置文件中,并确保在配置更改之后重新启动 salt-master 服务。(service salt-master restart)。

转载于:https://www.cnblogs.com/zuoyang/p/9254379.html

【SaltStack官方版】—— STORING JOB RESULTS IN AN EXTERNAL SYSTEM相关推荐

  1. 【SaltStack官方版】—— returners——返回器

    ETURNERS 返回器 By default the return values of the commands sent to the Salt minions are returned to t ...

  2. 【SaltStack官方版】—— EventsReactor系统—BEACONS

    Events&Reactor系统-BEACONS Beacons let you use the Salt event system to monitor non-Salt processes ...

  3. python3.6安装包-Python3.6.6官方版

    Python3.6.6官方版是一种功能强大,轻量便捷的计算机程序设计语言,它也是一种功能强大而完善的通用型语言,成熟且稳定.Python3.6.6官方版具有非常简捷而清晰的语法特点,适合完成各种高层任 ...

  4. 谷歌官方版android,谷歌Android 11正式官方版

    谷歌Android 11正式官方版终于和广大用户朋友们见面了,今天,谷歌正式发布了最新版本的移动操作系统Android 11,此次更新为大家新增了很多的功能,分别分为三个主题,人. 控件和隐私.And ...

  5. 下载oracle修复补丁下载,Oracle数据库修复工具下载_FROMBYTE Reconstructor for Oracle官方版下载[修复软件]-下载之家...

          FROMBYTE Reconstructor for Oracle(Oracle数据库修复工具)官方版是一款专为Oracle的数据库进行修复软件,可以通过Oracle数据库修复工具软件创建 ...

  6. linux拓实n87驱动下载,拓实n87网卡驱动for xp/win7官方版

    拓实n87网卡驱动for xp/win7官方版是一个十分强大的网卡驱动管理软件,拓实n87网卡驱动for xp/win7官方版是ts N87高增益全向无线USB网卡驱动程序,拓实n87全面支持移动cm ...

  7. [转]Sandcastle初探——官方版的NDoc

    Sandcastle初探--官方版的NDoc Sandcastle(CodeName)是微软出的用于编译发布组件(Assembly)信息的一个工具,基本上等同于NDoc(后者目前已经停止开发,最新版本 ...

  8. 程序安装包制作工具 v1.0官方版

    2019独角兽企业重金招聘Python工程师标准>>> 名称:程序安装包制作工具 v1.0官方版 版本:1.0更新日期:2016-06-27 大小:2.9MB软件语言:简体中文 软件 ...

  9. cleanmymac3.9.6下载_单耳兔o2oapp下载-单耳兔o2o商城官方版下载v10.6 安卓版

    单耳兔o2o商城官方版是一款非常强大的线上o2o平台.成熟的互联网电商.完全免费开店.帮助用户进行更好的平台推广.产多商品可供自由选择.支持各种支付方式.一键分享开店.让更多的人推广销售,创造双赢.利 ...

最新文章

  1. 首个测试博客搜索引擎等你来体验!
  2. 对linux文件权限的理解,理解linux文件权限2
  3. 读《图解HTTP》总结--第九章
  4. 解决WCF接口无法传递object参数的问题
  5. 错误记录:发送广播是报空指针
  6. 原生JS实现一个无缝轮播图插件(支持vue)
  7. python2048游戏实训报告_Python 实现 2048 游戏
  8. 如何在JMP中快速实现报表的个性化与可视化?
  9. 换把人体工学椅,缓解久坐写代码的老腰吧~
  10. MATLAB从入门到精通:MATLAB调色板,作图更酷炫
  11. Arthas线上代码诊断神器-定位问题
  12. Data too long for column ‘xxx‘ at row 1 ——数据库字段长度太短
  13. c++ min/max
  14. 统一协同工作平台用户管理、单点登录以及任务集成接口说明
  15. 对象及日期定时器、延时器
  16. 计算机通过镜子测试,人工智能通过镜子测试或许只是一个悖论
  17. MyBatis动态sql之choose(when、otherwise)用法
  18. iOS开发 检测网络是否真正可用(真正可以访问互联网)
  19. 【NLP】文本关键词提取的两种方法-TFIDF和TextRank
  20. Java实现“三天打鱼两天晒网”

热门文章

  1. Jquery判断元素是否隐藏:display属性状态值
  2. Docker selenium自动化 - windows版docker的安装与运行环境检测
  3. C# 学习笔记(18)操作SQL Server 中
  4. C#的控件输入法变换
  5. Sculpture ACM/ICPC NWERC 2008 离散化
  6. getAffineTransform函数
  7. pytorch tensor查找0_在PyTorch中Tensor的查找和筛选例子
  8. 方差分析的MATLAB实现(单因子)
  9. Spring学习笔记15--注解Bean
  10. 北京君正集成电路的Newton平台--穿戴式