MASTER
wget rpm -ivh epel-release-latest-6.noarch.rpm yum install python-jinja2 -y 安装依赖 yum install salt-master -y tree /etc/salt/
修改master配置文件
vim /etc/salt/master # The address of the interface to bind to: interface: IP(master的IP地址)
启动master
service salt-master start service salt-master status netstat -ntpl
MINION:
wget rpm -ivh epel-release-latest-6.noarch.rpm yum install python-jinja2 -y 安装依赖 yum install salt-minion -y vim /etc/salt/minion # resolved, then the minion will fail to start. master: IP(master的IP) # clusters. id: (minion的名字id,方便日后管理,最好多个层次方便通配符匹配)
启动minion
service salt-minion start service salt-minion status netstat -ntpl
在master 添加minion的key 建立s端和c端的通信
salt-key -L salt-key -a id (salt-key -A 全部添加)
简单操作
salt '*' test.ping (*为匹配所有的minion) salt '*' cmd.run 'df -h' salt 'id.*' disk.inodeusage (使用匹配方式执行模块,查看inode的使用情况)