Flower doesn't display all workers for celery
Asked Answered
D

2

12

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.

Distrust answered 23/8, 2016 at 17:56 Comment(2)
did you found solution?Larousse
@PankajJackson checkout my answerCanonicate
C
10

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
Canonicate answered 7/2, 2019 at 9:26 Comment(4)
timeout -t 10 didn't seem to work as expected so I replace it with timeout 10s and that seemed to work better.Nejd
@Nejd what operating system you are using?Canonicate
I'm using docker image python:3.6-slim which I believe is from debianNejd
I got timeout: invalid option -- 't' on docker image python:3.8. until timeout 10s celery -A project inspect ping; do works betterHypsography
H
2

Try it :

shell > celery -A app_name worker -l info

another shell > celery -A djangocelery flower

it works....

Helbona answered 25/7, 2019 at 10:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.