728x90
๋ฐ˜์‘ํ˜•

์ „์ฒด ๊ธ€ 105

[์ธํ”„๋ผ ๊ตฌ์ถ•] Docker๋กœ MySQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๊ตฌ์ถ•ํ•˜๊ธฐ

Docker์— MySQL ์ปจํ…Œ์ด๋„ˆ ๋„์šฐ๊ธฐ1. Lightsail์—์„œ MySQL์„ ์—ฐ๊ฒฐํ•  ์„œ๋ฒ„ ํฌํŠธ ์—ด๊ธฐ 2. Docker Hub์—์„œ MySQL Image ๋‹ค์šด๋ฐ›๊ธฐhttps://hub.docker.com/_/mysql mysql - Official Image | Docker HubQuick reference Supported tags and respective Dockerfile links 8.4.0, 8.4, 8, lts, latest, innovation, 8.4.0-oraclelinux9, 8.4-oraclelinux9, 8-oraclelinux9, lts-oraclelinux9, oraclelinux9, innovation-oraclelinux9, 8.4.0-oracle, 8.4-oracle, 8-o..

[์ธํ”„๋ผ ๊ตฌ์ถ•] ํ˜„์žฌ ์‚ฌ์šฉ์ž์—๊ฒŒ Docker ์ ‘๊ทผ ๊ถŒํ•œ ๋ถ€์—ฌํ•˜๊ธฐ

ํ˜„์žฌ ์‚ฌ์šฉ์ž์—๊ฒŒ ๋„์ปค ์ ‘๊ทผ ๊ถŒํ•œ ์ฃผ๊ธฐ1. ํ˜„์žฌ ์‚ฌ์šฉ์ž Docker ๊ทธ๋ฃน์— ์ถ”๊ฐ€ํ•˜๊ธฐํ˜„์žฌ ์‚ฌ์šฉ์ž๋ฅผ Docker ๊ทธ๋ฃน์— ์ถ”๊ฐ€ํ•˜์—ฌ Docker ์†Œ์ผ“์— ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ๋Š” ๊ถŒํ•œ์„ ๋ถ€์—ฌํ•œ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด sudo๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ ๋„ Docker ๋ช…๋ น์„ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค.sudo usermod -aG docker $USER ์ด ๋ช…๋ น์–ด๋Š” ํ˜„์žฌ ๋กœ๊ทธ์ธํ•œ ์‚ฌ์šฉ์ž๋ฅผ docker ๊ทธ๋ฃน์— ์ถ”๊ฐ€ํ•œ๋‹ค.$USER๋Š” ํ˜„์žฌ ๋กœ๊ทธ์ธํ•œ ์‚ฌ์šฉ์ž๋ฅผ ๊ฐ€๋ฆฌํ‚จ๋‹ค.docker ๊ทธ๋ฃน์€ Docker ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ๊ถŒํ•œ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค.์‚ฌ์šฉ๋œ ์˜ต์…˜ ์˜๋ฏธ ๋ณด๊ธฐ๋”๋ณด๊ธฐsudo : ๋ฆฌ๋ˆ…์Šค๋‚˜ ๋งฅ OS์—์„œ ๊ด€๋ฆฌ์ž ๊ถŒํ•œ์œผ๋กœ ์‹คํ–‰ํ•  ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ๋ช…๋ น์–ดusermod : ์‚ฌ์šฉ์ž ๊ณ„์ •์„ ์ˆ˜์ •ํ•˜๋Š” ๋ช…๋ น์–ด-aG docker : ์‚ฌ์šฉ์ž๋ฅผ "docker" ๊ทธ๋ฃน์— ์ถ”๊ฐ€ํ•˜๋Š” ์˜ต์…˜$..

[์ธํ”„๋ผ ๊ตฌ์ถ•] Lightsail ์ธ์Šคํ„ด์Šค์— SSH๋กœ ์•ก์„ธ์Šค

MobaXterm์„ ํ™œ์šฉํ•˜์—ฌ Lightsail ์ธ์Šคํ„ด์Šค์— SSH๋กœ ์ ‘์†ํ•  ๊ฒƒ์ด๋‹ค. MobaXterm  ๋‹ค์šด๋กœ๋“œํ•˜๊ธฐMobaXterm์„ ๊ณต์‹ ํ™ˆํŽ˜์ด์ง€์—์„œ ๋‹ค์šด๋กœ๋“œํ•œ๋‹ค. https://mobaxterm.mobatek.net/download.html MobaXterm free Xserver and tabbed SSH client for WindowsThe ultimate toolbox for remote computing - includes X server, enhanced SSH client and much more!mobaxterm.mobatek.net Lightsail ๊ฐœ์ธํ‚ค ๋‹ค์šด๋กœ๋“œํ•˜๊ธฐ๊ฐœ์ธํ‚ค๋Š” AWS Lightsail > Instance > Connect ํ•˜๋‹จ์—์„œ ๋‹ค์šด๋กœ๋“œํ•  ์ˆ˜ ์žˆ๋‹ค. 1. Ubuntu-..

[์ธํ”„๋ผ ๊ตฌ์ถ•] Amazon Lightsail, Networking ์„ค์ •

๊ณ ์ • IP ์ฃผ์†Œ ์ƒ์„ฑํ•˜๊ธฐ์šฐ์„ .. ๋„คํŠธ์›Œํฌ ์„ค์ •๋ถ€ํ„ฐ ํ•˜์ž. ๊ณ ์ • IP ์ฃผ์†Œ๋ฅผ ์ƒ์„ฑํ•  ๊ฒƒ์ด๋‹ค.  1. Create static IP์„ ํด๋ฆญํ•œ๋‹ค. 2. ์ธ์Šคํ„ด์Šค ์—ฐ๊ฒฐ ์„ค์ •์„ ์ž‘์„ฑํ•œ๋‹ค.์ธ์Šคํ„ด์Šค๋ฅผ ์—ฐ๊ฒฐํ•˜๊ณ  ๊ณ ์ • IP ์ด๋ฆ„์„ ์ง€์–ด์ค€๋‹ค.์—ฐ๊ฒฐ๋œ ์ธ์Šคํ„ด์Šค๊ฐ€ ์žˆ๋‹ค๋ฉด ๊ณ ์ • IP ์—ฐ๊ฒฐ์€ ๋ฌด๋ฃŒ!! ์•ž์„œ ๋งŒ๋“  Ubuntu-Pomoro-Do ์ธ์Šคํ„ด์Šค๋ฅผ ์—ฐ๊ฒฐํ•ด ์ค€๋‹ค. ๊ณ ์ • IP ์ด๋ฆ„์€ StaticIp-Pomoro-Do ๋กœ ์ง€์–ด์ค€๋‹ค. 3. Create๋ฅผ ๋ˆ„๋ฅด๋ฉด ๊ณ ์ • IP ์ฃผ์†Œ์— ์—ฐ๊ฒฐ๋œ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ๋ฐฉํ™”๋ฒฝ ์„ค์ • (์‚ฌ์šฉ ํฌํŠธ ๋ฒˆํ˜ธ ์—ด๊ธฐ)์šฐ์„ , ๊ธฐ์กด ํฌํŠธ์— MySQL, HTTPS , SpringBoot ์„œ๋ฒ„ ํฌํŠธ๋ฅผ ์ถ”๊ฐ€๋กœ ์ƒ์„ฑํ•  ๊ฒƒ์ด๋‹ค.  1. Ubuntu-Pomoro-Do ์ธ์Šคํ„ด์Šค Manage๋ฅผ ํด๋ฆญํ•œ๋‹ค. 2. Ubuntu-Pom..

[์ธํ”„๋ผ ๊ตฌ์ถ•] Amazon Lightsail ์ธ์Šคํ„ด์Šค ์ƒ์„ฑํ•˜๊ธฐ

ํ† ์ดํ”„๋กœ์ ํŠธ์ธ ๋งŒํผ ๊ฐœ๋ฐœ ๋น„์šฉ์„ ์ตœ๋Œ€ํ•œ ์•„๋ผ๊ธฐ ์œ„ํ•ดAmazon Lightsail์˜ "์ฒ˜์Œ 3๊ฐœ์›”์€ ๋ฌด๋ฃŒ" ์ธ์Šคํ„ด์Šค ์ค‘ ์‚ฌ์–‘์ด ๊ฐ€์žฅ ๋†’์€ ๊ฒƒ์„ ์„ ํƒํ•  ๊ฒƒ์ด๋‹ค.Amazon Lightsail ์ธ์Šคํ„ด์Šค ์ƒ์„ฑํ•˜๊ธฐ  https://aws.amazon.com/ko/lightsail/?nc2=h_ql_prod_fs_ls ๊ฐ€์ƒ ํ”„๋ผ์ด๋น— ์„œ๋ฒ„ ๋ฐ ์›น ํ˜ธ์ŠคํŒ…–Amazon Lightsail—Amazon Web ServicesWordPress, Magento, Prestashop, Joomla์™€ ๊ฐ™์€ ์‚ฌ์ „ ๊ตฌ์„ฑ๋œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ํ†ตํ•ด ๋‹จ ๋ช‡ ๋ฒˆ์˜ ํด๋ฆญ์œผ๋กœ ๋ธ”๋กœ๊ทธ, ์ „์ž ์ƒ๊ฑฐ๋ž˜ ๋˜๋Š” ๊ฐœ์ธ ์›น ์‚ฌ์ดํŠธ๋ฅผ ๊ตฌ์ถ•ํ•ฉ๋‹ˆ๋‹ค.aws.amazon.com ์œ„์˜ ์‚ฌ์ดํŠธ์—์„œ Amazon Lightsail ์„ ์‹œ์ž‘ํ•œ๋‹ค.AWS์— ๋กœ๊ทธ์ธ์„ ํ•˜๊ณ  Lights..

[MSA ๊ตฌ์ถ•ํ•˜๊ธฐ] 9. API Gateway์™€ Eureka ์„œ๋ฒ„ ์—ฐ๋™ํ•˜๊ธฐ (API Gateway)

๐Ÿ”Š ์šฐ๋ฆฌ๋Š” Spring Cloud๋ฅผ ํ™œ์šฉํ•˜์—ฌ MSA๋ฅผ ๊ตฌ์ถ•ํ•œ๋‹ค. ๐Ÿ”Š ์ด๋ฒˆ์—๋Š”, API Gateway๋ฅผ Eureka ํด๋ผ์ด์–ธํŠธ๋กœ ๋“ฑ๋กํ•˜์—ฌ API Gateway์™€ Eureka ์„œ๋ฒ„๋ฅผ ์—ฐ๋™ํ•  ๊ฒƒ์ด๋‹ค. API Gateway์™€ Eureka ์„œ๋ฒ„ ์—ฐ๋™ ํ”„๋กœ์„ธ์Šค ํด๋ผ์ด์–ธํŠธ๊ฐ€ API Gateway์— ์š”์ฒญ์„ ํ•˜๋ฉด API Gateway ๊ฐ€ Eureka server์— ๋“ฑ๋ก๋œ ์„œ๋น„์Šค๋“ค์„ ์กฐํšŒํ•˜๊ณ  ํ•ด๋‹น ์„œ๋น„์Šค๋กœ ๋ผ์šฐํŒ…์„ ํ•ด์ค€๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ๋กœ๊ทธ์ธ์„ ํ•œ๋‹ค๋Š” ๊ฐ€์ƒ์˜ ์‹œ๋‚˜๋ฆฌ์˜ค์— ๋Œ€ํ•ด ์–ด๋–ป๊ฒŒ ๋™์ž‘ํ•˜๋Š”์ง€ ์‚ดํŽด๋ณด์ž. โ‘ : ๊ฐ ์ธ์Šคํ„ด์Šค๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ์œ ๋ ˆ์นด ์„œ๋ฒ„์— ๋“ฑ๋กํ•œ๋‹ค. ์ƒˆ๋กœ์šด ์ธ์Šคํ„ด์Šค๋Š” ์‹œ์ž‘ํ•  ๋•Œ ์œ ๋ ˆ์นด ์„œ๋ฒ„์— IP, ํ˜ธ์ŠคํŠธ ์ฃผ์†Œ, ํฌํŠธ ์ •๋ณด ๋“ฑ์„ ์ „๋‹ฌํ•œ๋‹ค. ์œ ๋ ˆ์นด ์„œ๋ฒ„๋Š” ๋“ฑ๋ก๋œ ์ธ์Šคํ„ด์Šค๋“ค์„ ์ฃผ๊ธฐ์ ์œผ๋กœ ์ƒํƒœ๋ฅผ ์ฒดํฌํ•˜๋ฉด์„œ ํ•ด๋‹น ์ธ์Šคํ„ด์Šค๋ฅผ..

[MSA] Spring Cloud Gateway Filter (API Gateway)

Spring Cloud Gateway๋ฅผ ์‚ฌ์šฉํ•œ ์š”์ฒญ/์‘๋‹ต ํ”„๋กœ์„ธ์Šค Spring Cloud Gateway๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค๋“ค๊ณผ ํด๋ผ์ด์–ธํŠธ๋‹จ์˜ ๋ผ์šฐํŒ… ์—ญํ• ์„ ํ•ด์ค€๋‹ค. ํด๋ผ์ด์–ธํŠธ๋Š” ์›ํ•˜๋Š” ์„œ๋น„์Šค๋ฅผ ํ˜ธ์ถœํ•˜๊ธฐ ์œ„ํ•ด Spring Cloud gateway๋กœ ์š”์ฒญ์„ ๋ณด๋‚ธ๋‹ค. Spring Cloud gateway์—์„œ๋Š” ์–ด๋–ค ์„œ๋น„์Šค๋กœ ๊ฐ€์•ผ ํ•˜๋Š”์ง€ ๋ถ„๊ธฐ์ฒ˜๋ฆฌ๋ฅผ ํ•ด์ค€๋‹ค. ์ด๋•Œ Filter ๊ธฐ๋Šฅ์„ ํ†ตํ•ด ์กฐ๊ฑด์„ ๋ถ„๊ธฐํ•œ๋‹ค. ์ ์„  ๋„ค๋ชจ ๋ฐ•์Šค๋Š” Spring Cloud gateway์•ˆ์—์„œ ์ผ์–ด๋‚˜๋Š” ์ผ์„ ํ™•๋Œ€ํ•œ ๊ฒƒ์ด๋‹ค. Spring Cloud Gateway Filter ๋ž€? Spring Cloud Gateway์˜ ํ•„ํ„ฐ๋Š” ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ์„ ๊ฐ€๋กœ์ฑ„๊ณ  ์ˆ˜์ •ํ•˜๊ฑฐ๋‚˜, ๋‹ค์–‘ํ•œ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜์—ฌ ๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค ์•„ํ‚คํ…์ฒ˜์—์„œ์˜ ๋ผ์šฐํŒ…, ๋ณด์•ˆ, ..

[MSA ๊ตฌ์ถ•ํ•˜๊ธฐ] 8. Spring Cloud Gateway์— ํ•„ํ„ฐ ์ ์šฉํ•˜๊ธฐ (API Gateway)

๐Ÿ”Š ์šฐ๋ฆฌ๋Š” Spring Cloud๋ฅผ ํ™œ์šฉํ•˜์—ฌ MSA๋ฅผ ๊ตฌ์ถ•ํ•œ๋‹ค. ๐Ÿ”Š ์ด๋ฒˆ์—๋Š”, Spring Cloud Gateway Routes์˜ Filters๋ฅผ ์„ค์ •ํ•  ๊ฒƒ์ด๋‹ค. API Gateway ํŒŒํŠธ 4 https://bu119.tistory.com/94 [MSA ๊ตฌ์ถ•ํ•˜๊ธฐ] 6. Spring Cloud Gateway ๋ผ์šฐํŒ… ์„ค์ •ํ•˜๊ธฐ (API Gateway) ๐Ÿ”Š ์šฐ๋ฆฌ๋Š” Spring Cloud๋ฅผ ํ™œ์šฉํ•˜์—ฌ MSA๋ฅผ ๊ตฌ์ถ•ํ•œ๋‹ค. ๐Ÿ”Š ์ด๋ฒˆ์—๋Š”, API Gateway์˜ ๋ผ์šฐํŒ…์„ ์„ค์ •ํ•  ๊ฒƒ์ด๋‹ค. API Gateway ํŒŒํŠธ 2 ๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค ์„œ๋ฒ„๋ฅผ 2๊ฐœ ์ด์ƒ ์ค€๋น„ํ•˜์ž. ๋ผ์šฐํŒ…์„ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์—๋Š” 3๊ฐ€ bu119.tistory.com Spring Cloud Gateway ๋ผ์šฐํŒ…์„ ์„ค์ •ํ–ˆ์ง€๋งŒ ์„œ๋ฒ„๋ฅผ ์‹คํ–‰ํ–ˆ์„ ๋•Œ ์ œ๋Œ€๋กœ ์—ฐ๊ฒฐ๋˜์ง€ ์•Š์•˜๋‹ค..

[MSA ๊ตฌ์ถ•ํ•˜๊ธฐ] 7. Spring Cloud Gateway๋ฅผ ํ™œ์šฉํ•œ ๊ฒฝ๋กœ ์ˆ˜์ • (API Gateway)

๐Ÿ”Š ์šฐ๋ฆฌ๋Š” Spring Cloud๋ฅผ ํ™œ์šฉํ•˜์—ฌ MSA๋ฅผ ๊ตฌ์ถ•ํ•œ๋‹ค. ๐Ÿ”Š ์•ž์„œ, API Gateway์˜ ๋ผ์šฐํŒ…์„ ์„ค์ •ํ–ˆ๋Š”๋ฐ ์‹คํ–‰ํ–ˆ์„ ๋•Œ ๊ฒฐ๊ณผ ๊ฐ’์ด ๋‹ค๋ฅด๊ฒŒ ๋‚˜ํƒ€๋‚ฌ๋‹ค. ๊ทธ ์ด์œ ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž. API Gateway ํŒŒํŠธ 3 ์šฐ์„ , ์ž‘์„ฑํ•œ ์ฝ”๋“œ๋ฅผ ์‚ดํŽด๋ณด์ž. 1. user-service์˜ UserController.java ํŒŒ์ผ // user-service: UserController.java (8081 ํฌํŠธ ์‚ฌ์šฉ) package com.caffeinedoctor.userservice.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestControll..

[MSA] API Gateway

์ตœ๊ทผ ๋งŽ์€ ์„œ๋น„์Šค๋“ค์ด ๋…๋ฆฝ์ ์ธ ๊ธฐ๋Šฅ์„ ์ˆ˜ํ–‰ํ•˜๋Š” ์ž‘์€ ๋‹จ์œ„์˜ ์„œ๋น„์Šค๋“ค๋กœ ๊ตฌ์„ฑ๋œ ๋งˆ์ดํฌ๋กœ ์„œ๋น„์Šค ์•„ํ‚คํ…์ฒ˜(Micro Service Architecture) ํ˜•ํƒœ๋กœ ๊ตฌ์ถ•๋˜๋ฉด์„œ ์„œ๋น„์Šค์˜ ๋ณต์žก๋„๋ฅผ ์ค„์ผ ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ๊ณ , ๋ณ€๊ฒฝ์— ๋”ฐ๋ฅธ ์˜ํ–ฅ์„ ์ตœ์†Œํ™”ํ•˜๋ฉด์„œ ๊ฐœ๋ฐœ๊ณผ ๋ฐฐํฌ๋ฅผ ํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ์žฅ์ ๋„ ์–ป๊ฒŒ ๋˜์—ˆ๋‹ค. ํ•˜์ง€๋งŒ ์—ฌ๊ธฐ์„œ ๋งํ•˜๋Š” ์ž‘์€ ๋‹จ์œ„์˜ ์„œ๋น„์Šค๊ฐ€ 50๊ฐœ, 100๊ฐœ๊ฐ€ ๋˜์—ˆ์„ ๋•Œ, ์ด ๋งŽ์€ ์„œ๋น„์Šค๋“ค์˜ ์—”๋“œํฌ์ธํŠธ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ ์žˆ์–ด์„œ ์–ด๋ ค์›€์ด ์ƒ๊ธฐ๊ณ , ๋˜ ๊ฐ๊ฐ์˜ ์„œ๋น„์Šค๋งˆ๋‹ค ๊ณตํ†ต์ ์œผ๋กœ ๋“ค์–ด๊ฐ€๋Š” ๊ธฐ๋Šฅ(ex ์ธ์ฆ/์ธ๊ฐ€, ๋กœ๊น… ๋“ฑ)๋“ค์„ ์ค‘๋ณต์œผ๋กœ ๊ฐœ๋ฐœํ•ด์•ผ ํ•œ๋‹ค๋Š” ๋ฌธ์ œ์ ์ด ๋ฐœ์ƒํ•œ๋‹ค. ์ด๋Ÿฌํ•œ ๋ฌธ์ œ์ ์„ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋“ฑ์žฅํ•œ ๊ฒƒ์ด ๋ฐ”๋กœ API Gateway์ด๋‹ค. API Gateway๋ž€? API Gateway Service๋Š” ์‚ฌ์šฉ์ž๊ฐ€ ์„ค์ •..

728x90
๋ฐ˜์‘ํ˜•