SaltStack之安装

环境:

安装环境:centos6.5 x64
master:192.168.0.23
minion:192.168.0.24

安装epel源

/etc/init.d/iptables stop
sed -i '/SELINUX/s/enforcing/disabled/g' /etc/selinux/config 

wget http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm 
rpm -ivh epel-release-6-8.noarch.rpm

master安装:
yum -y install salt-master salt-minion
chkconfig salt-master on
minion安装
yum -y install salt-minion
chkconfig salt-minion on

配置salt-master

user: root
worker_threads: 5
publish_port: 4505
worker_threads: 5
pidfile: /var/run/salt-master.pid
users:
- root
file_roots:
base:
- /srv/salt/
dev:
- /srv/salt/dev/
log_file: /var/log/salt/master

配置salt-master

user: root
master : 192.168.0.23
id: node24.com
master_port: 4506
log_file: /var/logs/salt_minion.log

启动salt

master
service salt-master restart

minion
service salt-minion restart

注意: saltstack 是使用python2的语言编写,对python3的兼容性不好,请使用python2的环境

salt认证

master上查看认证

# salt-key 
Accepted Keys:
Denied Keys:
Unaccepted Keys:
node24.com
Rejected Keys:

salt-key -y -a node24.com #添加单个key

# salt-key 
Accepted Keys:
node24.com
Denied Keys:
Unaccepted Keys:
Rejected Keys:

测试salt

salt '*' test.ping 
node24.com:
True
node23.com:
True

由此安装完成

posted @ 2016-05-31 21:51  西红柿圆  阅读(201)  评论(0编辑  收藏  举报