我是Apache Airflow的新手,有人能提供在windows环境(包括Docker(上安装和运行Apache Airflow Dev 2.0的步骤吗;在那里,我发现了很多关于安装Apache Airflow 1.10.x…的好文章
我一直在使用Docker(WSL2(在Windows 10上本地玩Airflow 2.0(使用官方Docker镜像apache/Airflow:master(和Celery Executitor。
请注意,在Airflow 2.0中,您必须使用RBAC UI,这意味着在初始化DB后,您必须为自己创建一个用户,当您跳到容器中时,可以通过Airflow CLI进行创建:
airflow users create -r Admin -u admin -e admin@example.com -f admin -l user -p admin
这是我正在使用的docker-compose.yml文件,或者在我的GitHub:上查看完整的示例
version: "3.7"
x-apache-airflow-base: &apache-airflow-base
image: apache/airflow:master
environment:
AIRFLOW__CORE__EXECUTOR: CeleryExecutor
AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres:5432/airflow
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres:5432/airflow
AIRFLOW__CORE__FERNET_KEY: FB0o_zt4e3Ziq3LdUUO7F2Z95cvFFx16hU8jTeR1ASM=
AIRFLOW__CORE__LOAD_EXAMPLES: "True"
volumes:
- ./dags:/opt/airflow/dags
depends_on:
- postgres
- redis
services:
postgres:
image: postgres:11.5
environment:
POSTGRES_DB: airflow
POSTGRES_USER: airflow
POSTGRES_PASSWORD: airflow
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- /var/lib/postgresql/data/pgdata
redis:
image: redis:5
environment:
REDIS_HOST: redis
REDIS_PORT: 6379
webserver:
<<: *apache-airflow-base
command: webserver
ports:
- 8080:8080
flower:
<<: *apache-airflow-base
command: celery flower
ports:
- 5555:5555
scheduler:
<<: *apache-airflow-base
command: scheduler
worker:
<<: *apache-airflow-base
command: celery worker