本篇文档主要解决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的更多相关文章

  1. yum简单安装salt master与minion

    首先得先安装epel的yum源: rpm -ivh http://mirrors.skyshe.cn/epel/6/x86_64/epel-release-6-8.noarch.rpm 1.SaltS ...

  2. 03_已解决 [salt.master :2195][ERROR ][6219] Failed to allocate a jid. The requested returner 'mysql' could not be loaded.

    总结: 对于python2.7环境下的salt来说,要安装pip install mysql-python 对于python3环境下的salt来说,pip install mysqlclient的时候 ...

  3. Salt: Master server cannot see any Minion

    Issue: When you set up a Salt Master server and several Minions, you may find that none of minions c ...

  4. expect 安装 salt 客户端

    #!/bin/bash for i in $(cat ./host.txt) do echo $i > ./tmp.txt HOSTNAME=$(cut -d ':' -f1 ./tmp.txt ...

  5. The Salt Master has rejected this minion's public key!

    salt查看日志: salt --log-level=all "10.199.165.244" state.highstate 进入调试模式: salt-minion -l deb ...

  6. Salt Master报错:Minion did not return. [No response]

    在salt master端执行salt ‘*’ test.ping时,某一节点出现如下报错:Minion did not return. [No response] 登陆到这一节点查看minion的日 ...

  7. [ERROR ] The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate

    2.salt master已缓存此节点的公钥,此salt minion将等待10秒,然后再尝试重新验证. [ERROR ] The Salt Master has cached the public ...

  8. 安装hma master出错 Error: Package: perl-Mail-Sender-0.8.13-2.el5.1.noarch

    You are using the EPEL 5 version of the repo instead of 6, go into your /etc/yum.repos.d/epel.repo f ...

  9. The Salt Master has cached the public key报错解决办法

    参考:http://www.52devops.com/chuck/814.html 查看salt-minion的运行状态,显示salt-master已经缓存了这个minion,但是minion在重新认 ...

随机推荐

  1. Windows7 IE11 F12控制台DOC资源管理器报错的问题解决方法

    ------------------ Diagnostic: Exception in window.onload: Error: An error has ocurredJSPlugin.3005 ...

  2. gradle添加依赖

    gradle添加jar,moudle依赖 dependencies { compile fileTree(include: '*.jar', dir: 'libs') compile project( ...

  3. ssh项目java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoade错误

    错误: 导入别人的ssh项目后出现java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoade错误, 错 ...

  4. 利用JS生成01010101……长度可控的序列

    function ab(d){ var a = []; var x = 1 ; for (var i = 0; i < d; i++) { if (x == 0) { x = x + 1; } ...

  5. android 三步实现沉浸式 简单到无法想象

    今天产品来看进度,说ios状态栏可以改颜色,以前竟然也没注意过,看了美团 ,扣扣的实现, 才注意到.着手开始做.网上借鉴了点 ,各种乱,整理了下  .希望可以帮到大家 . [转载请标明出处] 前提:  ...

  6. outlook2013 更改邮件文件位置

    找了许多也是不行, 最后自己来多次试验,原来就是这么容易 ., 1: 先增加你的邮件账号,然后找到数据文件的位置 2: 关闭OUTLOOK 2013,把上一步中的数据文件复制到你要的位置,如D:\ou ...

  7. 《Git教程-廖雪峰》学习笔记

    一.创建版本库 ①初始化一个Git仓库:git init ②添加文件到Git仓库:1.git add<file> ;  2.git commit 二.时光机穿梭 ①查看工作区状态,文件是否 ...

  8. Windows Internal Database Service Pack 4 x64 Edition (KB2463332)安装失败

    系统是Windows Server 2008 R2,补丁Windows Internal Database Service Pack 4 x64 Edition (KB2463332)总是安装失败,W ...

  9. 使用NUGet自动下载(还原)项目中使用的包

    签出完整项目后,在解决方案名称上点右键,选择"启用NuGet程序包还原",如下图: 出现询问,当然要点是:是 当完成后,会发现在解决方案中,多出".nuget" ...

  10. xtrabackup备份rds记录

    在执行最后一步时 mysqld_safe --defaults-file=/home/mysql/data/backup-my.cnf --user=mysql --datadir=/home/mys ...