注册到Eureka服务不自动注销

在根据周立的书学习服务注册发现,配置了Eureka集群后,将服务注册到Eureka上之后,服务down掉,不能正常的自动注销,服务会一直在。求解
 
Eureka配置
spring:
application:
name: itmuch-discovery-eureka
profiles:
active: peer1

---


server:
port: 8762

eureka:
client:
service-url:
defaultZone: http://peer1:8761/eureka/,http://peer3:8763/eureka/
instance:
hostname: peer2
spring:
profiles: peer2

---


server:
port: 8761


eureka:
client:
service-url:
defaultZone: http://peer2:8762/eureka/,http://peer3:8763/eureka/
instance:
hostname: peer1
spring:
profiles: peer1

---

server:
port: 8763


eureka:
client:
service-url:
defaultZone: http://peer1:8761/eureka/,http://peer2:8762/eureka/
instance:
hostname: peer3
spring:
profiles: peer3

 
服务配置:
eureka:
client:
service-url:
defaultZone: http://peer1:8761/eureka/,http://peer2:8762/eureka/,http://peer3:8763/eureka/
instance:
prefer-ip-address: true

状态:

微信截图_20170912153541.png


补充:
版本:
spring boot:1.5.6
springcloud:Camden.SR7
 
已邀请:

soszhouyou

赞同来自:

应该是eureka的保护机制开启了

wayne

赞同来自:

已经解决了,在微信群友的帮助下搞定的,配置如下:
eureka:
client:
service-url:
defaultZone: http://peer1:8761/eureka/,http://peer3:8763/eureka/
instance:
hostname: peer2
server:
enable-self-preservation: false
增加了:
  server:
enable-self-preservation: false
在测试环境,Eureka开启了自我保护模式,虽然服务down掉了,但是在Eureka还会保留服务注册,避免因网络原因导致的问题使服务不可用。
 
新的提示信息如下:
THE SELF PRESERVATION MODE IS TURNED OFF.THIS MAY NOT PROTECT INSTANCE EXPIRY IN CASE OF NETWORK/OTHER PROBLEMS.

要回复问题请先登录注册