配置服务异常自启动
Posted wt11
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了配置服务异常自启动相关的知识,希望对你有一定的参考价值。
cat /home/ops/supervisor/etc/supervisord.conf [unix_http_server] file=/home/ops/supervisor/run/supervisor.sock ; the path to the socket file ;chmod=0700 ; socket file mode (default 0700) chown=ops:ops ; socket file uid:gid owner ;username=ops ; default is no username (open server) ;password=supervisor ; default is no password (open server) [inet_http_server] ; inet (TCP) server disabled by default port=*:9001 ; ip_address:port specifier, *:port for all iface ;username=ops ; default is no username (open server) ;password=supervisor ; default is no password (open server) [supervisord] logfile=/home/ops/supervisor/log/supervisord.log ; main log file; default $CWD/supervisord.log logfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MB logfile_backups=10 ; # of main logfile backups; 0 means none, default 10 loglevel=info ; log level; default info; others: debug,warn,trace pidfile=/home/ops/supervisor/run/supervisord.pid ; supervisord pidfile; default supervisord.pid nodaemon=false ; start in foreground if true; default false minfds=1024 ; min. avail startup file descriptors; default 1024 minprocs=200 ; min. avail process descriptors;default 200 ;umask=022 ; process file creation umask; default 022 user=ops ; default is current user, required if root directory=/home/ops/python27/bin ; default is not to cd during start childlogdir=/home/ops/supervisor/log/ ; ‘AUTO‘ child log dir, default $TEMP [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisorctl] serverurl=unix:///home/ops/supervisor/run/supervisor.sock ; use a unix:// URL for a unix socket [program:rabbitmq] command=/home/ops/oms/rabbitmq/sbin/rabbitmq-server start autostart=true autorestart=true startretries=3 user=ops environment=HOME="/home/ops" [program:celery] command=/home/ops/oms/open-mail-system/venv/bin/celery worker -A celery_job.celery --loglevel=info directory=/home/ops/oms/open-mail-system autostart=true autorestart=true startretries=3 user=ops [program:gunicorn] command=/home/ops/oms/open-mail-system/venv/bin/gunicorn -w 2 -b 127.0.0.1:9000 manage:app directory=/home/ops/oms/open-mail-system/ autostart=true autorestart=true startretries=3 user=ops [program:prometheus] command=/home/ops/netmon/prometheus/prometheus --config.file=/home/ops/netmon/prometheus/prometheus.yml directory=/home/ops/netmon/prometheus/ autostart=true autorestart=true startretries=3 user=ops [program:grafana] command=/home/ops/netmon/grafana/bin/grafana-server -homepath /home/ops/netmon/grafana/ directory=/home/ops/netmon/grafana/ autostart=true autorestart=true startretries=3 user=ops ;[program:nginx] ;command=/home/ops/nginx/sbin/nginx ;autostart=true ;autorestart=true ;startretries=3 ;startsecs=5 ;user=ops [program:daily-report] command=/home/ops/daily_report/venv/bin/python /home/ops/daily_report/venv/bin/gunicorn -b 0.0.0.0:8888 manage:app --timeout 500 --workers 8 directory=/home/ops/daily_report/ autostart=true autorestart=true startretries=3 user=ops ================================================================== python27/bin/supervisorctl update python27/bin/supervisorctl start daily_report python27/bin/supervisorctl reload
以上是关于配置服务异常自启动的主要内容,如果未能解决你的问题,请参考以下文章