django-supervisor连接被拒绝

时间:2016-11-17 19:25:31

标签: python django supervisor django-supervisor

我正在使用主管用django 1.8.8来运行芹菜。建立。也使用django-supervisor==0.3.4 supervisor==3.2.0

但是当我重新启动所有的proecsses时,我得到了

unix:///tmp/supervisor.sock refused connection

无法重启任何进程,

python manage.py supervisor --config-file=setting/staging_supervisor.conf --settings=setting.staging_settings restart all

主管配置文件

[supervisord]
    logfile_maxbytes=10MB                                                       ; maximum size of logfile before rotation
    logfile_backups=3                                                           ; number of backed up logfiles
    loglevel=warn                                                               ; info, debug, warn, trace
    nodaemon=false                                                              ; run supervisord as a daemon
    minfds=1024                                                                 ; number of startup file descriptors
    minprocs=200                                                                ; number of process descriptors
    childlogdir=/logs/                    ; where child log files will live

    [program:celeryd_staging]
    environment=PATH="{{ PROJECT_DIR }}/../../bin"
    command={{ PYTHON }} {{ PROJECT_DIR }}/manage.py celeryd -l info -c 1 --logfile=/logs/staging-celeryd.log --settings=setting.staging_celery_settings
    redirect_stderr=false

    [program:celerybeat_staging]
    environment=PATH="{{ PROJECT_DIR }}/../../bin"
    command=/{{ PYTHON }} {{ PROJECT_DIR }}/manage.py celerybeat --loglevel=INFO --logfile=/logs/staging-celerybeat.log --settings=setting.staging_celery_settings
    redirect_stderr=false

    [group:tasks]
    environment=PATH="{{ PROJECT_DIR}}/../../bin"
    programs=celeryd_staging,celerybeat_staging

    [program:autoreload]
    exclude=true

    [program:runserver]
    exclude=true

2 个答案:

答案 0 :(得分:1)

得到了解决方案。由于我使用django-supervisor包,因为supervisord在我的虚拟环境中没有重新加载主管进程。

一旦我重新加载了主管进程,被拒绝的连接错误就消失了。

答案 1 :(得分:0)

确保除了您以外的某个用户(例如root或其他用户)已经拥有另一个/tmp/supervisor.sock

如果不是权限问题,请将其添加到您的supervisord配置中:

[unix_http_server]
file = /tmp/supervisor.sock ;
chmod=0700 ;

[rpcinterface:supervisor]
supervisor.rpcinterface_factory =
supervisor.rpcinterface:make_main_rpcinterface

这也可能对您有所帮助:https://github.com/Supervisor/supervisor/issues/480#issuecomment-145193475