๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • ๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป ๐ŸŒฎ ๐Ÿ’ฌ
๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ’ป/airflow

[Airflow] The scheduler does not appear to be running. Last heartbeat was received 7 hours ago.The DAGs list may not update, and new tasks will not be scheduled.

by ๋ฐ”์ฟ„๋ฆฌ 2024. 3. 8.

 

์ž˜ ์šด์˜๋˜๋˜ Airflow๊ฐ€ ๊ฐ‘์ž๊ธฐ ๋ฉˆ์ถ˜๊ฒƒ ๊ฐ™๋‹ค๋Š” ์–˜๊ธฐ๋ฅผ ๋“ฃ๊ณ  ๋ดค๋”๋‹ˆ

 

์—ฅ ~ ?? ๋‚ด DAG ๋“ค ๋‹ค ์˜ค๋””๊ฐ ?

The scheduler does not appear to be running. Last heartbeat was received 7 hours ago.

The DAGs list may not update, and new tasks will not be scheduled.

 

>> ํ•ด์„

์Šค์ผ€์ค„๋Ÿฌ๊ฐ€ ์‹คํ–‰ ์ค‘์ด ์•„๋‹Œ ๊ฒƒ ๊ฐ™์Œ. ๋งˆ์ง€๋ง‰์€ 7์‹œ๊ฐ„ ์ „์— ์ˆ˜์‹ ๋˜์—ˆ์Œ.
DAG ๋ชฉ๋ก์ด ์—…๋ฐ์ดํŠธ๋˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์œผ๋ฉฐ ์ƒˆ ์ž‘์—…์ด ์˜ˆ์•ฝ๋˜์ง€ ์•Š์Œ.

 

Airflow ๊ธฐ๋Šฅ ์ค‘์— health ํ™•์ธํ•  ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ์–ด์„œ ํ•œ๋ฒˆ ์‚ฌ์šฉํ•ด๋ณด์•˜๋‹น

<airflow server>/health

 

health ํ•œ์ง€ unhealthy ํ•œ์ง€ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

 

์ง„์งœ ์ด์œ ๋Š” memory ๋ถ€์กฑ !!

scheduler ์— ์Œ“์ธ logs๋ฅผ ์ •๋ฆฌํ•˜๋ ค ํ•œ๋‹ค.

 

๋‚˜์ค‘์— ๋˜ ์Œ“์—ฌ์„œ ์˜ค๋Š˜๊ณผ ๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธฐ๋ฉด ์•ˆ๋˜๋‹ˆ

์ฃผ๊ธฐ์ ์œผ๋กœ log๋ฅผ ์ •๋ฆฌํ•˜๋„๋ก ๋งŒ๋“ค์–ด์ฃผ๋ ค๊ณ  ํ•œ๋‹ค.

 

#!/bin/bash

find /home/ubuntu/<path>/airflow/logs/scheduler/ -mtime +14 -exec rm -rf {} \;

 

์ด๊ณผ ๊ฐ™์€ shell script๋ฅผ ๋งŒ๋“ค๊ณ 

0 0 * * * /home/ubuntu/<path>/remove_log.sh

 

์ด๊ณผ ๊ฐ™์€ cron๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ์—ˆ๋‹ค

์ฃผ๊ธฐ์ ์œผ๋กœ ์ž˜ ์‚ญ์ œํ•ด์ฃผ๋ ด

 

๊ทธ๋ฆฌ๊ณ  ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” image, container๋ฅผ ์‚ญ์ œํ•ด์ค€๋‹ค.

docker system prune -a

 

docker volumn๋„ ์ •๋ฆฌํ•ด์ค€๋‹ค.

docker volume prune

 

๋””์Šคํฌ ์šฉ๋Ÿ‰ ํ™•์ธํ•ด์ค€๋‹ค.

docker system df

 

์ •๋ฆฌํ•ด์ค€ docker ์žฌ์‹คํ–‰ํ•ด์ฃผ์ž

์•„๋ž˜ ๋ช…๋ น์–ด๋“ค์„ ์ˆœ์„œ๋Œ€๋กœ ์‹คํ–‰ํ•ด์ค€๋‹ค.

docker compose down
docker compose up airflow-init
docker compose up -d

 

์—‡ ? ์™œ ์•ˆ๋œจ์ง€ ??????????? ํ•˜๊ณ  ๋ดค๋Š”๋ฐ

๋‚ด ์ธ๋‚ด์‹ฌ์˜ ๋ฌธ์ œ์˜€๋‹ค

์˜ฌ๋ฆฌ๋Š”๋ฐ ์ž ๊น์˜ ์‹œ๊ฐ„์ด ์†Œ์š”๋˜์—ˆ์„ ๋ฟ

์ •์ƒํ™” ์™„๋ฃŒ