2017-08-08 97 views
0

看到一個服務當我問尤里卡關於它知道的服務(本地主機:8071 /尤里卡/應用/),它說,3 UP:DiscoveryClient不會尤里卡

<applications> 
    <versions__delta>1</versions__delta> 
    <apps__hashcode>UP_3_</apps__hashcode> 
    <application> 
    <name>ROUTER</name> 
    <instance> 
     <instanceId>localhost:router:8765</instanceId> 
     <hostName>localhost</hostName> 
     <app>ROUTER</app> 
     <ipAddr>10.0.75.1</ipAddr> 
     <status>UP</status> 
     <overriddenstatus>UNKNOWN</overriddenstatus> 
     <port enabled="true">8765</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>1502197927458</registrationTimestamp> 
     <lastRenewalTimestamp>1502198527594</lastRenewalTimestamp> 
     <evictionTimestamp>0</evictionTimestamp> 
     <serviceUpTimestamp>1502197927458</serviceUpTimestamp> 
     </leaseInfo> 
     <metadata class="java.util.Collections$EmptyMap"/> 
     <homePageUrl>http://localhost:8765/</homePageUrl> 
     <statusPageUrl>http://localhost:8765/info</statusPageUrl> 
     <healthCheckUrl>http://localhost:8765/health</healthCheckUrl> 
     <vipAddress>router</vipAddress> 
     <secureVipAddress>router</secureVipAddress> 
     <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer> 
     <lastUpdatedTimestamp>1502197927458</lastUpdatedTimestamp> 
     <lastDirtyTimestamp>1502197825173</lastDirtyTimestamp> 
     <actionType>ADDED</actionType> 
    </instance> 
    </application> 
    <application> 
    <name>ORDERS</name> 
    <instance> 
     <instanceId>localhost:ORDERS:8081</instanceId> 
     <hostName>localhost</hostName> 
     <app>ORDERS</app> 
     <ipAddr>10.0.75.1</ipAddr> 
     <status>UP</status> 
     <overriddenstatus>UNKNOWN</overriddenstatus> 
     <port enabled="true">8081</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>1502198168983</registrationTimestamp> 
     <lastRenewalTimestamp>1502198528945</lastRenewalTimestamp> 
     <evictionTimestamp>0</evictionTimestamp> 
     <serviceUpTimestamp>1502198088982</serviceUpTimestamp> 
     </leaseInfo> 
     <metadata class="java.util.Collections$EmptyMap"/> 
     <homePageUrl>http://localhost:8081/</homePageUrl> 
     <statusPageUrl>http://localhost:8081/info</statusPageUrl> 
     <healthCheckUrl>http://localhost:8081/health</healthCheckUrl> 
     <vipAddress>ORDERS</vipAddress> 
     <secureVipAddress>ORDERS</secureVipAddress> 
     <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer> 
     <lastUpdatedTimestamp>1502198168983</lastUpdatedTimestamp> 
     <lastDirtyTimestamp>1502198168956</lastDirtyTimestamp> 
     <actionType>ADDED</actionType> 
    </instance> 
    </application> 
    <application> 
    <name>FRONTEND</name> 
    <instance> 
     <instanceId>32e1ed7e75ba:8080</instanceId> 
     <hostName>32e1ed7e75ba</hostName> 
     <app>FRONTEND</app> 
     <ipAddr>172.17.0.3</ipAddr> 
     <status>UP</status> 
     <overriddenstatus>UNKNOWN</overriddenstatus> 
     <port enabled="true">8080</port> 
     <securePort enabled="false">7002</securePort> 
     <countryId>1</countryId> 
     <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo"> 
     <name>MyOwn</name> 
     </dataCenterInfo> 
     <leaseInfo> 
     <renewalIntervalInSecs>30</renewalIntervalInSecs> 
     <durationInSecs>90</durationInSecs> 
     <registrationTimestamp>1502197928887</registrationTimestamp> 
     <lastRenewalTimestamp>1502198529372</lastRenewalTimestamp> 
     <evictionTimestamp>0</evictionTimestamp> 
     <serviceUpTimestamp>1502197928887</serviceUpTimestamp> 
     </leaseInfo> 
     <metadata class="java.util.Collections$EmptyMap"/> 
     <homePageUrl>http://32e1ed7e75ba:8080</homePageUrl> 
     <statusPageUrl>http://32e1ed7e75ba:8080/info</statusPageUrl> 
     <healthCheckUrl>http://32e1ed7e75ba:8080/health</healthCheckUrl> 
     <vipAddress>true</vipAddress> 
     <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer> 
     <lastUpdatedTimestamp>1502197928887</lastUpdatedTimestamp> 
     <lastDirtyTimestamp>1502197928886</lastDirtyTimestamp> 
     <actionType>ADDED</actionType> 
    </instance> 
    </application> 
</applications> 

但後來我問我的路由器,哪些人知道(使用https://spring.io/guides/gs/service-registration-and-discovery/的ServiceInstanceRestController)它說2 - ROUTER和ORDER,但沒有FRONTEND。

有誰知道可能是什麼原因?

就像一個提示,WEBFRONT應用程序是一個使用尤里卡插件的nodejs應用程序。 ROUTER和ORDERS都是靴子。 顯然FRONTEND正確註冊,尤里卡認爲它是UP。我比較了線訂單和前端尤里卡XML輸出線,並沒有看到任何真正的關鍵區別...

+0

請問您能否包括前端項目的尤里卡設置? – mgyongyosi

回答

1

一件事,我發現是前端服務的vipAddress場是true,但我認爲這應該是FRONTENDfrontend你的情況。因爲引擎蓋EurekaDiscoveryClient使用com.netflix.discovery.EurekaClient getInstancesByVipAddress(String,bool)函數(source in the spring-cloud-netflix-eureka-client project),它通過vipAddress查詢可用服務。

更改後,您應在路由器服務的路徑服務/service-instances/frontend的響應中看到該服務。

+0

謝謝,就是這樣。我不知道它必須是平等的! – Tomasz