Closed ryanjbaxter closed 9 years ago
@ryanjbaxter what does eureka say is registered?
When I hit eureka/apps I see the service with the name questions there.
<applications>
<versions__delta>1</versions__delta>
<apps__hashcode>UP_5_</apps__hashcode>
<application>
<name>EUREKA</name>
<instance>
<hostName>ryans-macbook-pro.usma.ibm.com</hostName>
<app>EUREKA</app>
<ipAddr>9.32.121.34</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8761</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>1417631512749</registrationTimestamp>
<lastRenewalTimestamp>1417631512749</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1417631502448</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://ryans-macbook-pro.usma.ibm.com:8761/</homePageUrl>
<statusPageUrl>http://ryans-macbook-pro.usma.ibm.com:8761/info</statusPageUrl>
<healthCheckUrl>http://ryans-macbook-pro.usma.ibm.com:8761/health</healthCheckUrl>
<vipAddress>eureka</vipAddress>
<isCoordinatingDiscoveryServer>true</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1417631512749</lastUpdatedTimestamp>
<lastDirtyTimestamp>1417631472434</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
<application>
<name>REPLY</name>
<instance>
<hostName>ryans-macbook-pro.usma.ibm.com</hostName>
<app>REPLY</app>
<ipAddr>9.32.121.34</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8383</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>1417631502176</registrationTimestamp>
<lastRenewalTimestamp>1417631502176</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1417631502091</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://ryans-macbook-pro.usma.ibm.com:8383/</homePageUrl>
<statusPageUrl>http://ryans-macbook-pro.usma.ibm.com:8383/info</statusPageUrl>
<healthCheckUrl>http://ryans-macbook-pro.usma.ibm.com:8383/health</healthCheckUrl>
<vipAddress>reply</vipAddress>
<isCoordinatingDiscoveryServer>true</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1417631502176</lastUpdatedTimestamp>
<lastDirtyTimestamp>1417628361286</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
<application>
<name>SESSIONS</name>
<instance>
<hostName>ryans-macbook-pro.usma.ibm.com</hostName>
<app>SESSIONS</app>
<ipAddr>9.32.121.34</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8080</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>1417631499160</registrationTimestamp>
<lastRenewalTimestamp>1417631499160</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1417631498692</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://ryans-macbook-pro.usma.ibm.com:8080/</homePageUrl>
<statusPageUrl>http://ryans-macbook-pro.usma.ibm.com:8080/info</statusPageUrl>
<healthCheckUrl>http://ryans-macbook-pro.usma.ibm.com:8080/health</healthCheckUrl>
<vipAddress>sessions</vipAddress>
<isCoordinatingDiscoveryServer>true</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1417631499160</lastUpdatedTimestamp>
<lastDirtyTimestamp>1417621816531</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
<application>
<name>WEB</name>
<instance>
<hostName>ryans-macbook-pro.usma.ibm.com</hostName>
<app>WEB</app>
<ipAddr>9.32.121.34</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8282</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>1417631480090</registrationTimestamp>
<lastRenewalTimestamp>1417631480090</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1417631479833</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://ryans-macbook-pro.usma.ibm.com:8282/</homePageUrl>
<statusPageUrl>http://ryans-macbook-pro.usma.ibm.com:8282/info</statusPageUrl>
<healthCheckUrl>http://ryans-macbook-pro.usma.ibm.com:8282/health</healthCheckUrl>
<vipAddress>web</vipAddress>
<isCoordinatingDiscoveryServer>true</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1417631480090</lastUpdatedTimestamp>
<lastDirtyTimestamp>1417622457579</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
<application>
<name>QUESTIONS</name>
<instance>
<hostName>ryans-macbook-pro.usma.ibm.com</hostName>
<app>QUESTIONS</app>
<ipAddr>9.32.121.34</ipAddr>
<status>UP</status>
<overriddenstatus>UNKNOWN</overriddenstatus>
<port enabled="true">8181</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>1417631500665</registrationTimestamp>
<lastRenewalTimestamp>1417631500665</lastRenewalTimestamp>
<evictionTimestamp>0</evictionTimestamp>
<serviceUpTimestamp>1417631500540</serviceUpTimestamp>
</leaseInfo>
<metadata class="java.util.Collections$EmptyMap"/>
<homePageUrl>http://ryans-macbook-pro.usma.ibm.com:8181/</homePageUrl>
<statusPageUrl>http://ryans-macbook-pro.usma.ibm.com:8181/info</statusPageUrl>
<healthCheckUrl>http://ryans-macbook-pro.usma.ibm.com:8181/health</healthCheckUrl>
<vipAddress>questions</vipAddress>
<isCoordinatingDiscoveryServer>true</isCoordinatingDiscoveryServer>
<lastUpdatedTimestamp>1417631500665</lastUpdatedTimestamp>
<lastDirtyTimestamp>1417626979512</lastDirtyTimestamp>
<actionType>ADDED</actionType>
</instance>
</application>
</applications>
so then is the app that is calling questions
communicating with eureka? You should be able to see eureka information in /health
.
I believe so, it is the reply service that is also in the above xml the came from Eureka.
When I hit /health on any service I just see {"status":"DOWN"}
my guess is that your service isn't talking to eureka. What version of spring-cloud are you using?
Spring-boot snapshot (and spring-cloud snapshot) allows you to set health.sensitive=false
so that you can see the health details.
I am using the M3 release of spring cloud
If the service isn't talking to eureka, how would eureka know about about the service in the dashboard?
I didn't know what service was trying to talk to questions
. Something is wrong if {"status":"DOWN"}
. Do you have some code to share? It is hard to guess as to why eureka client isn't getting a list of instances from eureka server.
I will try to put together something simple to show the problem and share it with you.
@spencergibb take a look at the project here https://github.com/ryanjbaxter/spring-cloud-demo
Take a look at https://github.com/ryanjbaxter/spring-cloud-demo/tree/master/spring-cloud-feign-rest. The project is kind of pointless but demonstrates the problem.
M3 has an issue (now resolved) where the eureka starter doesn't include ribbon-eureka
. If you include spring-cloud-starter-hystrix
it will fix this. I just helped @joshlong with this very issue.
@spencergibb thanks I will give that a shot tomorrow and let you know!
That worked thanks!
I am trying to use Feign + Ribbon to call an endpoint of my service. My understanding is that Ribbon will use Eureka to look up the URL to the service. Following the documentation I created a class which extends FeignConfigurer
It was also my understanding that the second argument to loadBalance is the service name registered in Eureka with http:// prepended, correct?
When I run this I get a NPE. The log message is a little concerning to me since the current list of servers is empty, I am guessing that is referring to Eureka servers? I thought maybe I had to explicitely set eureka.client.serviceUrl.defaultZone (I usually don't since my Eureka server is running on localhost at the default port) but that didn't make a difference either.