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-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)
原文地址:http://blog.51cto.com/vekergu/2287807
时间: 2024-11-08 08:03:05