0
votes

On airflow 2.1.3, looking at the documentation for the CLI, airflow celery -h
it shows:

-H CELERY_HOSTNAME, --celery-hostname CELERY_HOSTNAME
                        Set the hostname of celery worker if you have multiple workers on a single machine

I am familiar with Celery and I know you can run multiple workers on the same machine. But with Airflow (and the celery executor) I don't understand how to do so.

if you do, on the same machine:

> airflow celery worker -H 'foo'
> airflow celery worker -H 'bar'

The second command will fail, complaining about the pid, so then:

> airflow celery worker -H 'bar' --pid some-other-pid-file

This will run another worker and it will sync with the first worker BUT you will get a port binding error since airflow binds the worker process to http://0.0.0.0:8793/ no matter what (unless I missed a parameter?).

It seems you are not suppose to run multiple workers per machines... Then my question is, what is the '-H' (--celery-hostname) option for? How would I use it?