首先安装 Python 2.7.10
yum -y install perl-ExtUtils-Embed.x86_64 libxml2 libxml2-devel libxslt libxslt-devel libffi libffi-devel build-essential autoconf libtool gcc git libaio libaio-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libicu libicu-devel openldap openldap-devel libmcrypt libmcrypt-devel openssl openssl-devel ncurses.x86_64 ncurses-devel.x86_64 sqlite-devel bzip2-devel libdbi-devel wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz tar xf Python-2.7.10.tgz cd Python-2.7.10 ./configure --prefix=/usr/local/python2.7 make make install vim /root/.bash_profile ---------------------------------------------- PATH=$PATH:$HOME/bin:/usr/local/python2.7/bin/ # 修改 PATH 变量,将 Python 可执行目录加入环境变量 ---------------------------------------------- source .bash_profile wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg sh setuptools-0.6c11-py2.7.egg wget https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz#md5=01026f87978932060cc86c1dc527903e tar xf pip-1.5.6.tar.gz cd pip-1.5.6 /usr/local/python2.7/bin/python2.7 setup.py install pip install pip --upgrade pip install setuptools --upgrade
如果使用的是国内主机,使用 pip 安装模块的话会比较慢,可以使用国内 pip 源来安装,这里使用的是中科大 pip 源
mkdir /root/.pip # 如果目录不存在,则建立此目录 vim /root/.pip/pip.conf [global] index-url = https://pypi.mirrors.ustc.edu.cn/simple # 源地址,末尾需要加上 /simple [install] trusted-host=pypi.mirrors.ustc.edu.cn # 如果使用 https 方式,需要此参数
安装 SaltStack 依赖系统软件包
yum -y install libyaml m2crypto openpgm pciutils yum-utils zeromq3
安装 SaltStack 依赖 Python 模块
pip install babel pip install chardet pip install crypto pip install jinja2 pip install ordereddict pip install requests pip install six pip install urllib3 pip install zmq pip install backports.ssl_match_hostname pip install M2Crypto pip install pycrypto
安装 SaltStack
pip install salt
至此 SaltStack 基于 Python 2.7.10 安装完成,完成后为了使用方便,为服务添加 init.d 脚本
master 端脚本
#!/bin/sh # # Salt master ################################### # LSB header ### BEGIN INIT INFO # Provides: salt-master # Required-Start: $all # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Salt master control daemon # Description: This is a daemon that controls the Salt minions. ### END INIT INFO # chkconfig header # chkconfig: 345 96 05 # description: This is a daemon that controls the Salt minions # # processname: /usr/bin/salt-master 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 # Default values (can be overridden below) SALTMASTER=/usr/local/python2.7/bin/salt-master PYTHON=/usr/local/python2.7/bin/python2.7 MASTER_ARGS="" if [ -f /etc/default/salt ]; then . /etc/default/salt fi SERVICE=salt-master PROCESS=salt-master RETVAL=0 start() { echo -n $"Starting salt-master daemon: " if [ -f $SUSE_RELEASE ]; then startproc -f -p /var/run/$SERVICE.pid $SALTMASTER -d $MASTER_ARGS rc_status -v elif [ -e $DEBIAN_VERSION ]; then if [ -f $LOCKFILE ]; then echo -n "already started, lock file found" RETVAL=1 elif $PYTHON $SALTMASTER -d $MASTER_ARGS >& /dev/null; then echo -n "OK" RETVAL=0 fi else daemon --check $SERVICE $SALTMASTER -d $MASTER_ARGS fi RETVAL=$? echo return $RETVAL } stop() { echo -n $"Stopping salt-master daemon: " if [ -f $SUSE_RELEASE ]; then killproc -TERM $SALTMASTER rc_status -v elif [ -f $DEBIAN_VERSION ]; then # Added this since Debian's start-stop-daemon doesn't support spawned processes if ps -ef | grep "$PYTHON $SALTMASTER" | grep -v grep | awk '{print $2}' | xargs kill &> /dev/null; then echo -n "OK" RETVAL=0 else echo -n "Daemon is not started" RETVAL=1 fi else killproc $PROCESS fi RETVAL=$? echo } restart() { stop start } # See how we were called. 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
minion 端脚本
#!/bin/sh # # Salt minion ################################### # LSB header ### BEGIN INIT INFO # Provides: salt-minion # Required-Start: $all # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Salt minion daemon # Description: This is the Salt minion daemon that can be controlled by the # Salt master. ### END INIT INFO # chkconfig header # chkconfig: 345 97 04 # description: This is the Salt minion daemon that can be controlled by the Salt master. # # processname: /usr/bin/salt-minion 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 # Default values (can be overridden below) SALTMINION=/usr/local/python2.7/bin/salt-minion PYTHON=/usr/local/python2.7/bin/python2.7 MINION_ARGS="" if [ -f /etc/default/salt ]; then . /etc/default/salt fi SERVICE=salt-minion PROCESS=salt-minion RETVAL=0 start() { echo -n $"Starting salt-minion daemon: " if [ -f $SUSE_RELEASE ]; then startproc -f -p /var/run/$SERVICE.pid $SALTMINION -d $MINION_ARGS rc_status -v elif [ -e $DEBIAN_VERSION ]; then if [ -f $LOCKFILE ]; then echo -n "already started, lock file found" RETVAL=1 elif $PYTHON $SALTMINION -d $MINION_ARGS >& /dev/null; then echo -n "OK" RETVAL=0 fi else if [[ ! -z "$(pidofproc -p /var/run/$SERVICE.pid $PROCESS)" ]]; then RETVAL=$? echo -n "already running" else daemon --check $SERVICE $SALTMINION -d $MINION_ARGS fi fi RETVAL=$? echo return $RETVAL } stop() { echo -n $"Stopping salt-minion daemon: " if [ -f $SUSE_RELEASE ]; then killproc -TERM $SALTMINION rc_status -v RETVAL=$? elif [ -f $DEBIAN_VERSION ]; then # Added this since Debian's start-stop-daemon doesn't support spawned processes if ps -ef | grep "$PYTHON $SALTMINION" | grep -v grep | awk '{print $2}' | xargs kill &> /dev/null; then echo -n "OK" RETVAL=0 else echo -n "Daemon is not started" RETVAL=1 fi else killproc $PROCESS RETVAL=$? fi echo } restart() { stop start } # See how we were called. case "$1" in start|stop|restart) $1 ;; status) if [ -f $SUSE_RELEASE ]; then echo -n "Checking for service salt-minion " checkproc $SALTMINION rc_status -v elif [ -f $DEBIAN_VERSION ]; then if [ -f $LOCKFILE ]; then RETVAL=0 echo "salt-minion is running." else RETVAL=1 echo "salt-minion 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
荒野乱斗国际版 (BrawlStars)最新版本v56.274
下载一波超人内置修改器菜单版 安卓版v1.0.2
下载敢达决战官方正版 安卓版v6.7.9
下载敢达决战 安卓版v6.7.9
下载继承了一座戏园子无限声望铜钱版 内置菜单最新版v1.7
继承了一座戏园子折相思版是游戏的破解版本,在该版本中为玩家提
山河半世橙光清软金手指版 无限鲜花v3.24
山河半世是一款超级好玩的橙光恋爱游戏,在游戏中玩家们需要扮演
蓬莱手游折相思版 安卓版v1.0.0
蓬莱免广告版是游戏的修改版本,在该版本中为玩家去除了广告,玩
当红影后橙光游戏破解版2025 最新版v1.0
当红影后橙光破解版是一款超级好玩的娱乐圈题材的橙光游戏,在这
忽然成了万人迷清软完结版 无限鲜花版v12.15
忽然成了万人迷破解版是一款非常好玩的男性向橙光游戏,在有一天