离线安装Supervisor

离线安装Supervisor

系统环境:redhat5.4/

由于需要安装meld组件,所以需要至少python2.6以上版本,于是我们先安装python2.6,然后再安装supervisor

下载supervisor安装包(链接: https://pan.baidu.com/s/1nuTl95f 密码: 9xd5)

一、升级Python版本到2.6

#tar jxvf Python-2.6.6.tar.bz2
#cd Python-2.6.6.
#./configure
#make all
#make install
#make clean
#make distclean
#mv /usr/bin/python /usr/bin/python2.4
#ln -s /usr/local/bin/python2.6 /usr/bin/python
#python -V

二、安装supervisor

1.安装setuptools

#unzip setuptools-36.4.0.zip
#cd setuptools*
#python setup.py install

2.安装elementtree

#tar -xzvf elementtree-1.2.6-20050316.tar.gz
#cd elem*
#python setup.py install

3.安装meld

# tar -xzvf meld3-1.0.2.tar.gz
# cd meld*
#python setup.py install

4.安装Supervisor

#tar -xzvf supervisor-3.0a12.tar.gz
#cd supervisor*
#python setup.py install

三、配置supervisor

1.创建配置

#mkdir -p /etc/supervisor/conf.d
#echo_supervisord_conf > /etc/supervisord.conf

2.修改配置

[include]  
files = /etc/supervisor/conf.d/*.conf

配置表示包括/etc/supervisor/conf.d/的所有conf文件

3.创建配置(tomcat)

[program:tomcat]
command=/opt/apache-tomcat-8.0.35/bin/catalina.sh run
stdout_logfile=/opt/apache-tomcat-8.0.35/logs/catalina.out
autostart=true
autorestart=true
user=app
startsecs=5
priority=1
stopasgroup=true
killasgroup=true

4.启动suprvisor

#supervisord -c /etc/supervisord.conf

5.测试supervisor

杀死tomcat进程,查看是否进程自动重启以及日志情况

6.配置开机启动

将安装包中的supervisord文件拷到/etc/init.d/中

cp supervisord /etc/init.d/

加入开机启动

chkconfig --add supervisord

查看开机启动配置情况

chkconfig --list |grep supervisord

7.重启服务器测试

reboot

相关推荐