๊ฐ์
Docker๋ก Airflow๋ฅผ ๋์ด ec2 instance๊ฐ ํ,๋๋ฌ์ ํ๋ฒ์ฉ ssh ์ ๊ทผ์ด ๋ถ๊ฐ๋ฅํ ์ํ๊ฐ ๋ฐ๋ณต๋์๋ค.
AWS ec2 instance ์ํ๋ running ์ํ์ธ๋ฐ airflow๊ฐ ๋ด๋ ค๊ฐ์๊ณ ssh ์ ๊ทผ์ด ์๋๋ ๊ฒ
์ด ์๋ฒ๊ฐ ๋ฌด๊ฒ๊ฒ ๋์๊ฐ๊ณ ์์ด์, cpu ๋ฌธ์ ์ด๊ฑฐ๋ memory ๋ฌธ์ ๋ผ๊ณ ํ๋จํ์ฌ์
์ฃผ๊ธฐ์ ์ผ๋ก memory ์ฌ์ฉ๋๋ log๋ก ๊ธฐ๋กํ๊ณ , ec2 instance monitoring์ผ๋ก CPU ์ฌ์ฉ๋ฅ ์ ํ์ธํด๋ ๋๋ ทํ ์์ธ์ ์ฐพ์ง ๋ชปํ๋ค.
ํ์ธ
airflow๊ฐ ๋ด๋ ค๊ฐ ์์ ์ log๋ฅผ ํ๋ํ๋ ์ฐพ์๋ณด๋
[ERR] Connection could not be made due to the following error:
(pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on '...' ([Errno -3] Temporary failure in name resolution)")
(Background on this error at: https://sqlalche.me/e/20/e3q8)
์ด? Database ์ฐ๊ฒฐ์ด ์๋์๋ค.
์ฌ๊ธฐ์ ์ด์ฌ๋์ด ๋ฐ๋ก file descriptor ๋ถ์กฑํ๊ฑฐ ์๋๋๊ณ ๋ง์ํ์ จ๋ค.
file descriptor๋ฅผ ๋ชจ๋ ์ฌ์ฉํด๋ฒ๋ ค์ ssh ์ ์๋ ์๋์๊ณ , database ์ฐ๊ฒฐ๋ ์๋์๋ ๊ฒ์ด๋ค.
์งํ
file descriptor ๊ฐ์ ๋๋ ธ๋ค
vi /etc/security/limits.conf
* hard nofile 65535
* soft nofile 65535
root hard nofile 65535
root soft nofile 65535
default 1024๋ก ๋์ด์๋ ๊ฐ์ 65535๋ก ์์ ํ๋ค.
$ ulimit -Sn
65535
$ ulimit -Hn
65535
์ฆ๊ฐ๋ ๊ฐ ํ์ธํ๊ณ instance reboot ํด์ฃผ์๋ค.
๊ทธ ํ
๋ฌด๊ฒ๊ฒ ๋์๊ฐ๋ ์์ ์ ํ์ผ ์๋ฅผ ํ์ธํด๋ณด์๋ค
$ cat /proc/sys/fs/file-nr
15744 0 9223372036854775807
์ต๋ ํ์ผ ์ 9223372036854775807 ์์ 15744๊ฐ ์คํ๋์๋ค.
์์ฃผ ์ฌ์ ์๋ค.
๊ณ์ ๋ชจ๋ํฐ๋ง ํด๋ณด์
'๐ฉ๐ปโ๐ป > aws' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[AWS] lambda function ์ผ๋ก ec2 instance rebootํ๊ธฐ (1) | 2024.10.29 |
---|---|
[AWS] SNS Topics์ ๋ฑ๋กํ Pending confirmation ์ํ์ Subscription ์ญ์ (0) | 2024.08.07 |
[AWS] EC2 Instance์ Alarms ์ถ๊ฐํ๊ธฐ (0) | 2024.08.06 |