Django芹菜:运行python manage.py celeryd时的消费者连接错误(111)

时间:2011-09-20 10:32:14

标签: django celery

我正在尝试配置一个Django项目来使用Celery(我在Debian Squeeze上使用Django 1.3)

我安装了django-celery(2.3.3),然后是these instructions

我的django芹菜设置如下:

BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_VHOST = "/"

当我尝试用...启动芹菜工作服务器时

$ python manage.py celeryd -l info

我在最后得到以下输出“消费者:连接错误:[Errno 111] ”:

/home/thomas/virtualenv/ULYSSE/lib/python2.6/site-packages/djcelery/loaders.py:84:     UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!
warnings.warn("Using settings.DEBUG leads to a memory leak, never "
[2011-09-20 12:14:00,645: WARNING/MainProcess]  

-------------- celery@debian v2.3.3
---- **** -----
--- * ***  * -- [Configuration]
-- * - **** ---   . broker:      amqp://guest@localhost:5672//
- ** ----------   . loader:      djcelery.loaders.DjangoLoader
- ** ----------   . logfile:     [stderr]@INFO
- ** ----------   . concurrency: 1
- ** ----------   . events:      OFF
- *** --- * ---   . beat:        OFF
-- ******* ----
--- ***** ----- [Queues]
--------------   . celery:      exchange:celery (direct) binding:celery


[Tasks]
  . competitions.tasks.add

[2011-09-20 12:14:00,788: INFO/PoolWorker-1] child process calling self.run()
[2011-09-20 12:14:00,795: WARNING/MainProcess] celery@debian has started.
[2011-09-20 12:14:00,809: ERROR/MainProcess] **Consumer: Connection Error: [Errno 111]          Connection refused. Trying again in 2 seconds**...

显然,我的设置被正确读取(参见输出中的配置部分)并正确启动了工作进程(“celery @ debian has started”)

我无法弄清楚为什么这个“消费者:连接错误:[Errno 111]”错误附加...

这与BROKER_USER和BROKER_PASSWORD设置有关吗?

我尝试了不同的用户/密码设置(我的帐户,root帐号...),但我总是得到同样的错误。 'BROKER_USER'和'BROKER_PASSWORD是指OS用户,数据库用户,“经纪人”用户吗?

如何摆脱此连接错误?

1 个答案:

答案 0 :(得分:17)

看起来像是没有安装或运行rabbitmq。你能看看吗?

apt-get install rabbitmq-server 

在Ubuntu上