1

我有2个副本运行的服务。但是我发现该服务在eureka的仪表板中有3个实例。为什么eureka认为服务仍然'UP',即使其最近一次续订时间是两天前

以下在尤里卡的服务的详细信息。有问题的实例是8d0c39f3ed9b:ocr-server: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: 
    instance: 
    statusPageUrlPath: /info 
    healthCheckUrlPath: /health 
    preferIpAddress: false 
    client: 
    fetchRegistry: true 
    registryFetchIntervalSeconds: 5 
    healthcheck: 
     enabled: true 
    serviceUrl: 
     defaultZone: http://eureka-peer1:8761/eureka,http://eureka-peer2:8761/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/ 

而且两者尤里卡客户端和服务器在泊坞窗群运行。

+0

enableSelfPreservation:false – spencergibb

+0

@spencergibb,我已经在eureka服务器中配置了'enableSelfPreservation:false'。你的意思是这个选项也会影响客户端吗? – Kane

回答

1

您的服务器可能已进入自我保存模式,这就是为什么您在那里看到一个陈旧的实例。

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

+0

谢谢你指出这个愚蠢的错误。 – Kane

相关问题