1

我正在使用 Django,我的开发环境是 Windows。昨天我花了一整天的时间试图用 RabbitMQ 在我的笔记本电脑上运行 celery。我浏览了所有教程,并没有提到关于 Windows 的特别内容。我遵循了芹菜的官方文档:http: //celery.readthedocs.org/en/latest/django/first-steps-with-django.html

最终我尝试在 Ubuntu 上运行它,一切正常。使用 celery 或 manage.py celeryd 运行后,worker 卡住了:

python manage.py celery worker -E -l 调试

[2014-06-18 07:23:48,516: DEBUG/MainProcess] | Worker: Preparing bootsteps.
[2014-06-18 07:23:48,525: DEBUG/MainProcess] | Worker: Building graph...
[2014-06-18 07:23:48,532: DEBUG/MainProcess] | Worker: New boot order: {StateDB, Timer, Hub, Queues (intra), Pool, Autoscaler, Beat, Autoreloader, Consumer}
[2014-06-18 07:23:48,549: DEBUG/MainProcess] | Consumer: Preparing bootsteps.
[2014-06-18 07:23:48,553: DEBUG/MainProcess] | Consumer: Building graph...
[2014-06-18 07:23:48,569: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Events, Mingle, Gossip, Tasks, Control, Agent, Heart, event loop}
[2014-06-18 07:23:48,582: DEBUG/MainProcess] | Worker: Starting Pool

我试图从 cygwin 运行 celeryd,但它也没有用。我的 RabbitMQ 配置没问题,我看到 django 能够向 RabbitMQ 发送消息。

我确定这与 Windows 有关,而不是缺陷配置。这是我的配置:

# CELERY
djcelery.setup_loader()
BROKER_HOST     = "127.0.0.1"
BROKER_PORT     = 5672
BROKER_USER     = "my_user"
BROKER_PASSWORD = "my_pass"
BROKER_VHOST    = "my_vhost"

我还使用了 'localhost' 而不是 127.0.0.1。

有人对 Windows 上的 celery 有所了解吗?还有其他建议吗?

4

0 回答 0