Supervisor 安装&配置&管理&添加应用

Supervisor

######################

Supervisor Python下的进程管理工具

@Supervisor 官网文档

@各种平台开机启动脚本

##########################

Supervisor库从2019-04-05开始正式从Python2 迁移到python3啦!

安装配置过程基本没变,所以迁移到supervisor4版本只需简单地:

pip2.7 uninstall supervisor
pip3.6 install supervisor
supervisord -v
4.0.4

###################

安装&配置

 

##################

pip3 install supervisor
supervisord -v

mkdir /etc/supervisor
echo_supervisord_conf > /etc/supervisor/supervisord.conf
vim /etc/supervisor/supervisord.conf
##############################################
file=/var/run/supervisord.sock 
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid

serverurl=unix:///var/run/supervisord.sock	

[include]
files = /etc/supervisor/*.ini
##############################################
vim /etc/supervisor/GotIT.ini

#########################################
[group:GotIT]
programs=uWSGI,daphne,celery
priority=1

[program:uWSGI]
command=uwsgi --ini uwsgi.ini
numprocs=1
directory=/home/taylorgogo/GotIT/
autostart=true
autorestart=true
startretries=3
stopsignal=QUIT
stopwaitsecs=10
user=root
redirect_stderr=true
stdout_logfile=/var/log/supervisor/uwsgi.log


[program:daphne]
directory=/home/taylorgogo/GotIT/
command=daphne -b 127.0.0.1 -p 1013 GotIT.asgi:application
numprocs=1
autostart=true
autorestart=true
startretries=3
stopsignal=QUIT
stopwaitsecs=10
user=root
redirect_stderr=true
stdout_logfile=/var/log/supervisor/daphne.log

[program:celery]
numprocs=1
directory=/home/taylorgogo/GotIT/
command=celery -A GotIT worker -l info
stdout_logfile=/var/log/celery/worker.log
stderr_logfile=/var/log/celery/worker.log
autostart=true
autorestart=true
startretries=3
stopwaitsecs = 10
stopasgroup=true
user=root
######################################################

 

 

你可能感兴趣的:(python全栈开发,GotIT)