标签:saltstack
添加epel源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
安装server端:
yum -y install salt-master
安装minion端:
yum -y install salt-minion
注意如报错:Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
修改文件“/etc/yum.repos.d/epel.repo”, 将baseurl的注释取消, mirrorlist注释掉。即可。
修改配置文件
编辑客户端minion配置文件,vim /etc/salt/minion
master:192.168.88.9 #服务端地址 id:minion.saltstack.com #服务端显示的客户端名称
启动服务
Master端
配置master开机自动启动:
chkconfig salt-master on
启动Master:
service salt-master start
Minion端
service salt-minion start
注意:监听4505,4506
安装完后可以查看链接的主机
[root@master ~]#salt-key Accepted Keys: Unaccepted Keys: data1-test data2-test Rejected Keys:
对主机进行授权
授权链接单个机器
salt-key -a data1-test
授权链接所有机器
[root@master ~]#salt-key -A The following keys are going to be accepted: Unaccepted Keys: data1-test data2-test Proceed? [n/Y] Y Key for minion data1-test accepted. Key for minion data2-test accepted.
测试ping
对单台主机
[root@master ~]#salt ‘data1-test‘ test.ping data1-test: True
对所有主机
[root@master ~]#salt ‘*‘ test.ping data1-test: True data2-test: True
标签:saltstack
原文地址:http://mumuyilisha.blog.51cto.com/4135571/1754617