我在 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 台服务器:
看来远程被妖魔化的 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.
这篇关于芹菜心跳不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何在 Python 中将货币字符串转换为浮点数?How do I convert a currency string to a floating point number in Python?(如何在 Python 中将货币字符串转换为浮点数?)
在 Pandas 中解析多索引 Excel 文件Parsing a Multi-Index Excel File in Pandas(在 Pandas 中解析多索引 Excel 文件)
pandas 时间序列 between_datetime 函数?pandas timeseries between_datetime function?( pandas 时间序列 between_datetime 函数?)
pandas 重新采样到每月的特定工作日pandas resample to specific weekday in month( pandas 重新采样到每月的特定工作日)
Python - 如何标准化时间序列数据Python - how to normalize time-series data(Python - 如何标准化时间序列数据)
statsmodels 使用 ARMA 模型进行预测statsmodels forecasting using ARMA model(statsmodels 使用 ARMA 模型进行预测)