Supervisor program???????
???????????? ???????[ 2016/7/20 11:48:20 ] ?????????????????? ???ù??? Supervisor program
????program ????
????????????????? supervisrod ???????????????????????????????????????????????????????????д?? supervisord.conf ????????????????????????????? include ??????????????飩д????????????????
???????????????????????? /etc/supervisor/ ????????Щ????????????????? /etc/supervisord.conf ?? include ???????????????£?
????[include]
????files = /etc/supervisor/*.conf
?????????и??? Python ?? Flask ????д???????????????? usercenter???? gunicorn (http://gunicorn.org/) ?? web ???????????????λ?? /home/leon/projects/usercenter??gunicorn ????????gunicorn.py??WSGI callable ?? wsgi.py ??? app ????????????????????????????????????????
????cd /home/leon/projects/usercenter
????gunicorn -c gunicorn.py wsgi:app
?????????д???????????????????????????????? supervisord ???????gunicorn ?? daemon ??????????? False????
[program:usercenter]
directory = /home/leon/projects/usercenter ; ??????????
command = gunicorn -c gunicorn.py wsgi:app ; ???????????????????????????????????????????
autostart = true ; ?? supervisord ???????????????
startsecs = 5 ; ??? 5 ?????????????????????????????
autorestart = true ; ??????????????????
startretries = 3 ; ??????????????????????? 3
user = leon ; ???????????
redirect_stderr = true ; ?? stderr ????? stdout????? false
stdout_logfile_maxbytes = 20MB ; stdout ????????С????? 50MB
stdout_logfile_backups = 20 ; stdout ????????????
; stdout ????????????????????????????????????????????????????????supervisord ?????????????????
stdout_logfile = /data/logs/usercenter_stdout.log
; ??????? environment ????????????????????????????÷?????? PYTHONPATH
; environment=PYTHONPATH=$PYTHONPATH:/path/to/somewhere
???????????????????????? [program:x] ???????????????? supervisord ???????????????[program:x] ???е? x ??? program name???????????supervisorctl ?? web ???棩??????? supervisorctl ??????????????????? start??restart??stop ???????
??????? supervisorctl
????Supervisorctl ?? supervisord ??????????п???????????????????? supervisord ?????????????????????? supervisord ??????????????????????
????supervisorctl -c /etc/supervisord.conf
??????????????????? supervisorctl ?? shell ???棬????????в???????????
????> status # ????????
????> stop usercenter # ??? usercenter ????
????> start usercenter # ??? usercenter ????
????> restart usercenter # ???? usercenter ????
????> reread ?? ????и??£?????????????????????????????????
????> update ?? ????????????????????
??????????Щ??????????????????????? supervisorctl ?? shell ???棬?????????? bash ??????У?
$ supervisorctl status
$ supervisorctl stop usercenter
$ supervisorctl start usercenter
$ supervisorctl restart usercenter
$ supervisorctl reread
$ supervisorctl update
????????
???????? supervisorctl ????????????? supervisrod ??? web ??????棬??? web ?????? Basic Auth ????????????????
?????????????????????????????? group?????з???????
?????????????????????? supervisord ?????????? pragram ?????????????? crash ????????????????????? stderr????????????????????????????
???????????????????????????????logstash
cd /etc/supervisord.d
vim logstash.conf
[program:logstash]
command=/opt/logstash/bin/logstash -f /opt/logstash/conf/zabbix.conf -l /opt/logstash/logs/zabbix.log
numprocs=1
autostart=true
autorestart=true
log_stdout=true
log_stderr=true
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11