-2

我正在使用主管用 django 1.8.8 运行 celery。设置。也使用django-supervisor==0.3.4 supervisor==3.2.0

但是当我重新启动所有进程时,我得到

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
4

2 回答 2

1

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

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

于 2016-11-18T19:44:27.823 回答
0

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

如果不是权限问题,请将其添加到您的 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

于 2016-11-17T19:31:32.910 回答