当前位置: 动力学知识库 > 问答 > 编程问答 >

python - Gunicorn not found when demonized with supervisor to run Airbnb/Superset

问题描述:

I'm trying to demonize Superset[https://github.com/airbnb/superset] and it use gunicorn. Im using supervisor and my config file looks like this:

[program:superset]

command = /usr/local/lib/python2.7/dist-packages/superset/bin/superset runserver

directory = /usr/local/lib/python2.7/dist-packages/superset/data/superset

environment= PATH='$PATH:/usr/local/lib/python2.7/dist-packages/superset/bin/',PYTHONPATH='$PYTHONPATH:/data/superset'

autostart = false

autorestart = false

startretries = 3

stdout_logfile = /var/log/superset.log

stdout_logfile_maxbytes = 100MB

stdout_logfile_backups = 5

stderr_logfile = /var/log/superset_err.log

stderr_logfile_maxbytes = 100MB

stderr_logfile_backups = 5

however, when I start supervisor and run the program Im getting this error in error log file

/bin/sh: 1: gunicorn: not found

, but when I run the app straigth from command line it work :

gunicorn -w 4 --timeout 60 -b 0.0.0.0:8081 --limit-request-line 0 --limit-request-field_size 0 superset:app

Im running

gunicorn --version

gunicorn (version 19.6.0)

Appreciate your help

网友答案:

I just had to explicitly call Sudo before the command, ie command = sudo /usr/local/lib/python2.7/dist-packages/superset/bin/superset runserver -a 0.0.0.0

网友答案:

supervisor can't monitor demonized processes. Supervisor creates child processes of gunicorn and then monitors its child processes .

分享给朋友:
您可能感兴趣的文章:
随机阅读: