我正在尝试让 Django Celery 工作人员连接到 RabbitMQ 服务器,所有服务器都在同一主机上运行。
但是,当我运行时,manage.py celery worker
我得到的是:
[2013-06-11 17:33:41,185: WARNING/MainProcess] celery@localhost has started.
[2013-06-11 17:33:44,192: ERROR/MainProcess] Consumer: Connection Error: Socket closed. Trying again in 2 seconds...
[2013-06-11 17:33:50,203: ERROR/MainProcess] Consumer: Connection Error: Socket closed. Trying again in 4 seconds...
[2013-06-11 17:34:03,214: ERROR/MainProcess] Consumer: Connection Error: Socket closed. Trying again in 6 seconds...
[2013-06-11 17:34:27,232: ERROR/MainProcess] Consumer: Connection Error: Socket closed. Trying again in 8 seconds...
当我检查我的时,/var/log/rabbitmq/rabbit@localhost.log
我看到了几条消息,例如:
=ERROR REPORT==== 11-Jun-2013::17:33:44 ===
exception on TCP connection <0.201.0> from 127.0.0.1:43461
{channel0_error,opening,
{amqp_error,access_refused,
"access to vhost 'myapp' refused for user 'guest'",
'connection.open'}}
我正在使用 Ubuntu 12.04 存储库中的标准包,默认设置和我的 django-celery 设置如下所示:
BROKER_HOST = "localhost"
BROKER_PORT = 5672
BROKER_USER = "guest"
BROKER_PASSWORD = "guest"
BROKER_VHOST = "myapp"
为什么 RabbitMQ 拒绝连接?