728x90
eureka helps microservices to find each other
Eureka는 모든 마이크로서비스(인스턴스?)의 주소를 안다. 마치 spring mvc의 handler adapter목록?같이?
Eureka Server
- dependency
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-apache-client4</artifactId>
<version>1.19.4</version>
</dependency>
이거 처음 테스트한거라서 서버로만할거면 서버dependency만 있으면 됨.
- .properties
server.port=8010
spring.application.name=discoveryservice
#server랑 client같이있어서 client로 등록하는걸 막기위해
eureka.client.registerWithEureka=false
eureka.client.fetchRegistry=false
eureka.client.serviceUrl.defaultZone = <http://localhost:8010/eureka>
eureka.instance.preferIpAddress=true
- Dashboard
Eureka Client
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
server.port=0
spring.application.name=users-ws
eureka.client.serviceUrl.defaultZone = <http://localhost:8010/eureka>
spring.devtools.restart.enabled = true
https://jangcenter.tistory.com/32
Spring Cloud - 서비스 디스커버리
Netflix의 Eureka를 이용해서 디스커버리 서비스를 구현 클라우드 환경이 되면서 서비스가 오토 스케일링등에 의해서 동적으로 생성되거나 컨테이너 기반의 배포로 인해서, 서비스의 IP가 동적으로
jangcenter.tistory.com
https://lion-king.tistory.com/12
(Spring Boot / Spring Cloud / MSA) 3. Eureka란? / 적용방법
Eureka 란? 마이크로서비스들의 정보를 레지스트리에 등록할 수 있도록 하고 마이크로서비스의 동적인 탐색과 로드밸런싱을 제공한다. 먼저 Eureka는 Eureka Server와 Eureka Client로 구성된다. Eureka Server
lion-king.tistory.com
-유리카서버키고 유저서비스 실행
유리가 대시보드 열면
728x90
'study > Spring' 카테고리의 다른 글
Spring Cloud Bus with RabbitMQ (1) | 2022.10.18 |
---|---|
Spring Cloud API Gateway (0) | 2022.10.12 |
exception에 에러메세지 안나올때 (0) | 2022.10.01 |
EC2 배포 (0) | 2022.08.30 |
thymeleaf list utils (0) | 2022.08.26 |
댓글