eureka peering

This commit is contained in:
assu10
2020-10-24 19:42:31 +09:00
parent 6911072862
commit eb3596785e
3 changed files with 18 additions and 17 deletions

View File

@@ -20,15 +20,16 @@ management:
shutdown:
enabled: true
eureka:
instance:
hostname: peer1
metadataMap:
instanceId: peer1_${spring.application.name}:${spring.application.instance_id:${random.value}}
# instance:
# hostname: peer1
# metadataMap:
# instanceId: peer1_${spring.application.name}:${spring.application.instance_id:${random.value}}
client:
register-with-eureka: true # 유레카 서비스에 (자신을) 등록하지 않는다. (클러스터 모드가 아니므로)
fetch-registry: true # 레지스트리 정보를 로컬에 캐싱하지 않는다. (클러스터 모드가 아니므로)
serviceUrl:
defaultZone: http://peer2:8763/eureka/,http://peer1:8762/eureka/
defaultZone: http://peer1:8762/eureka/,http://peer2:8763/eureka/
#server:
#wait-time-in-ms-when-sync-empty: 5 # 서버가 요청을 받기 전 대기할 초기 시간 (5ms, 운영 환경에선 삭제 필요)
# 일시적인 네트워크 장애로 인한 서비스 해제 막기 위한 보호모드 해제 (디폴트 60초, 운영에선 삭제 필요)

View File

@@ -20,15 +20,15 @@ management:
shutdown:
enabled: true
eureka:
instance:
hostname: peer2
metadataMap:
instanceId: peer2_${spring.application.name}:${spring.application.instance_id:${random.value}}
# instance:
# hostname: peer2
# metadataMap:
# instanceId: peer2_${spring.application.name}:${spring.application.instance_id:${random.value}}
client:
register-with-eureka: true # 유레카 서비스에 (자신을) 등록하지 않는다. (클러스터 모드가 아니므로)
fetch-registry: true # 레지스트리 정보를 로컬에 캐싱하지 않는다. (클러스터 모드가 아니므로)
serviceUrl:
defaultZone: http://peer1:8762/eureka/,http://peer2:8763/eureka/
defaultZone: http://peer2:8763/eureka/,http://peer1:8762/eureka/
#server:
#wait-time-in-ms-when-sync-empty: 5 # 서버가 요청을 받기 전 대기할 초기 시간 (5ms, 운영 환경에선 삭제 필요)
# 일시적인 네트워크 장애로 인한 서비스 해제 막기 위한 보호모드 해제 (디폴트 60초, 운영에선 삭제 필요)

View File

@@ -16,16 +16,16 @@ management:
shutdown:
enabled: true
eureka:
#instance:
# prefer-ip-address: true # 서비스 이름 대신 IP 주소 등록
# lease-renewal-interval-in-seconds: 3 # 디스커버리한테 1초마다 하트비트 전송 (디폴트 30초)
# lease-expiration-duration-in-seconds: 2 # 디스커버리는 서비스 등록 해제 하기 전에 마지막 하트비트에서부터 2초 기다림 (디폴트 90초)
instance:
prefer-ip-address: true # 서비스 이름 대신 IP 주소 등록
lease-renewal-interval-in-seconds: 3 # 디스커버리한테 1초마다 하트비트 전송 (디폴트 30초)
lease-expiration-duration-in-seconds: 2 # 디스커버리는 서비스 등록 해제 하기 전에 마지막 하트비트에서부터 2초 기다림 (디폴트 90초)
client:
serviceUrl:
defaultZone: http://peer1:8762/eureka/
register-with-eureka: true # 유레카 서버에 서비스 등록
fetch-registry: true # 레지스트리 정보를 로컬에 캐싱
# registry-fetch-interval-seconds: 3 # 서비스 목록을 3초마다 캐싱
serviceUrl:
defaultZone: http://peer1:8762/eureka/
registry-fetch-interval-seconds: 3 # 서비스 목록을 3초마다 캐싱
logging:
level:
com.netflix: WARN