Почему eureka считает, что услуга все еще «UP», даже если ее последнее обновление было два дня назад

У меня есть служба с 2 запущенными репликами. Но я обнаружил, что служба имеет 3 экземпляра UP на панели управления eureka.

Ниже подробная информация об услуге в eureka. Проблемным экземпляром является 8d0c39f3ed9b:ocr-server:8095, время последнего обновления которого было два дня назад. И статус и URL-адрес здоровья НЕ могут быть доступны. Мне интересно, почему Эврика считает, что это UP!

<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:
    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 такова:

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 работают в рое докеров.


person Kane    schedule 19.09.2017    source источник
comment
включитьSelfPreservation: ложь   -  person spencergibb    schedule 19.09.2017
comment
@spencergibb, я уже настроил enableSelfPreservation: false на сервере eureka. Вы имеете в виду, что эта опция также влияет на клиентскую сторону?   -  person Kane    schedule 19.09.2017


Ответы (1)


Вероятно, ваш сервер перешел в режим самосохранения, поэтому вы видите там устаревший экземпляр.

Я вижу, у вас есть вариант enableSelfPreservation: false, но он не в том разделе, он должен быть eureka.server.enableSelfPreservation, ваша запись находится под eureka.instance.enableSelfPreservation, что неверно.

person jebeaudet    schedule 20.09.2017