#步骤1:升级python
yum update python
#步骤2:下载yum源
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
#步骤3:分别安装salt-master和salt-minion
yum install salt-master
yum install salt-minion
#步骤4:修改配置文件
vi /etc/salt/master
interface: 本机IP
auto_accept:True
wq!
vi /etc/salt/minion
master: salt-master(IP或域名)
wq!
service salt-master restart
service salt-minion restart
salt-key -A minion(域名或IP)
#步骤5:测试
salt-key -L
salt ‘minion(IP或域名)‘ test.ping
#配置serverID和group
vi /etc/salt/minion
id:EB-T-1
vi /etc/salt/master
# group2
nodegroups:
EB-T-S: ‘[email protected]‘
salt -N EB-T-S test.ping #显示组服务器
salt -E ‘EB-T-1+‘ test.ping #显示多个序号服务器
salt -E ‘EB-T-1‘ cmd.run ‘ifconfig‘ #显示EB-T-1 服务器网卡地址
时间: 2024-09-28 21:18:20