saltstack(一) 源码安装
环境要求:python版本2.6以上,autoconf版本在2.63以上,不然安装libzmq的时候会报错
saltstack安装有三种方法:yum安装,pip安装,源码安装,由于公司环境是centos5.9,我选择源码安装,具体步骤如下:
1.install libzmq-master
1 $ git clone git://github.com/zeromq/libzmq.git
$ cd libzmq 2 $ ./autogen.sh 3 $ ./configure # add other options here 4 $ make 5 $ make check 6 $ make install 7 $ cd ..
2.install PyYAML-3.10
1 wget --no-check-certificate https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz#md5=74c94a383886519e9e7b3dd1ee540247 2 tar xzvf PyYAML-3.10.tar.gz 3 cd PyYAML-3.10 4 python setup.py install 5 cd ..
3.install MarkupSafe
1 wget --no-check-certificate https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.23.tar.gz 2 tar xzvf MarkupSafe-0.23.tar.gz 3 cd MarkupSafe-0.23 4 python setup.py install 5 cd ..
4.install Jinja
wget --no-check-certificate https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz tar zxvf Jinja2-2.7.3.tar.gz cd Jinja2-2.7.3 python setup.py install cd ..
5.install pyzmq
1 wget --no-check-certificate https://pypi.python.org/packages/source/p/pyzmq/pyzmq-14.3.1.tar.gz#md5=7196b4a6fbf98022f17ffa924be3d68d 2 tar xzvf pyzmq-14.3.1.tar.gz 3 cd pyzmq-14.3.1 4 python setup.py install 5 cd ..
6.install M2Crypto
1 $ wget --no-check-certificate https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz 2 $ tar xzvf M2Crypto-0.22.3.tar.gz 3 $ cd M2Crypto-0.22.3 4 $ python setup.py install 5 $ cd ..
7.install msgpack-python
1 $wget --no-check-certificate https://pypi.python.org/packages/source/m/msgpack-python/msgpack-python-0.4.2.tar.gz 2 $ tar xzvf msgpack-python-0.4.2.tar.gz 3 $ cd msgpack-python-0.4.2 4 $ python setup.py install 5 $ cd ..
8.install pycrypto-2.6
1 $ wget --no-check-certificate https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.1.tar.gz#md5=55a61a054aa66812daf5161a0d5d7eda 2 $ tar xzvf pycrypto-2.6.1.tar.gz 3 $ cd pycrypto-2.6.1 4 $ python setup.py install 5 $ cd ..
9.install salt(version 2014.1.7)
1 $ wget --no-check-certificate https://pypi.python.org/pypi/salt 2 $ cd salt 3 $ python setup.py install 4 $ cd ..
10.源码后,还需要手动拷贝文件模板到/etc/salt/内
//需要修改
1 cp salt-0.17.0/conf/master /etc/salt/ 2 cp salt-0.17.0/conf/minion /etc/salt/
salt的master与minion安装方式相同,启动不同的服务即可。正确安装完毕后可以看到一批salt命令
[root@DFS-1 ~]# salt
salt salt-call salt-cp salt-key salt-master salt-minion salt-run salt-ssh salt-syndic
启动master:会启动4505、4506端口
[root@DFS-1 ~]# salt-master -d
启动minion:不启动任何端口
[root@DFS-1 ~]# salt-minion -d
一键安装脚本: curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com