码迷,mamicode.com
首页 > 其他好文 > 详细

centos5安装salt-master

时间:2014-10-29 18:33:13      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   os   ar   for   sp   div   on   

本篇文档主要解决2个问题:

1. centos5通过yum安装的master版本肯定低于centos6安装的minion,所以必须升级salt-master

2. zeromq版本太低会报这个错

2014-10-29 14:36:04,597 [salt.master      ][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!

通过pip安装salt-master之前需要先安装zeromq,因为yum安装的版本太低,启动salt-master会出现上面那个警告,然后master就退出了

源码编译安装zeromq

wget http://download.zeromq.org/zeromq-3.2.5.tar.gz

 解压后,通用的编译安装步骤就可以了

cd zeromq-3.2.5
.configure && make && make install

 然后pip安装pyzmq

/usr/local/python/bin/pip install pyzmq --install-option="--zmq=/usr/lib"

 安装salt

/usr/local/python/bin/pip install salt

 这样salt是安装在python的bin目录中

/usr/local/python/bin/
|-- 2to3
|-- django-admin
|-- django-admin.py
|-- django-admin.pyc
|-- easy_install
|-- easy_install-2.7
|-- idle
|-- pip
|-- pip2
|-- pip2.7
|-- pydoc
|-- python -> python2
|-- python-config -> python2-config
|-- python2 -> python2.7
|-- python2-config -> python2.7-config
|-- python2.7
|-- python2.7-config
|-- salt
|-- salt-call
|-- salt-cloud
|-- salt-cp
|-- salt-key
|-- salt-master
|-- salt-minion
|-- salt-run
|-- salt-ssh
|-- salt-syndic
`-- smtpd.py

 这样通过python的pip安装的salt是没有启动脚本的,这里附上启动脚本(yum安装的salt-master启动脚本在/etc/init.d/salt-master)

#!/bin/bash
#
# salt master startup system-v script

DEBIAN_VERSION=/etc/debian_version
SUSE_RELEASE=/etc/SuSE-release
# Source function library.
if [ -f $DEBIAN_VERSION ]; then
   break   
elif [ -f $SUSE_RELEASE -a -r /etc/rc.status ]; then
    . /etc/rc.status
else
    . /etc/rc.d/init.d/functions
fi

SALTMASTER=/usr/local/python/bin/salt-master
python=/usr/local/python/bin/python
SERVICE=salt-master
PROCESS=salt-master

start() {
    echo -n ‘starting salt-master daemon:‘
    daemon --check $SERVICE $SALTMASTER -d
    RETVAL=$?
    echo
    return $RETVAL
}

stop() {
    echo -n ‘stoping salt-master daemon:‘
    killproc $PROCESS
    RETVAL=$?
    echo
}

restart() {
    stop
    start
}

case "$1" in
    start|stop|restart)
        $1
        ;;
    status)
        if [ -f $SUSE_RELEASE ]; then
            echo -n "Checking for service salt-master "
            checkproc $SALTMASTER
            rc_status -v
        elif [ -f $DEBIAN_VERSION ]; then
            if [ -f $LOCKFILE ]; then
                RETVAL=0
                echo "salt-master is running."
            else
                RETVAL=1
                echo "salt-master is stopped."
            fi
        else
            status $PROCESS
            RETVAL=$?
        fi
        ;;
    condrestart)
        [ -f $LOCKFILE ] && restart || :
        ;;
    reload)
        echo "can‘t reload configuration, you have to restart it"
        RETVAL=$?
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
        exit 1
        ;;
esac
exit $RETVAL

 

centos5安装salt-master

标签:blog   http   io   os   ar   for   sp   div   on   

原文地址:http://www.cnblogs.com/txwsqk/p/4059792.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!