Section 1: Service Discovery - KwangtaekJung/MSA-SpringCloud-user-service GitHub Wiki

Section 1: Service Discovery

: ์™ธ๋ถ€์˜ ์„œ๋น„์Šค๋“ค์ด Microservice๋ฅผ ์ฐพ์„ ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ฃผ๋Š” ๊ฒƒ.

  • Spring Cloud Netflix Eureka
  • Eureka Service Discovery - ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ
  • User Service = ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ
  • User Service - ๋“ฑ๋ก
    • ๋ช…๋ น์–ด๋กœ ์‹คํ–‰ํ•˜๊ธฐ
      $ ./mvnw spring-boot:run -Dspring-boot.run.jvmArguments='-Dserver.port=9003'
      
    • ๋ช…๋ น์–ด๋กœ cleanํ•˜๊ณ  ์žฌ๋นŒ๋“œ ํ›„ ์‹คํ–‰ํ•˜๊ธฐ
      $ ./mvnw clean
      $ ./mvnw compile package
      $ java -jar -Dserver.port=9004 ./target/user-service-0.0.1-SNAPSHOT.jar  =>java -jar๋ฅผ ์ด์šฉํ•ด์„œ ์‹คํ–‰ํ•˜๋Š” ๊ฒƒ๋„ ๊ฐ€๋Šฅํ•จ.
      
  • User Service - Load Balancer

์ฐธ๊ณ  ์‚ฌ์ดํŠธ