IkarosKun
IkarosKun

Reputation: 463

how to run celery flower with config file?

For my project. I want to use flower config file to instead of use command line options.

But I write a file named flowerconfig.py, like follows:

# RabbitMQ management
broker_api = 'http://user:passwd@localhost:15672/api/'

# Enable debug logging
logging = 'DEBUG'

# view address
address = '0.0.0.0'
port = 10006

basic_auth = ["user:passwd"]

persistent = True
db = "var/flower_db"

But when I run flower with the command flower --conf=flowerconfig. I found this broker not work.

I replace the command with celery flower -A celery_worker.celery_app --conf=flowerconfig. celery_worker is my celery file.

the broker is running normally. but still the flowerconfig basic auth not work.

So I don't know if flower support file config. or other methods.

the versions:

Upvotes: 2

Views: 3337

Answers (1)

DennisLi
DennisLi

Reputation: 4156

You can create a bash script to run. For example:

#!/bin/bash
celery -A project flower \
    --basic_auth=monitor:password \
    --persistent=True \
    --max_tasks=9999 \
    -l info \
    --address=0.0.0.0 \
    --broker=redis://localhost:6379/0

Upvotes: 2

Related Questions