본문 바로가기
OS/Linux

[Linux] PostgreSQL & Airflow 연동간 발생한 문제

by Yoon_estar 2025. 2. 20.
728x90

🚀 개요

PostgreSQL 과 Airflow 연동을 하는데 데이터 베이스를 PostgreSQL이 아닌 SQLite와 연동되는 오류가 발생하였다. 

웹페이지 접속시 이러한 문구가 웹 페이지 상단에 올라온다. Do not use SQLite as metadata DB in production – it should only be used for dev/testing. We recommend using Postgres or MySQL. Click here for more information. 


🚧참고할 이전 Posting

2025.02.04 - [OS/Linux] - [Linux] PostgreSQL, Airflow 및 OS 계정 연동

2025.02.04 - [OS/Linux] - [Linux] Airflow 2.7.3 & PostgreSQL 13.18 설치 및 설정 매뉴얼 (Python 3.10.14 환경)

 

🖥️Troubleshooting

1️⃣기존 프로세스 삭제

# pkill -f "airflow webserver"
# pkill -f "airflow scheduler"

2️⃣기존 설정 초기화

# rm -rf ~/airflow
# mkdir -p ~/airflow/dags ~/airflow/logs ~/airflow/plugins

3️⃣Airflow 데이터 베이스 초기화

# airflow db init

4️⃣Airflow 관리자 계정 생성

# airflow users create \
    --username estar987 \
    --password root/// \
    --firstname Admin \
    --lastname User \
    --role Admin \
    --email estar987@example.com

5️⃣ Airflow 웹 서버 및 스케줄러 실행

# airflow webserver --port 8765 &
# airflow scheduler --port &

 

6️⃣Airflow 웹 페이지 로그인

7️⃣Airflow 웹 페이지 확인(SQLite 문구 삭제 확인)