離線安裝Supervisor

離線安裝Supervisor

系統環境:redhat5.4/python

因爲須要安裝meld組件,因此須要至少python2.6以上版本,因而咱們先安裝python2.6,而後再安裝supervisorshell

下載supervisor安裝包(連接: https://pan.baidu.com/s/1nuTl95f 密碼: 9xd5)apache

1、升級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

2、安裝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

3、配置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文件tomcat

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/中app

cp supervisord /etc/init.d/測試

加入開機啓動rest

chkconfig --add supervisord日誌

查看開機啓動配置狀況code

chkconfig --list |grep supervisord

7.重啓服務器測試

reboot

相關文章
相關標籤/搜索