我想用docker和rabbitMQ來建立我的氣流。我正在使用rabbitmq:3管理映像。我可以訪問rabbitMQ UI和API。消費者:無法連接到amqp://用戶:** @ localhost:5672 //:[Errno 111]連接被拒絕
在氣流中我建立氣流webserver,氣流調度程序,氣流工作者和氣流花。 Airflow.cfg文件用於配置氣流。
當我使用broker_url = amqp://user:[email protected]:5672/
和celery_result_backend = amqp://user:[email protected]:5672/
我的碼頭工人撰寫文件如下
version: '3'
services:
rabbit1:
image: "rabbitmq:3-management"
hostname: "rabbit1"
environment:
RABBITMQ_ERLANG_COOKIE: "SWQOKODSQALRPCLNMEQG"
RABBITMQ_DEFAULT_USER: "user"
RABBITMQ_DEFAULT_PASS: "password"
RABBITMQ_DEFAULT_VHOST: "/"
ports:
- "5672:5672"
- "15672:15672"
labels:
NAME: "rabbitmq1"
webserver:
build: "airflow/"
hostname: "webserver"
restart: always
environment:
- EXECUTOR=Celery
ports:
- "8080:8080"
depends_on:
- rabbit1
command: webserver
scheduler:
build: "airflow/"
hostname: "scheduler"
restart: always
environment:
- EXECUTOR=Celery
depends_on:
- webserver
- flower
- worker
command: scheduler
worker:
build: "airflow/"
hostname: "worker"
restart: always
depends_on:
- webserver
environment:
- EXECUTOR=Celery
command: worker
flower:
build: "airflow/"
hostname: "flower"
restart: always
environment:
- EXECUTOR=Celery
ports:
- "5555:5555"
depends_on:
- rabbit1
- webserver
- worker
command: flower
我能夠建立使用泊塢窗景。但是,我無法將我的氣流調度程序連接到rabbitMQ。我得到以下錯誤:
consumer: Cannot connect to amqp://user:**@localhost:5672//: [Errno 111] Connection refused.
我試過使用127.0.0.1和localhost都。
我做錯了什麼?