如何获取监听Celery中特定Que的主机列表?

时间:2017-07-07 13:46:23

标签: python django celery celeryd

在我的项目中,我有两个问题。我想知道所有听到阙的工人的名单。 (这需要一种pythonic方式.Celery在不同的机器上运行,我想在其他机器上运行详细信息。)

1 个答案:

答案 0 :(得分:1)

如果你使用rabbitmq作为经纪人,你可以这样做:

sudo rabbitmqctl list_consumers

检查特定队列:

lpiner@host:~$ sudo rabbitmqctl list_consumers -p production |  grep queue1
queue1 <rabbit@host1-rabbitmq.2.15149.130>     None5   true    0       []
queue1 <rabbit@host1-rabbitmq.2.15256.130>     None4   true    0       []
queue1 <rabbit@host1-rabbitmq.2.21562.130>     None4   true    0       []
queue1 <rabbit@host1-rabbitmq.2.21644.130>     None4   true    0       []
queue1 <rabbit@host1-rabbitmq.2.6500.135>      None5   true    0       []
queue1 <rabbit@host2-rabbitmq.2.4028.137>      None10  true    0       []
queue1 <rabbit@host2-rabbitmq.2.4083.137>      None10  true    0       []
queue1 <rabbit@host2-rabbitmq.2.4463.137>      None9   true    0       []
queue1 <rabbit@host2-rabbitmq.2.4497.137>      None10  true    0       []
queue1 <rabbit@host2-rabbitmq.2.6508.137>      None5   true    0       []

你也可以使用非常酷的芹菜花UI。 https://flower.readthedocs.io/en/latest/