自动化管理工具Saltstack之安装篇(2)

无法使用YUM安装Salt的时候,可以采用源码安装,这里以minion为例,master同

环境准备:

系统:SUSE10 SP4 64bit

python版本:升级到2.6+      #参见:SUSE10 SP4源码升级python到2.6.6

RPM包:pcre-devel        #不安装,编译swig报错

源码包准备(放在/usr/src/目录下):

Jinja2-2.8.tar.gz       
M2Crypto-0.22.3.tar.gz  
msgpack-pure-0.1.3.tar.gz    
pycrypto-2.6.tar.gz  
python-dateutil-1.5.tar.gz  
pyzmq-14.1.1.tar.gz   
setuptools-18.3.2.tar.gz  
yaml-0.1.6.tar.gz
libsodium-1.0.2.tar.gz  
MarkupSafe-0.23.tar.gz  
msgpack-python-0.4.6.tar.gz  
PyYAML-3.11.tar.gz          
salt-2015.5.5.tar.gz  
swig-2.0.11.tar.gz
zeromq-4.1.3.tar.gz

注意各源码包版本,可以githup下载

下面开始安装,均在/usr/src/目录下,注意安装顺序:

1.安装setuptools

tar zxf setuptools-18.3.2.tar.gz 
cd setuptools-18.3.2/
python setup.py build
python setup.py install
cd ..

2.安装python-dateutil

tar zxf python-dateutil-1.5.tar.gz 
cd python-dateutil-1.5/
python setup.py install
cd ..

3.安装PyYAML

tar zxf PyYAML-3.11.tar.gz 
cd PyYAML-3.11/
python setup.py install
cd ..

4.安装MarkupSafe

tar zxf MarkupSafe-0.23.tar.gz 
cd MarkupSafe-0.23/
python setup.py install
cd ..

5.安装Jinja2

tar zxf Jinja2-2.8.tar.gz 
cd Jinja2-2.8/
python setup.py install
cd ..

6.安装pycrypto

tar zxf pycrypto-2.6.tar.gz 
cd pycrypto-2.6/
python setup.py install
cd ..

7.安装libsodium

tar zxf libsodium-1.0.2.tar.gz 
cd libsodium-1.0.2/
./configure 
make
make install
cd ..

8.安装zeromq

tar zxf zeromq-4.1.3.tar.gz 
cd zeromq-4.1.3/
./configure 
make
make install
cd ..

9.安装pyzmq

tar zxf pyzmq-14.1.1.tar.gz 
cd pyzmq-14.1.1/
python setup.py install
cd ..

10.安装msgpack-python

tar zxf msgpack-python-0.4.6.tar.gz 
cd msgpack-python-0.4.6/
python setup.py install
cd ..

11.安装yaml

tar zxf yaml-0.1.6.tar.gz 
cd yaml-0.1.6/
./configure 
make
make install
cd ..

12.安装swig

tar zxf swig-2.0.11.tar.gz 
cd swig-2.0.11/
./configure 
make
make install
cd ..

13.安装M2Crypto

tar zxf M2Crypto-0.22.3.tar.gz 
cd M2Crypto-0.22.3/
python setup.py build build_ext
python setup.py install
cd ..

14.安装msgpack-pure

tar zxf msgpack-pure-0.1.3.tar.gz
cd msgpack-pure-0.1.3
python setup.py install
cd ..

15.安装salt

tar zxf salt-2015.5.5.tar.gz 
cd salt-2015.5.5/
python setup.py install
cd ..
mkdir -p /etc/salt/
cd salt-2015.5.5/conf/
cp minion /etc/salt/

16.验证:

salt-minion --versions-report
           Salt: 2015.5.5
         Python: 2.6.6 (r266:84292, Sep 30 2015, 22:21:43)
         Jinja2: 2.8
       M2Crypto: Not Installed
 msgpack-python: 0.4.6
   msgpack-pure: 0.1.3
       pycrypto: 2.6
        libnacl: Not Installed
         PyYAML: 3.11
          ioflo: Not Installed
          PyZMQ: 14.1.1
           RAET: Not Installed
            ZMQ: 4.1.3
           Mako: Not Installed
        Tornado: Not Installed
        timelib: Not Installed
       dateutil: 1.5
其他暂不需要安装

17.配置/etc/salt/minion

同yum安装配置,master亦同

18.启动服务,设置开机自起

salt-minion -d
echo "salt-minion -d " >> /etc/init.d/after.local

以上即完成minion端的源码

你可能感兴趣的:(python,saltstack)