MASTER
1
2
3
4
5
|
wget
rpm -ivh epel-release-latest-6.noarch.rpm
yum
install
python-jinja2 -y 安装依赖
yum
install
salt-master -y
tree
/etc/salt/
|
修改master配置文件
1
2
3
|
vim
/etc/salt/master
# The address of the interface to bind to:
interface: IP(master的IP地址)
|
启动master
1
2
3
|
service salt-master start
service salt-master status
netstat
-ntpl
|
MINION:
1
2
3
4
5
6
7
8
9
|
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
1
2
3
|
service salt-minion start
service salt-minion status
netstat
-ntpl
|
在master 添加minion的key 建立s端和c端的通信
1
2
|
salt-key -L
salt-key -a
id
(salt-key -A 全部添加)
|
简单操作
1
2
3
|
salt
'*'
test
.
ping
(*为匹配所有的minion)
salt
'*'
cmd.run
'df -h'
salt
'id.*'
disk.inodeusage (使用匹配方式执行模块,查看inode的使用情况)
|
本文转自wks9751CTO博客,原文链接:http://blog.51cto.com/wks97/1768691
,如需转载请自行联系原作者