标签:arc emc stack saltstack linux yun denied lin cte
salt-stack简单安装部署环境:
centos7(master)192.168.179.135
centos6(minion)192.168.179.129
关闭selinux firewalld
配置salt-stack的yum源:
yum源可以从阿里云官网下载安装:
centos7:sudo yum install https://mirrors.aliyun.com/saltstack/yum/redhat/salt-repo-latest-2.el7.noarch.rpm
centos6:sudo yum install https://mirrors.aliyun.com/saltstack/yum/redhat/salt-repo-latest-2.el6.noarch.rpm
将.repo文件中的访问地址改为如下:
sudo sed -i "s/repo.saltstack.com/mirrors.aliyun.com\/saltstack/g" /etc/yum.repos.d/salt-latest.repo
需要注意安装salt-stack软件需要很多依赖包都来自于base源,否则会报错
centos7安装master:
yum install -y salt-master salt-ssh salt-syndic salt-cloud salt-api
systemctl start salt-master
systemctl enable salt-master
ss -nlt (4505/4506端口)
centos6安装minion:
yum install -y salt-minion salt-ssh salt-syndic salt-cloud salt-api
/etc/init.d/salt-minion start
chkconfig salt-minion on
/etc/init.d/salt-minion status (查看是否running)
需要配置主节点信息和自身ID:
vim /etc/salt/minion
master: 192.168.179.135(可以是解析域名)
id: jack-wang(可以是解析域名或其他名称)
配置完成需要重新启动:/etc/init.d/salt-minion restart
master端认证:
salt-key -L (列出所有minion节点)
salt-key -a(选择认证) -A(认证所有节点)
salt-key -d(选择删除) -D(删除所有节点)
[root@jack yum.repos.d]#salt-key -L
Accepted Keys:
jack-wang (认证成功会显示节点ID)
Denied Keys:
Unaccepted Keys:
Rejected Keys:
测试连通性
[root@jack yum.repos.d]#salt "jack-wang" test.ping
jack-wang:
True
测试执行命令:
[root@jack ~]#salt "jack-wang" cmd.run "cat /root/install.log"
更多的salt模块后续补充
标签:arc emc stack saltstack linux yun denied lin cte
原文地址:https://blog.51cto.com/13434656/2520730