当前位置: > CentOS > CentOS教程 >

CentOS 6.5 部署SaltStack

时间:2016-09-03 23:03来源:linux.it.net.cn 作者:IT

(1)、python 2.7安装
https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
# tar xvzf Python-2.7.8.tgz
# cd Python-2.7.8
# ./configure --prefix=/usr/local

# make --jobs=`grep processor /proc/cpuinfo | wc -l`
# make install


## 将python头文件拷贝到标准目录,以避免编译saltstack时,找不到所需的头文件
# cd /usr/local/include/python2.7
# cp -a ./* /usr/local/include/


## 备份旧版本的python,并符号链接新版本的python
# cd /usr/bin
# mv python python2.6
# ln -s /usr/local/bin/python


## 修改yum脚本,使其指向旧版本的python,已避免其无法运行
# vim /usr/bin/yum
#!/usr/bin/python  -->  #!/usr/bin/python2.6

(2)、PyYAML模块安装
http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz
https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz
# tar xvzf yaml-0.1.5.tar.gz# cd yaml-0.1.5
# ./configure --prefix=/usr/local
# make --jobs=`grep processor /proc/cpuinfo | wc -l`
# make install

# tar xvzf PyYAML-3.11.tar.gz
# cd PyYAML-3.11
# python setup.py install


(3)、setuptools模块安装
https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.tar.gz
# tar xvzf setuptools-7.0.tar.gz
# cd setuptools-7.0
# python setup.py install


(4)、markupsafe模块安装
https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.9.3.tar.gz
# tar xvzf MarkupSafe-0.9.3.tar.gz
# cd MarkupSafe-0.9.3
# python setup.py install

(5)、jinja2模块安装
https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz
# tar xvzf Jinja2-2.7.3.tar.gz
# cd Jinja2-2.7.3
# python setup.py install


(6)、autocon模块安装
http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz

注意:
系统自带的autoconf版本为2.63,在编译ZeroMQ时,由于版本较低,会报错不通过,故需安装大于2.63的版本。
# tar xvzf autoconf-2.69.tar.gz
# cd autoconf-2.69
# ./configure
# make
# make install

如果原来已经装过,还需要覆盖原来的。
cp   /usr/local/bin/autoconf /usr/bin/
        cp  /usr/local/bin/autoreconf /usr/bin/

## 其他依赖库安装
# yum -y install libuuid.x86_64 libuuid-devel.x86_64
# yum -y install uuid.x86_64 uuid-devel.x86_64
# yum -y install uuid-c++.x86_64 uuid-c++-devel.x86_64


https://github.com/jedisct1/libsodium/archive/1.0.1.tar.gz
# tar xvzf libsodium-1.0.1.tar.gz
# cd libsodium-1.0.1
# ./autogen.sh
# ./configure --prefix=/usr/local
# make --jobs=`grep processor /proc/cpuinfo | wc -l`
# make install

./autogen.sh 报错:
Can't exec "aclocal": 没有那个文件或目录 at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: 没有那个文件或目录
解决方法:

     1
yum install automake
报错:
configure.ac:418: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
解决方法:

yum install libtool


http://download.zeromq.org/zeromq-4.0.5.tar.gz
https://pypi.python.org/packages/source/p/pyzmq/pyzmq-14.4.1.tar.gz
# tar xvzf zeromq-4.0.5.tar.gz
# cd zeromq-4.0.5
# ./autogen.sh
# ./configure --prefix=/usr/local
# make --jobs=`grep processor /proc/cpuinfo | wc -l`
# make install


# tar xvzf pyzmq-14.4.1.tar.gz
# cd pyzmq-14.4.1
# python setup.py configure --zmq=/usr/local
# python setup.py install


(7)、M2Crypto模块安装
# yum -y install swig.x86_64

http://www.openssl.org/source/openssl-1.0.1g.tar.gz
# tar xvzf openssl-1.0.1g.tar.gz
# cd openssl-1.0.1g
# ./config shared --prefix=/usr/local
# make && make install
cp -a /usr/local/include/openssl /usr/include/
vim Python-2.7.8/Modules/Setup
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.c

# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
#SSL=/usr/local/ssl
_ssl _ssl.c \
        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
        -L$(SSL)/lib -lssl -lcrypto
取消那四行的注释

# vim/etc/ld.so.conf
/usr/local/lib
/usr/local/lib64

# /sbin/ldconfig

# cd Python-2.7.8
# make && make install

https://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.22.3.tar.gz
# tar xvzf M2Crypto-0.22.3.tar.gz
# cd M2Crypto-0.22.3
# python setup.py install

saltstack安装
https://github.com/saltstack/salt/releases/download/v2014.7.0/salt-2014.7.0.tar.gz
# tar xvzf salt-2014.7.0.tar.gz
# cd salt-2014.7.0
# python setup.py install
# salt --versions-report


(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容