Backend Language/Ubuntu

[Ubuntu] ubuntu 20.04 Springboot + AWS RDS[Mysql] ๋ฐฐํฌ ์‹œ ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜ com.mysql.cj.jdbc.exceptions.communicationsexception: communications link failure the last packet sent successfully to the server was 0 milliseconds ago. the driv er has no..

chaerlo127 2022. 8. 24. 20:44
728x90
com.mysql.cj.jdbc.exceptions.communicationsexception: communications link failure the last packet sent successfully to the server was 0 milliseconds ago. the driv er has not received any packets from the server.

์•ฑ ๋Ÿฐ์นญ์„ ์œ„ํ•ด ์„œ๋ฒ„๋ฅผ ๋ฐฐํฌํ•˜๋˜ ์™€์ค‘ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. Mysql์„ ์„ค์น˜ํ•˜์ง€ ์•Š๊ณ ์„œ๋„, ์ €๋ฒˆ์— ๋ฐฐํฌ๋ฅผ ์„ฑ๊ณตํ–ˆ์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ด์œ ๋ฅผ ์•Œ์ง€ ๋ชปํ•˜์˜€๋‹ค.

Mysql์„ ๋‹ค์šด ๋ฐ›์•„๋ณด๊ณ , mysql์„ ๋‹ค์šด๋ฐ›์œผ๋‹ˆ localhost์— ์ ‘๊ทผ์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค๋Š” ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ์ง€๋‚œ ๋ฐฐํฌ ๋•Œ์—๋Š” ๋”ฐ๋กœ mysql์„ ๋‹ค์šด ๋ฐ›์ง€ ์•Š๊ณ ๋„, ์œ„์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์— ubuntu ๋‚ด์˜ mysql์„ ๋‹ค์šด ๋ฐ›์ง€ ์•Š์•„ ๋ฐœ์ƒํ•œ ์—๋Ÿฌ๋Š” ์•„๋‹ˆ๋ผ๊ณ  ์ƒ๊ฐํ–ˆ๋‹ค 

 

์—๋Ÿฌ ํ•ด๊ฒฐ๋ถ€ํ„ฐ ๋งํ•˜์ž๋ฉด, rds ๋‚ด๋ถ€ ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™ ๋‚ด์— ์‚ฌ์šฉ์ค‘์ธ ์ธ์Šคํ„ด์Šค private ip ์ฃผ์†Œ๋ฅผ ์—ฐ๊ฒฐํ•˜์ง€ ์•Š์•„ ๋ฐœ์ƒํ•œ ์˜ค๋ฅ˜์˜€๋‹ค. 

728x90

rds ->  VPN ๋ณด์•ˆ๊ทธ๋ฃน -> ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™ -> ์ธ๋ฐ”์šด๋“œ ๊ทœ์น™ ํŽธ์ง‘ 

IP์— ์ธ์Šคํ„ด์Šค private ip ์ฃผ์†Œ ์—ฐ๊ฒฐ!!


https://hello-gg.tistory.com/63

์œ„ ๋ธ”๋กœ๊ทธ์—์„œ ํ•ด๊ฒฐ์ฑ…์„ ์–ป์—ˆ๋‹ค.

 

ํ•˜์ง€๋งŒ, ์ง€๋‚œ ๋ฐฐํฌ์—์„œ๋Š” ์œ„ ๊ทœ์น™์„ ์ถ”๊ฐ€ํ•˜์ง€ ์•Š๊ณ ์„œ๋„ ์ •์ƒ์ ์œผ๋กœ spring boot์˜ ๋ฐฐํฌ๋ฅผ ์„ฑ๊ณตํ–ˆ์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ์™„๋ฒฝํ•œ ๋‹ต์„ ์ฐพ์ง€ ๋ชปํ•œ ๊ฒƒ์ด ์•„์‰ฝ๋‹ค. 

 

๋˜ํ•œ, ๋ฐฐํฌ ์ž๋™ํ™”๋ฅผ ํ•˜์ง€ ๋ชปํ•ด ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ๋ฅผ ๊ป๋‹ค๊ฐ€ ๋‹ค์‹œ ํ‚ค๋ฉด์„œ ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜๋“ค์ด ๋งŽ์•„ ์–ผ๋ฅธ docker๋‚˜ gitlab, github action ๋“ฑ์„ ๋ฐฐ์›Œ์„œ cicd์— ๋Œ€ํ•ด ๊ณต๋ถ€ํ•ด๋ณด๊ณ ์ž ํ•œ๋‹ค. 

728x90