spring cloud config server설정(git)
2021. 8. 15. 21:33ㆍSpring
1. dependency에 spring cloud config server를 추가한다.
⇒ actuator는 필수 라이브러리는 아니지만 endpoint를 통한 컨피그 서버의 구성 정보나 상태를 확인하기 위해서 필요하다.(현재 단계에서는 필요없음)
2. application.yml혹은 properties값을 설정해준다.
2-1. private repository는 ssh key를 사용해야 clone할 수 있다.
2-2. .ssh폴더에 key를 생성한다.
$ ssh-keygen -m PEM -t rsa -b 4096 -C "your email address" -f config-server.id_rsa
2-3. 생성한 키 중 공개키파일(.pub)의 text를 복사하여 붙여넣고 등록한다.
2-4. key 등록이 완료되면 비밀키(.id_rsa)의 text를 복사하여 private-key: |이후에 붙여 넣는다.
3. 서버를 실행한다.
4. localhost:8888/{application-name}/{profile}/{branch-name}를 get으로 요청하면 확인할 수 있다.
반응형
'Spring' 카테고리의 다른 글
spring cloud config client설정(parameter store) (0) | 2021.08.23 |
---|---|
spring cloud config server설정(AWS parameter store) (0) | 2021.08.20 |
Spring Security / JWT (0) | 2021.08.14 |
SpringBoot와 Slack webhook을 사용하여 메세지 보내기 (3) | 2021.08.10 |