Hi,
I'm using Eureka with Brixton.RC2 on my local box. I am facing below issue with Discovery client. I tried almost all the posts who this issue is reported, but I am not able to resolve this issue. Could you help on this:
7620: WARN RetryableEurekaHttpClient - Request execution failure
7620: ERROR DiscoveryClient - DiscoveryClient_USER-SERVICE/153.39.212.155:user-service:1111 - was unable to send heartbeat!
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:111)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.sendHeartBeat(EurekaHttpClientDecorator.java:89)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$3.execute(EurekaHttpClientDecorator.java:92)
at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77)
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.sendHeartBeat(EurekaHttpClientDecorator.java:89)
at com.netflix.discovery.DiscoveryClient.renew(DiscoveryClient.java:827)
at com.netflix.discovery.DiscoveryClient$HeartbeatThread.run(DiscoveryClient.java:1383)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)`
My code for Eureka Server yml file is below:
server:
port: 8761
eureka:
client:
registerWithEureka: false
fetchRegistry: false
server:
waitTimeInMsWhenSyncEmpty: 0
instance:
hostname: localhost`
The discovery client application.yml file is as below:
server:
context-path: /users
port: 1111 # HTTP (Tomcat) port
spring:
application:
name: user-service
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/
region: default
registryFetchIntervalSeconds: 5
availabilityZones:
default: ${APPLICATION_DOMAIN:${DOMAIN:defaultZone}}
instance:
leaseRenewalIntervalInSeconds: 10
endpoints:
restart:
enabled: true
Please help me to find, any missing part.
Thanks,
Anzar
Comment From: anz2050
Below are the project link on github:
Eureka Server project: https://github.com/anz2050/spring-eureka-server
Eureka Client project: https://github.com/anz2050/microservice-user-service
Comment From: spencergibb
does the error happen frequently or just once? What is the problem, does the client not register? Your two links above are the same.
Comment From: anz2050
Sorry, I updated the link.
Error is continously comming, after 10-15 seconds of client startup.
First time it register with 200 status code and I can see the services are up in Eureka Server dashboard. But after 10-15 seconds, it is throwing error in client log with below error:
7620: ERROR DiscoveryClient - DiscoveryClient_USER-SERVICE/153.39.212.155:user-service:1111 - was unable to send heartbeat!
Comment From: anz2050
There was mis-match version of 'spring-cloud-dependencies' in server and client. I updated it to 'Brixton.RELEASE'.
Now, it is working fine.
Thanks
Comment From: BruceOuyang
thanks, i got the same problem, you helped @anz2050
Comment From: Falci
I'm facing this same issue, but @anz2050's solution didn't work for me. I also tried the new version.
I'm running Eureka in a Docker container (springcloud/eureka).
I've created a /etc/hosts entry on my computer to point eureka to correct docker IP.
I can access the Eureka's UI in http://eureka:8761
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2.RELEASE</version>
</parent>
...
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.SR4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
Bootstrap.java
@SpringBootApplication
@Configuration
@EnableAutoConfiguration
@EnableEurekaClient
public class Bootstrap {
public static void main(String[] args) {
SpringApplication.run(Bootstrap.class, args);
}
}
application.yml
spring:
application:
name: auth-middle
eureka:
instance:
preferIpAddress: true
client:
serviceUrl:
defaultZone: http://eureka:8761/eureka
Comment From: spencergibb
@Falci, it's not the same issue, as the reporter found he had a mismatched version. If you can provide a sample project that reproduces the error, please open a new issue.
Comment From: mgumerov
This may be the same issue. We don't know what spring-cloud version the server (which is in the container) was built with
Comment From: fifteenzhang
Same issue And I fix it with eureka.client.serviceUrl.defaultZone Configuration