필요 서비스
redis
Worker Node가 실행할 작업을 인메모리로 가져오는 Dictionary(key-value) 구조의 DBMS
- 비밀번호를 redispass로 설정
postgres
Airflow의 메타데이터 DMBS
- 데이터를 유지하고 싶다면 volumn과 관련된 코드를 environment를 추가해주어야 함
- PGDATA : container 내부에서 데이터를 저장하는 디렉터리
- ./mnt/postgres : 현재 폴더(.)의 mnt/postgres 디렉토리와 PGDATA를 바인드 마운트하여 로컬 파일시스템에 저장 될 수 있도록 저장
- PGDATA=/var/lib/postgresql/data/pgdata
- ./mnt/postgres:/var/lib/postgresql/data/pgdata
webserver
Airflow 웹서버 프로세스
- python 이미지를 가져와 환경설정 및 airflow 패키지 설치 등을 하는 dockerfile을 build
- executor : Celery
- fernet_key : airflow의 연결을 암호화하는 데 사용되는 key
- ./mnt/airflow/dags : 현재 경로(.)의 dag 폴더를 바인드 마운트
flower
Celery 작업을 모니터링 하는 Airflow 프로세스
- flower는 airflow와 통합되어 있어 "airflow celery flower" 명령으로 시작 할 수 있
scheduler
Airflow 스케줄링 프로세스. celery에서는 webserver와 scheduler 프로세스는 두 개의 별도의 컨테이너(서버)에서 실행
- webserver와 scheduler 서버가 같은 dag 폴더와 config 파일을 바라보게 해야 하는 것이 중요!
Worker
Celery가 처리한 작업을 실행할 작업자 프로세스. redis안의 대기열에서 가져온 작업을 실행
'Data Engineering > Airflow' 카테고리의 다른 글
[Airflow] Local Executor (0) | 2023.07.02 |
---|---|
[Airflow] PostgresOperator (0) | 2023.07.01 |
[Airflow] SubDAG로 반복 패턴 최소화하기 (0) | 2023.06.26 |