Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flower doesn't display all workers for celery

I am running celery on two servers with one redis as a broker.

Celery start command looks like following:

celery multi start 2 -A app_name

Flower start command:

celery flower -A app_name --address=10.41.31.210 --port=5555

In flower's output there are some warnings:

WARNING:flower.api.control:'stats' inspect method failed
WARNING:flower.api.control:'active_queues' inspect method failed
WARNING:flower.api.control:'registered' inspect method failed
WARNING:flower.api.control:'scheduled' inspect method failed
WARNING:flower.api.control:'active' inspect method failed
WARNING:flower.api.control:'reserved' inspect method failed
WARNING:flower.api.control:'revoked' inspect method failed
WARNING:flower.api.control:'conf' inspect method failed

And the most strange thing for me - not all workers are displayed in Flower's dashboard. Seems that after every flower restart only some workers are displayed. Due to my start scripts - there should be at least 8 workers, but I see 4 or sometimes 6.

Looking for any solution or advice. Thank you.

P.s I don't have any problems with the same services when there is only one server used for celery workers.

like image 493
Samriang Avatar asked Aug 23 '16 17:08

Samriang


People also ask

What is MHER flower?

branch=master :target: https://travis-ci.org/mher/flower. Flower is a web based tool for monitoring and administrating Celery clusters.


2 Answers

Problem here that, flower starts before celery is ready

This could be easily checked with celery inspect ping

Here is example from my project start_flower.sh

#!/bin/sh

until timeout -t 10 celery -A project inspect ping; do
    >&2 echo "Celery workers not available"
done

echo 'Starting flower'
celery -A project flower
like image 76
Sardorbek Imomaliev Avatar answered Sep 18 '22 04:09

Sardorbek Imomaliev


Try it :

shell > celery -A app_name worker -l info

another shell > celery -A djangocelery flower

it works....

like image 27
hassanzadeh.sd Avatar answered Sep 17 '22 04:09

hassanzadeh.sd