supervisor配置

;web管理端开启
[program:themis-web]
command=/home/themis-test/python-project/bin/python command.py -m web -c data/web.json
autostart=true
redirect_stderr=true
stdout_logfile=tmp/themis_web.log
loglevel=info

;开启文件下载服务器
[program:themis-download]
command=/home/themis-test/python-project/bin/python task_export/file_download.py
autostart=true
redirect_stderr=true
stdout_logfile=tmp/themis_download.log
loglevel=info

;开启任务导出模块
[program:themis-export]
command=/home/themis-test/python-project/bin/celery -A task_exports worker -E -l info
autostart=true
redirect_stderr=true
stdout_logfile=tmp/themis_export.log
loglevel=info
;开启规则解析模块
[program:themis-analysis]
command=/home/themis-test/python-project/bin/celery -A task_other worker -E -Q sqlreview_analysis -l info
autostart=true
redirect_stderr=true
stdout_logfile=tmp/themis_analysis.log
loglevel=info
;开启obj信息抓取模块
[program:themis-capture-obj]
command=/home/themis-test/python-project/bin/celery -A task_capture worker -E -Q sqlreview_obj -l debug -B -n celery-capture-obj
autostart=true
redirect_stderr=true
stdout_logfile=tmp/themis_capture_obj.log
loglevel=info
;开启plan、stat、text信息抓取模块
[program:themis-capture-other]
command=/home/themis-test/python-project/bin/celery -A task_capture worker -E -Q sqlreview_other -l info -B -n celery-capture-other
autostart=true
redirect_stderr=true
stdout_logfile=tmp/themis_capture_other.log
loglevel=info
;celery的任务管理模块,去掉前边的";"即可开启,需要配置redis的连接方式
;[program:themis-flower]
;command=/home/themis-test/python-project/bin/celery flower --address=0.0.0.0 --broker=redis://:[email protected]:6379/0
;autostart=true
;redirect_stderr=true
;stdout_logfile=tmp/themis_flower.log
;loglevel=info

注意:如果前边建立的用户不同或者使用了不同的目录,需要将这个文件里的/home/themis-test/python-project/替换为自己的路径

supervisor常用命令

开启supervisor
supervisord -c script/supervisord.conf
重载supervisor
supervisorctl -u sqlreview -p sqlreview.themis reload
进入supervisor管理控制台,这里的-u,-p代表supervisorctl的用户名和密码,在supervisord.conf中配置
supervisorctl -u username -p password

参考:http://www.supervisord.org/

results matching ""

    No results matching ""