Celery Heartbeat Not Working(芹菜心跳不工作)
问题描述
我在 Celery 设置中设置了心跳:
I have set heartbeat in Celery settings:
BROKER_HEARTBEAT = 10
我也在 RabbitMQ config 中设置了这个配置值:
I have also set this configuration value in RabbitMQ config:
'heartbeat' => '10',
但不知何故心跳仍然被禁用:
But somehow heartbeats are still disabled:
ubuntu@sync1:~$ sudo rabbitmqctl list_connections name timeout
Listing connections ...
some_address:37781 -> other_address:5672 0
some_address:37782 -> other_address:5672 0
...done.
任何想法我做错了什么?
Any ideas what am I doing wrong?
更新:
所以现在我明白了:
ubuntu@sync1:/etc/puppet$ sudo rabbitmqctl list_connections name timeout
Listing connections ...
some_address:41281 -> other_address:5672 10
some_address:41282 -> other_address:5672 10
some_address:41562 -> other_address:5672 0
some_address:41563 -> other_address:5672 0
some_address:41564 -> other_address:5672 0
some_address:41565 -> other_address:5672 0
some_address:41566 -> other_address:5672 0
some_address:41567 -> other_address:5672 0
some_address:41568 -> other_address:5672 0
...done.
我有 3 台服务器:
- RabbitMQ 代理
- RESTful API 服务器
- 远程工作服务器
看来远程被妖魔化的 Celery 工人正确地发送了心跳.使用 Celery 远程处理任务的 RESTful API 服务器由于某种原因没有使用心跳.
It appears the remote demonised Celery workers send heartbeats correctly. The RESTful API server using Celery to remotely process tasks is not using heartbeat for some reason.
推荐答案
celery worker的心跳是应用层的心跳,不是AMQP协议的心跳.每个工作人员定期向 BROKER 中的celeryev"事件交换发送心跳事件消息.心跳事件被转发回worker,这样worker就可以知道BROKER的健康状态.如果丢失心跳的次数超过阈值,worker 可以对 BROKER 执行一些重新连接操作.
the heartbeat of celery worker is application level heartbeat, not AMQP protocol's heartbeat. Each worker periodically send heartbeat event message to "celeryev" event exchange in BROKER. The heartbeat event is forwarded back to worker such worker can know the health status of BROKER. If number of loss heartbeat exceeding a threshold, the worker can do some reconnect action to BROKER.
有关其他详细信息,您可以查看此 页面BROKER_FAILOVER_STRATEGY 部分描述了从 BROKER 中删除可以执行的操作.
For the rest of detail, you may check this page The section: BROKER_FAILOVER_STRATEGY describes the actions you may do for dropping from a BROKER.
这篇关于芹菜心跳不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:芹菜心跳不工作


- 沿轴计算直方图 2022-01-01
- padding='same' 转换为 PyTorch padding=# 2022-01-01
- pytorch 中的自适应池是如何工作的? 2022-07-12
- python-m http.server 443--使用SSL? 2022-01-01
- 如何将一个类的函数分成多个文件? 2022-01-01
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01