728x90
Spring Cloud Config 사용 이유
: 여러 msa 마다 각각의 configuration (application.yml) 을 가지고 있으면 관리 하기 힘들고
application.yml 의 설정이 바뀔시 다시 build 해서 deploy 해야 함.
일원화, 중앙 집중적으로 관리 하기 위해 Spring Cloud Config 를 사용 함.
Spring Cloud Config 도 하나의 Spring application 임.
만들기 위해 넣어야 할 의존성은: Spring Cloud Config -> Spring Server

main class 에 @EnableConfigSever 추가 함.

application.yml 파일에 config-server 의 port , 읽어올 yml 파일의 정보를 기록 한다.
applicaiton.yml 파일의 정보를 local의 파일로도 되고, git으로도 된다는데 난 local에서는 머가 잘못됐는지 안됐다.
모든게 한번에 되는게 없다.
하여 git 에 올리고 git 주소를 입력해서 config-server를 실행 했다.

server start 후 브라우저에
http://localhost:8888/ecommerce/default 치면 아래처럼 나온다.
아래처럼 나오면 정상으로 config-server 된것 임

728x90
'SI 업무 > MSA관련' 카테고리의 다른 글
| section 1-6. (FeignClient) msa -> msa 호출하는법 (2) | 2024.12.30 |
|---|---|
| section 1-5. Spring Cloud Config 에서 정보 받아 오기 (1) | 2024.12.29 |
| section 1-3. MSA 구성 설명/ gateway 설정 설명/ (0) | 2024.12.29 |
| section 1-2. user-service, catalog_service, order_service APIs (0) | 2024.12.27 |
| section 1-1. MSA로 e-commerce 만들기 설계 내용 (0) | 2024.12.25 |