Spring cloud 为什么eureka认为服务仍然是';向上';即使它的最后一次更新时间是两天前

Spring cloud 为什么eureka认为服务仍然是';向上';即使它的最后一次更新时间是两天前,spring-cloud,netflix-eureka,spring-cloud-netflix,service-discovery,Spring Cloud,Netflix Eureka,Spring Cloud Netflix,Service Discovery,我有一个运行2个副本的服务。但我发现该服务在eureka的仪表板中有3个UP实例 下面是eureka中服务的详细信息。有问题的实例是8d0c39f3ed9b:ocr服务器:8095,其上次续订时间是两天前。并且无法访问状态和运行状况url。我想知道为什么尤里卡认为它的 <application> <name>OCR-SERVER</name> <instance> <instanceId>211a4634b45f:ocr-server:

我有一个运行2个副本的服务。但我发现该服务在eureka的仪表板中有3个UP实例

下面是eureka中服务的详细信息。有问题的实例是8d0c39f3ed9b:ocr服务器:8095,其上次续订时间是两天前。并且无法访问状态和运行状况url。我想知道为什么尤里卡认为它的

<application>
<name>OCR-SERVER</name>
<instance>
<instanceId>211a4634b45f:ocr-server:8095</instanceId>
<hostName>211a4634b45f</hostName>
<app>OCR-SERVER</app>
<ipAddr>10.0.0.38</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8095</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1505589414444</registrationTimestamp>
<lastRenewalTimestamp>1505833520772</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1505589414444</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://211a4634b45f:8095/</homePageUrl>
<statusPageUrl>http://211a4634b45f:8096/manage/info</statusPageUrl>
<healthCheckUrl>http://211a4634b45f:8096/manage/health</healthCheckUrl>
<vipAddress>ocr-server</vipAddress>
<secureVipAddress>ocr-server</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1505589414444</lastUpdatedTimestamp>
<lastDirtyTimestamp>1505589412731</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
<instance>
<instanceId>8d0c39f3ed9b:ocr-server:8095</instanceId>
<hostName>8d0c39f3ed9b</hostName>
<app>OCR-SERVER</app>
<ipAddr>10.0.0.38</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8095</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1505589356797</registrationTimestamp>
<lastRenewalTimestamp>1505589356797</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1505589356797</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://8d0c39f3ed9b:8095/</homePageUrl>
<statusPageUrl>http://8d0c39f3ed9b:8096/manage/info</statusPageUrl>
<healthCheckUrl>http://8d0c39f3ed9b:8096/manage/health</healthCheckUrl>
<vipAddress>ocr-server</vipAddress>
<secureVipAddress>ocr-server</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1505589356797</lastUpdatedTimestamp>
<lastDirtyTimestamp>1505589356787</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
<instance>
<instanceId>0c62739f5ca8:ocr-server:8095</instanceId>
<hostName>0c62739f5ca8</hostName>
<app>OCR-SERVER</app>
<ipAddr>10.0.0.34</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8095</port>
<securePort enabled="false">443</securePort>
<countryId>1</countryId>
<dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
<name>MyOwn</name>
</dataCenterInfo>
<leaseInfo>
<renewalIntervalInSecs>30</renewalIntervalInSecs>
<durationInSecs>90</durationInSecs>
<registrationTimestamp>1505589403150</registrationTimestamp>
<lastRenewalTimestamp>1505833509700</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1505589403150</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://0c62739f5ca8:8095/</homePageUrl>
<statusPageUrl>http://0c62739f5ca8:8096/manage/info</statusPageUrl>
<healthCheckUrl>http://0c62739f5ca8:8096/manage/health</healthCheckUrl>
<vipAddress>ocr-server</vipAddress>
<secureVipAddress>ocr-server</secureVipAddress>
<isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1505589403150</lastUpdatedTimestamp>
<lastDirtyTimestamp>1505589400020</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
eureka服务器的配置为

eureka:
  instance:
    preferIpAddress: true
    enableSelfPreservation: false
    homePageUrl: http://${eureka.hostname}/
---
spring:
  profiles: peer1
eureka:
  instance:
    hostname: eureka-peer1
  client:
    serviceUrl:
      defaultZone: http://eureka-peer2:${server.port}/eureka/

---
spring:
  profiles: peer2
eureka:
  instance:
    hostname: eureka-peer2
  client:
    serviceUrl:
      defaultZone: http://eureka-peer1:${server.port}/eureka/

eureka客户端和服务器都在docker swarm中运行。

您的服务器可能已进入自我保护模式,这就是为什么您会在那里看到一个过时的实例


我看到您有
enableSelfPreservation:false
选项,但是它不在正确的部分,它应该是
eureka.server.enableSelfPreservation
,您的条目在
eureka.instance.enableSelfPreservation
下,这是不正确的。

enableSelfPreservation:false@spencergibb,我已经在eureka服务器中配置了
enableSelfPreservation:false
。你的意思是这个选项也会影响客户端吗?
eureka:
  instance:
    preferIpAddress: true
    enableSelfPreservation: false
    homePageUrl: http://${eureka.hostname}/
---
spring:
  profiles: peer1
eureka:
  instance:
    hostname: eureka-peer1
  client:
    serviceUrl:
      defaultZone: http://eureka-peer2:${server.port}/eureka/

---
spring:
  profiles: peer2
eureka:
  instance:
    hostname: eureka-peer2
  client:
    serviceUrl:
      defaultZone: http://eureka-peer1:${server.port}/eureka/