server:
port: 8761
spring:
application:
name: discovery-service
eureka:
client:
register-with-eureka: false
fetch-registry: false
# 개발시 false 운영시 true
server:
enable-self-preservation: false
eviction-interval-timer-in-ms: 3000 #하트비트 수신점검
@EnableEurekaServer 어노테이션 추가 후 실행
server:
port: 9001
spring:
application:
name: user-service
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://127.0.0.1:8761/eureka
@EnableDiscorveryClient 어노테이션 추가 후 실행
server:
port: 0
spring:
application:
name: user-service
eureka:
instance:
instance-id: ${spring.cloud.client.hostname}:${spring.application.instance_id:${random.value}}
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://127.0.0.1:8761/eureka
server:
port: 0
spring:
application:
name: product-service
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
password: 1234
url: jdbc:mysql://localhost:3306/product-service?useSSL=false&characterEncoding=UTF-8&serverTimezone=UTC
username: root
jpa:
database: mysql
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
generate-ddl: true
show-sql: true
hibernate:
ddl-auto: update
properties:
hibernate:
format_sql: true
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://127.0.0.1:8761/eureka
instance:
instance-id: ${spring.cloud.client.hostname}:${spring.application.instance_id:${random.value}}
# 운영시 삭제
lease-renewal-interval-in-seconds: 1 # 디스커버리한테 1초마다 하트비트 전송 (기본 30초)
lease-expiration-duration-in-seconds: 2 # 디스커버리는 서비스 등록 해제 하기 전에 마지막 하트비트에서부터 2초 기다림