需求:经常对线上服务器做一些修改配置文件,搭建等操作,很麻烦

系统环境是RHEL5 

安装过程和很多网友一样,先安装epel

rpm -Uvh http://mirror.pnl.gov/epel/5/x86_64/epel-release-5-4.noarch.rpm 
yum update
yum install salt-minion
yum install salt-master

安装过程巨简单,装好后,因为saltstack 是用zeromq来进行通信的,minion运行的时候log报错,[WARNING ] You have a version of ZMQ less than ZMQ 3.2! There are known connection keep-alive issues with ZMQ < 3.2 which may result in loss of contact with minions. Please upgrade your ZMQ!

解决办法:

    http://copr-be.cloud.fedoraproject.org/results/saltstack/zeromq4/epel-5-x86_64/zeromq-4.0.4-2.el5/zeromq-4.0.4-2.el5.x86_64.rpm

   http://copr-be.cloud.fedoraproject.org/results/saltstack/zeromq4/epel-5-x86_64/python-zmq-14.3.1-3.el5/python26-zmq-14.3.1-3.el5.x86_64.rpm

rpm -Uvh python26-zmq-14.3.1-3.el5.x86_64.rpm zeromq-4.0.4-2.el5.x86_64.rpm

由于安装的版本是7.1,有个bug ,log日志如下

Starting salt-master daemon: Traceback (most recent call last):
 File "/usr/bin/salt-master", line 10, in <module>
   salt_master()
 File "/usr/lib/python2.6/site-packages/salt/scripts.py", line 20, in salt_master
   master.start()
 File "/usr/lib/python2.6/site-packages/salt/__init__.py", line 114, in start
   if check_user(self.config['user']):
 File "/usr/lib/python2.6/site-packages/salt/utils/verify.py", line 296, in check_user
   if user in e.gr_mem] + [pwuser.gid])
AttributeError: 'pwd.struct_passwd' object has no attribute 'gid'

解决办法:重新编译saltstack

wget https://github.com/saltstack/salt/archive/develop.zip
unzip develop
cd salt-develop/
python2.6 setup.py install

重启服务后,master和minion 正常通信