网站案例介绍,上海seo整站优化,商城类网站价格,广州网络公司简介 Supervisor 是一款 Python 开发的进程管理系统#xff0c;允许用户监视和控制 Linux 上的进程#xff0c;能将一个普通命令行进程变为后台守护进程#xff0c;异常退出时能自动重启
1、安装
yum -y install supervisor2、配置默认配置文件
echo_supervisord_conf 允许用户监视和控制 Linux 上的进程能将一个普通命令行进程变为后台守护进程异常退出时能自动重启
1、安装
yum -y install supervisor2、配置默认配置文件
echo_supervisord_conf /etc/supervisord.conf3、修改主配置文件配置
vim /etc/supervisord.conf
... ...
# 其他配置保持默认即可
[include]
files /etc/supervisord.d/*.ini4、创建子进程 supervisor.ini giftpanel go程序 recharge java程序
[program:giftpanel]
directory/opt/gs/giftpanel/
command/opt/gs/giftpanel/gift-panel -DserviceCenterip -Dnamespacegs-test -DserverPort9082
numprocs1
autostarttrue
startretries3
autorestarttrue
redirect_stderrfalse
stdout_logfile/opt/supervisorlogs/giftpanel.log
stdout_logfile_maxbytes50MB
stdout_logfile_backups10
stderr_logfile/opt/supervisorlogs/giftpanel.err.log
stderr_logfile_maxbytes10MB [program:recharge]
command/usr/lib/jvm/java-1.8.0/bin/java -jar -server -Xms512M -Xmx2048M -XX:UseConcMarkSweepGC -XX:UseParNewGC -XX:HeapDumpOnOutOfMemoryError -XX:HeapDumpPath/data/gs/recharge/heapdump.hprof -XX:PrintGC -XX:PrintGCDateStamps -XX:PrintGCDetails -XX:PrintGCTimeStamps -Xloggc:/data/gs/recharge/gc.log -DserverId500 -DserviceCenterip -Dnamespacegs-test -DserverPort9090 /opt/gs/recharge/recharge-1.0-SNAPSHOT-gs.jar
numprocs1
autostarttrue
startretries3
autorestarttrue
redirect_stderrfalse
stdout_logfile/opt/supervisorlogs/recharge.log
stdout_logfile_maxbytes50MB
stdout_logfile_backups10
stderr_logfile/opt/supervisorlogs/recharge.log
stderr_logfile_maxbytes10MB#如果需要配置分组 后面添加配置
[group:gs]
programsgiftpanel,recharge
5、启动
第一次配置需要重启supervisord
systemctl start supervisord.service之后添加子配置(*.ini)文件 只需要update即可
supervisorctl update6,1启动项目未分组情况下
重启所有
supervisorctl restart all
supervisorctl restart recharge
supervisorctl restart giftpanel停止所有
supervisorctl stop all
supervisorctl stop giftpanel
supervisorctl stop recharge6,2启动项目分组情况下 重启所有
supervisorctl restart gs:*
重启
supervisorctl restart gs:recharge
supervisorctl restart gs:giftpanel停止所有
supervisorctl stop gs:*
停止
supervisorctl stop gs:giftpanel
supervisorctl stop gs:recharge查看log tail -f /data/supervisorlogs/gs/giftpanel.log