[Spring Security] eureka 서버 추가

WOOK JONG KIM·2022년 12월 12일
0

패캠_java&Spring

목록 보기
103/103
post-thumbnail

api gw

@EnableDiscoveryClient
//@EnableEurekaClient
@SpringBootApplication
public class SpGwApp {
    public static void main(String ar[]) {
        SpringApplication.run(SpGwApp.class);
    }
}
eureka:
  instance:
    leaseRenewalIntervalInSeconds: 1
    leaseExpirationDurationInSeconds: 2
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/
        #healthcheck:
      #enabled: true

Eureka Server

@EnableEurekaServer
@SpringBootApplication
public class EurekaServerApp {
    public static void main(String ar[]) {
        SpringApplication.run(EurekaServerApp.class);
    }
}
server.port : 8761

spring.application:
  name: eurekaApp

eureka:
  server:
    enable-self-preservation: false
  instance:
    hostname : localhost
    prefer-ip-address: true
  client:
    ## eureka server를 클라이언트로 등록하지 않았음
    register-with-eureka: false
    ## client에서 서비스 리스트를 캐싱
    fetch-registry: false
    serviceUrl: ## eureka 관리하면
      defaultZone : http://${eureka.instance.hostname}:${server.port}/eureka/

profile
Journey for Backend Developer

0개의 댓글