minion端配置直接入库和master端事件监听入库,两种入库方式,配置参考

第三种方式master端直接配置文件参数入库,这个比较简单 master端配置入库

简单说下第三种方法: 1.安装数据库和表并授权 CREATE DATABASE salt DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; USE salt;

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;

DROP TABLE IF EXISTS `salt_returns`;
CREATE TABLE `salt_returns` (
  `fun` varchar(50) NOT NULL,
  `jid` varchar(255) NOT NULL,
  `return` mediumtext NOT NULL,
  `id` varchar(255) NOT NULL,
  `success` varchar(10) NOT NULL,
  `full_ret` mediumtext NOT NULL,
  KEY `id` (`id`),
  KEY `jid` (`jid`),
  KEY `fun` (`fun`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
	
	GRANT ALL PRIVILEGES ON salt.* to ‘salt’@'%’ identified by ‘salt’;

2.master安装MySQL-python 3.配置master文件(不同) mysql.host: '127.0.0.1' mysql.user: 'salt' mysql.pass: 'salt' mysql.db: 'salt' mysql.port: 3306 master_job_cache: mysql
重启之后运行命令可以看到入库了