supervisord 的使用

配置了一个机器学习模型的服务,用的nginx+gunicorn + python + supervisord

里面关键的配置:


supervisor.conf 

==============

[unix_http_server]
file=/tmp/supervisor.sock   ; (the path to the socket file)

[inet_http_server]         ; inet (TCP) server disabled by default
port=127.0.0.1:9001        ; (ip_address:port specifier, *:port for all iface)

[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)

[program:bestcoupon]
command=/path/bin/gunicorn -w11 -b0.0.0.0:8099 bestcoupon:app
directory=/path/to/web
;user=nobody
startsecs=0                                                                             
stopwaitsecs=0                                                                          
autostart=true                                                                         
autorestart=true
stdout_logfile=/path/to/web/log/gunicorn.log
stderr_logfile=/path/to/web/log/gunicorn.err


start.sh
===========
echo " start service ..."
ps aux | grep gunicorn | awk '{print $2;}' | xargs kill -9
ps aux | grep supervisor | awk '{print $2;}' |  xargs kill -9
sleep 1
supervisord  -c conf/supervisor.conf
echo "deone"

restart.sh

===========

supervisorctl status
supervisorctl restart bestcoupon


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值