プロセス管理ツールSupervisorのインストール方法

1.supervisorのインストール
#wget https://pypi.python.org/packages/80/37/964c0d53cbd328796b1aeb7abea4c0f7b0e8c7197ea9b0b9967b7d004def/supervisor-3.3.1.tar.gz

#tar zxf supervisor-3.3.1.tar.gz
#cd supervisor-3.3.1
#python setup.py install

2.supervisorの設定
#mkdir /etc/supervisor
#echo_supervisord_conf > /etc/supervisor/supervisord.conf

[unix_http_server]
file=/tmp/supervisor.sock
;chmod=0700
;chown=nobody:nogroup
;[inet_http_server]
;port=127.0.0.1:9001
;username=user
;password=123

[supervisord]
logfile=/tmp/supervisord.log
logfile_maxbytes=50MB
logfile_backups=10
loglevel=info
pidfile=/tmp/supervisord.pid
nodaemon=false
minfds=1024
minprocs=200

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock
;serverurl=http://127.0.0.1:9001

[program:xx]
command=/opt/apache-tomcat-8.0.35/bin/catalina.sh run
autostart=true
startsecs=10
autorestart=true
startretries=3
user=tomcat
priority=999
redirect_stderr=true
stdout_logfile_maxbytes=20MB
stdout_logfile_backups = 20

stdout_logfile=/opt/apache-tomcat-8.0.35/logs/catalina.out
stopasgroup=false
killasgroup=false
[include]
files = relative/directory/*.ini

3.管理プロセス
#mkdir /etc/supervisor/config.d
#vim /etc/supervisor/supervisord.conf
例 [include]
files = /etc/supervisor/config.d/*.ini

[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
startsecs=5
priority=1
stopasgroup=true
killasgroup=true

4.Supervisorの起動
#supervisord -c /etc/supervisor/supervisord.conf

Linux

Posted by arkgame