spring-cloud-netflix icon indicating copy to clipboard operation
spring-cloud-netflix copied to clipboard

Eureka client instances deregistering and closing Java processes

Open angheladrianclaudiu opened this issue 9 years ago • 13 comments

Hi,

I have a microservice that is registering with eureka. And I am starting 4 instances of this microservice on 4 different ports. The thing is that after some time, all the instances are deregistering and are shutting down the Java processes. See below excerpts from the logs of the instances:

Instance 1:

2017-09-18 15:04:30.829  INFO 4891 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 15:09:30.830  INFO 4891 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 15:11:14.651  WARN 4891 --- [       Thread-5] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1505747474651, current=DOWN, previous=UP]
2017-09-18 15:11:14.652  INFO 4891 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54301: registering service...
2017-09-18 15:11:14.656  INFO 4891 --- [       Thread-5] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54301 - deregister  status: 200
2017-09-18 15:11:14.657  INFO 4891 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54301 - registration status: 204
2017-09-18 15:11:14.666  INFO 4891 --- [       Thread-5] c.n.h.c.m.e.HystrixMetricsPoller         : Stopping the HystrixMetricsPoller
2017-09-18 15:11:14.720  WARN 4891 --- [       Thread-5] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2017-09-18 15:11:14.720  INFO 4891 --- [       Thread-5] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.

Instance 2:

2017-09-18 15:05:06.791  INFO 4948 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 15:10:06.792  INFO 4948 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 15:11:14.662  WARN 4948 --- [       Thread-5] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1505747474662, current=DOWN, previous=UP]
2017-09-18 15:11:14.664  INFO 4948 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54302: registering service...
2017-09-18 15:11:14.680  INFO 4948 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54302 - registration status: 204
2017-09-18 15:11:14.682  INFO 4948 --- [       Thread-5] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54302 - deregister  status: 200
2017-09-18 15:11:14.695  INFO 4948 --- [       Thread-5] c.n.h.c.m.e.HystrixMetricsPoller         : Stopping the HystrixMetricsPoller
2017-09-18 15:11:14.785  WARN 4948 --- [       Thread-5] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2017-09-18 15:11:14.785  INFO 4948 --- [       Thread-5] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.

Instance 3

2017-09-18 18:09:40.136  INFO 11785 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 18:14:40.137  INFO 11785 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 18:19:40.138  INFO 11785 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 18:24:40.139  INFO 11785 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 18:25:25.215  WARN 11785 --- [       Thread-5] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1505759125215, current=DOWN, previous=UP]
2017-09-18 18:25:25.216  INFO 11785 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54304: registering service...
2017-09-18 18:25:25.220  INFO 11785 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54304 - registration status: 204
2017-09-18 18:25:25.256  INFO 11785 --- [       Thread-5] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54304 - deregister  status: 200
2017-09-18 18:25:25.268  INFO 11785 --- [       Thread-5] c.n.h.c.m.e.HystrixMetricsPoller         : Stopping the HystrixMetricsPoller
2017-09-18 18:25:25.345  WARN 11785 --- [       Thread-5] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2017-09-18 18:25:25.345  INFO 11785 --- [       Thread-5] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.

Instance 4

2017-09-18 18:09:47.127  INFO 11832 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 18:14:47.128  INFO 11832 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 18:19:47.129  INFO 11832 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 18:24:47.129  INFO 11832 --- [trap-executor-0] c.n.d.s.r.aws.ConfigClusterResolver      : Resolving eureka endpoints via configuration
2017-09-18 18:25:25.243  WARN 11832 --- [       Thread-5] com.netflix.discovery.DiscoveryClient    : Saw local status change event StatusChangeEvent [timestamp=1505759125243, current=DOWN, previous=UP]
2017-09-18 18:25:25.244  INFO 11832 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54305: registering service...
2017-09-18 18:25:25.256  INFO 11832 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54305 - registration status: 204
2017-09-18 18:25:25.269  INFO 11832 --- [       Thread-5] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_microservice-instance/host-ip:microservice-instance:54305 - deregister  status: 200
2017-09-18 18:25:25.304  INFO 11832 --- [       Thread-5] c.n.h.c.m.e.HystrixMetricsPoller         : Stopping the HystrixMetricsPoller
2017-09-18 18:25:25.377  WARN 11832 --- [       Thread-5] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2017-09-18 18:25:25.377  INFO 11832 --- [       Thread-5] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.

The configuration that I am using in application.yml:

eureka:
  instance:
    prefer-ip-address: false
  client:
    registerWithEureka: true
    fetchRegistry: true
    serviceUrl:
      defaultZone: http://IP:port/eureka/
    healthcheck:
      enabled: true

Might now what the problem would be?

I am using Spring Boot 1.3.3.

angheladrianclaudiu avatar Sep 18 '17 18:09 angheladrianclaudiu

Is it related to eureka.client.healtcheck.enabled? Could you check the response from /health endpoint?

kylewu avatar Sep 19 '17 05:09 kylewu

This is the response:

{"description":"Spring Cloud Eureka Discovery Client","status":"UP"}

Also, I had the same issue described above even before I set up eureka.client.healtcheck.enabled.

angheladrianclaudiu avatar Sep 19 '17 16:09 angheladrianclaudiu

What version of Spring Cloud are you using?

ryanjbaxter avatar Sep 20 '17 15:09 ryanjbaxter

Brixton.RC1

angheladrianclaudiu avatar Sep 20 '17 18:09 angheladrianclaudiu

Can you upgrade to Camden.SR7 or Dalston.SR3?

ryanjbaxter avatar Sep 20 '17 18:09 ryanjbaxter

I will give it a try. But will this help? Is there something in the framework that is called behind the scenes that is causing the deregistration from Eureka? I would also like to understand this.

angheladrianclaudiu avatar Sep 20 '17 19:09 angheladrianclaudiu

Your using a very old release candidate that is no longer supported. Eureka went through many changes, so indeed, things may have fixed your issue.

spencergibb avatar Sep 20 '17 19:09 spencergibb

Ok. Thanks. I will give it a try soon and let you know.

angheladrianclaudiu avatar Sep 20 '17 21:09 angheladrianclaudiu

I got the same problem. I resolved it by adding this dependency:


<dependency>
	<groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-web</artifactId>
</dependency>

dulipchandana avatar Jul 19 '18 09:07 dulipchandana

thanks dulipchandana . It works for me

org.springframework.boot spring-boot-starter-web

girishgodage avatar Jul 23 '18 15:07 girishgodage

Hello Team , I was getting the login page when i am hitting the endpoint i no way mentioned the login details ,please help me .

Thank you.

srinivasvadla avatar Jan 16 '19 11:01 srinivasvadla

I got the same problem. I resolved it by adding this dependency:

org.springframework.boot spring-boot-starter-web

Thank you @dulipchandana

srivatsanvasishta avatar Jan 23 '19 19:01 srivatsanvasishta

You are right, thank you @dulipchandana

Alexhuihui avatar Feb 28 '19 03:02 Alexhuihui