第一篇:saltstack安装与配置

saltstack 安装

saltstack yum 源配置

saltstack官方源国内访问比较慢,建议使用阿里云源

#centos 6
yum install https://mirrors.aliyun.com/saltstack/yum/redhat/salt-repo-latest-2.el6.noarch.rpm
#centos 7
yum install https://mirrors.aliyun.com/saltstack/yum/redhat/salt-repo-latest-2.el.noarch.rpm

saltstack maser & minion 安装

#本文的安装版本 2018.3.2-1.el6
yum install salt-api.noarch salt-master.noarch
yum install  salt-minion.noarch

salt master & minion 简单配置

salt详细配置请参考官方指南

salt-master

vi /etc/salt/master
#日志模式
log_level: info
default_include: master.d/*.conf
#是否自动接收salt客户端秘钥
auto_accept: True
file_roots:
base:
- /srv/salt/base
sit:
- /srv/salt/sit

salt-minion

vi /etc/salt/minion
#'garbage', 'trace', 'debug', info', 'warning', 'error', 'critical'
log_level: info
master: salt-master-ip
multiprocessing: True
id: salt-minion-ip

建议minion的id采用主机ip形式

salt master & minion 启动

centos 6


checkconfig salt-master on
checkconfig salt-minion on

service salt-master start
service salt-minion start

> centos 7

systemctl enable salt-master.service
systemctl enable salt-minion.service

systemctl start salt-master
systemctl start salt-minion

### 验证

#salt master host
salt minion-id test.ping



> 使用salt开始,看的最多的就是官方文档

> [saltstack官方文档](https://docs.saltstack.com/en/latest/contents.html)