SALT-API return MySQL Returns the use of logging operations log

Source: Internet
Author: User
Tags create index

Say in front
    • Toss this for a while, now do the next record
Installation dependency (operation only on Master side)
yum install mysql-python or pip install mysql-python
Create the corresponding table structure in the master side local database
CREATE DATABASE ' salt ' default CHARACTER SET UTF8 default COLLATE utf8_general_ci;  Use ' salt '; ----table structure for table ' Jids '--DROP table IF EXISTS ' jids '; CREATE TABLE ' jids ' (' jid ' varchar (255) NOT NULL, ' load ' mediumtext not NULL, UNIQUE KEY ' Jid ' (' Jid ')) Engine=innodb DEFAULT Charset=utf8;  CREATE INDEX Jid on Jids (Jid) USING BTREE; ----table structure for table ' Salt_returns '--DROP table IF EXISTS ' salt_returns '; CREATE TABLE ' salt_returns ' (' fun ' varchar (#) NOT null, ' jid ' varchar (255) is not NULL, ' return ' mediumtext not NULL, ' ID ' varchar (255) NOT NULL, ' success ' varchar (TEN) NOT null, ' Full_ret ' mediumtext not null, ' Alter_time ' TIMESTAMP Defau    LT Current_timestamp, key ' id ' (' id '), key ' Jid ' (' Jid '), key ' fun ' (' fun ')) Engine=innodb DEFAULT Charset=utf8; ----Table structure for table ' salt_events '--DROP table IF EXISTS ' salt_events '; CREATE TABLE ' salt_events ' (' id ' BIGINT NOT NULL auto_increment, ' tag ' varchar (255) NOT NULL, ' data ' mediumtExt not NULL, ' alter_time ' TIMESTAMP the DEFAULT current_timestamp, ' master_id ' varchar (255) Not null,primary KEY (' id '), K EY ' tag ' (' tag ')) Engine=innodb DEFAULT Charset=utf8;
Update the master configuration file for the salt
[[email protected]_75_82_centos private]# egrep -v ‘^$|^#‘ /etc/salt/masterdefault_include: master.d/*.confauto_accept: Trueinterface: 0.0.0.0mysql.host: ‘10.105.75.81‘    mysql.user: ‘root‘mysql.pass: ‘123456#‘mysql.db: ‘salt‘mysql.port: 3306file_roots:   base:     - /srv/salt/pillar_roots:  base:    - /srv/pillarreturn: mysqlmaster_job_cache: mysql     #使用此选项后,就不需要minion端配置
Test returns
[[email protected]_75_82_centos private]# salt ‘*‘ cmd.run ‘ls‘ node82:    anaconda-ks.cfg[[email protected]_75_82_centos private]# salt ‘*‘ cmd.run ‘uptime‘ node82:     20:15:20 up 1 day,  8:06,  2 users,  load average: 0.07, 0.13, 0.13
See the database already has data

SALT-API return MySQL Returns the use of logging operations log

Related Article

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.