安装Supervisord】
yum install epel-release
yum install -y supervisor
【设置开启自启】
systemctl enable supervisord
【Supervisord管理命令】
systemctl stop supervisord
systemctl start supervisord
systemctl status supervisord
systemctl reload supervisord
systemctl restart supervisord
【修改配置文件,使Supervisord可以在web端显示】
vim /etc/supervisord.conf
#取消10-13行注释,前面数字是行号
10 [inet_http_server] ; inet (TCP) server disabled by default
11port=127.0.0.1:9001; (ip_address:port specifier, *:portfor all iface)
12username=user ; (default is no username (open server))
13password=123; (default is no password (open server))
【创建Supervisord文件】
vim /etc/supervisord.d/python.ini
例如:
[program:demo-api-service]
process_name=demo-api-service
command= ./home/gitlab-runner/builds/demo-api/dcm-api
autostart=true
autorestart=true
user=gitlab-runner
numprocs=1
redirect_stderr=true
stdout_logfile=/data/log/supervisor/demo-api-service.log
【启动Supervisord】
systemctl start supervisord
查看是否启动
systemctl status supervisord
网友评论