我已经在Celery设置中设置了心跳:
BROKER_HEARTBEAT = 10
我也在RabbitMQ配置中设置了这个配置值:
'heartbeat' => '10',
但是不知何故,心跳仍然被禁用:
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.
你有什么想法我做错了什么吗?
更新:
现在我得到:
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.
我有三台服务器:
- RabbitMQ代理
- RESTful API服务器
- 远程工作服务器
看起来,远程化的Celery工作者可以正确地发送心跳。但是使用Celery远程处理任务的RESTful API服务器由于某种原因没有使用心跳。