RabbitMQ / Celery with Django 在延迟/就绪/等情况下挂起 - 没有有用的日志信息

发布于 2024-08-19 09:37:46 字数 1398 浏览 9 评论 0原文

所以我只是设置了celery和rabbitmq,创建了我的用户,设置了虚拟主机,将用户映射到虚拟主机,并成功运行了celery守护进程(或者我假设)

(queuetest)corky@corky-server:~/projects/queuetest$ ./manage.py celeryd
 celery@corky-server v0.9.5 is starting.
 Configuration ->
. broker -> amqp://celery@localhost:5672/
. queues ->
. celery -> exchange:celery (direct) binding:celery
. concurrency -> 2
. loader -> celery.loaders.djangoapp
. logfile -> [stderr]@WARNING
. events -> OFF
. beat -> OFF

Celery has started.

我创建了一个“celery”用户,因为我感觉不太好在这种情况下具有创造性。

当我尝试在 celery 文档中做一个简单的示例时:

>>> from tasks import add
>>> r = add.delay(2, 2)
>>> r
<AsyncResult: 16235ea3-c7d6-4cce-9387-5c6285312c7c>
>>> r.ready()
(hangs for eternity.)

所以我检查了常见问题解答,想知道还有什么可能发生,它告诉我这是由于用户权限而导致的常见错误,所以我三次检查了这些,没有什么,又做了另一个新用户,还是什么都没有。如果我从 carrot.connection 导入 DjangoBrokerConnection 并获取信息,它会与我的 celery 设置中的内容相匹配。常见问题解答指出要检查您的日志文件。

我的 rabbit.log 文件在这种情况下不是很有帮助,只是显示:

=INFO REPORT==== 26-Jan-2010::11:58:22 ===
accepted TCP connection on 0.0.0.0:5672 from 127.0.0.1:60572

=INFO REPORT==== 26-Jan-2010::11:58:22 ===
starting TCP connection <0.1120.0> from 127.0.0.1:60572

等等。此时,我不知道我的问题还可能是什么。我正在运行 Ubuntu Jaunty 并从 apt-get 安装了 RabbitMQ。

预先感谢您的任何帮助。

So I just setup celery and rabbitmq, created my user, setup the vhost, mapped the user to the vhost, and ran the celery daemon succesfully (or so I assume)

(queuetest)corky@corky-server:~/projects/queuetest$ ./manage.py celeryd
 celery@corky-server v0.9.5 is starting.
 Configuration ->
. broker -> amqp://celery@localhost:5672/
. queues ->
. celery -> exchange:celery (direct) binding:celery
. concurrency -> 2
. loader -> celery.loaders.djangoapp
. logfile -> [stderr]@WARNING
. events -> OFF
. beat -> OFF

Celery has started.

I created a user of "celery" because I wasn't feeling very inventive in this case.

When I try to do one of the simple examples within the celery docs:

>>> from tasks import add
>>> r = add.delay(2, 2)
>>> r
<AsyncResult: 16235ea3-c7d6-4cce-9387-5c6285312c7c>
>>> r.ready()
(hangs for eternity.)

So I checked the FAQ wondering what else could be up and it told me this is a common bug due to user permissions, so I triple checked those, nothing, made another new user, still nothing. If I import DjangoBrokerConnection from carrot.connection and get the information, it matches up with what's in my celery settings. The FAQ stated to check your log file.

My rabbit.log file isn't very helpful in this situation, simply showing:

=INFO REPORT==== 26-Jan-2010::11:58:22 ===
accepted TCP connection on 0.0.0.0:5672 from 127.0.0.1:60572

=INFO REPORT==== 26-Jan-2010::11:58:22 ===
starting TCP connection <0.1120.0> from 127.0.0.1:60572

And so forth. At this point, I'm at a loss as to what else my problem could be. I'm running Ubuntu Jaunty and installed RabbitMQ from apt-get.

Thanks in advance for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

套路撩心 2024-08-26 09:37:46

我刚刚修复了一个非常丑陋的错误,该错误只会出现在导致此问题的新用户中。 (http://github.com/ask/celery/commit/a9c1316b15055b67ee3c38d294461fa82ed6d2b5)

请从 github 的 master 分支拉取。如果它仍然不起作用你
可能必须停止rabbitmq,删除rabbitmq数据库目录(通常是/var/lib/rabbitmq)并再次启动rabbitmq)

对于给您带来的不便,真的很抱歉。
发生该错误的原因是我们最近将消费者路由密钥选项的名称更改为“绑定密钥”,但 amqp 库仍然使用 routing_key 并且我们忘记重写该选项。

I just fixed a really ugly bug that would only show up for new users that would have caused this. (http://github.com/ask/celery/commit/a9c1316b15055b67ee3c38d294461fa82ed6d2b5)

Please pull from the master branch at github. If it still doesn't work you
probably have to stop rabbitmq, remove the rabbitmq database directory (usually /var/lib/rabbitmq) and start rabbitmq again)

Really sorry for the inconvenience.
The bug happened because we recently changed the name of the consumers routing key option to "binding key", but the amqp libraries still use routing_key and we forgot to rewrite the option.

情话墙 2024-08-26 09:37:46

对于任何偶然发现这一点的人:它似乎确实有助于删除 /var/lib/rabbitmq,即使更新 celery 后问题似乎消失了。在我这样做之前,我看到了很多不可靠和不可预测的情况。

For anyone stumbling upon this: it really does seem to help to remove your /var/lib/rabbitmq, even if the problem seems to go away with updating celery. I was seeing lots of unreliability and unpredictability until I did so.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文