-
salt-master安装[salt-master]# yum install salt-master或者 curl -L http://bootstrap.saltstack.org | sudo sh -s -- -M -Nmaster端的配置文件是在 /etc/salt/master运行:[salt-master]# salt-master -dsalt-minion安装[salt-minion]# yum install salt-minion也可以参考官网的安装wget -O - http://bootstrap.saltstack.org | sudo shyum 找不到资源时:1、安装epel源
# cd /usr/local/src/
# wget http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release--.noarch.rpm2、安装rpmforge
# wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
# rpm -Uvh rpmforge-release-0.5.-.el6.rf.x86_64.rpm3、安装salt# yum -y install salt-master --enablerepo=epel-testing
minion端的配置文件是在 /etc/salt/minion这里一定要配置的 master 端的IP,在 /etc/salt/minion 里master:master_ip运行:[salt-minion]# salt-minion -d这时候两边都已经运行了,下面是master端证书的查看和授权。[salt-master]# salt-key -LAccepted Keys:Unaccepted Keys:host.mimion.testRejected Keys:[salt-master]# salt-key -A Key for minion host.mimion.test accepted.这时候证书已经授权好了,可以对客户端执行系统命令了。下面的“*”代表对所有的minion,也可以针对某个主机。[salt-master]# salt ‘*’ test.ping{‘host.mimion.test‘: True}[salt-master]# salt ‘*’ cmd.run “service nginx stop”{‘host.mimion.test‘: ‘Stopping nginx daemon: nginx.’}