joshlong-attic / service-registration-and-discovery

A repository for a blog on how Spring Cloud promotes resilient service-to-service calls through service registries and service discovery
Apache License 2.0
98 stars 97 forks source link

passport service not registering with Eureka #4

Open sridhar1982 opened 9 years ago

sridhar1982 commented 9 years ago

I cloned this git repo. I did mvn clean install in the top-level project

and executed the following commands in order

java -jar eureka-service.jar

java -jar bookmark-service.jar

java -jar photo-service.jar

java -jar passport-service.jar

bookmark-service and photo-service registers sucessfully with Eureka. I can confirm this with logs and the Eueka UI that lists all instances registered with Eureka.

However, passport-service registration fails. Here are the logs:

output in passport-service log:

2015-08-19 14:10:07.142  INFO 5070 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@11063673: startup date [Wed Aug 19 14:10:03 PDT 2015]; root of context hierarchy
2015-08-19 14:10:07.142  INFO 5070 --- [       Thread-4] c.n.l.DynamicServerListLoadBalancer      : Shutting down the Executor Pool for DynamicServerListLoadBalancer
2015-08-19 14:10:07.142  INFO 5070 --- [       Thread-3] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@651c807b: startup date [Wed Aug 19 14:10:04 PDT 2015]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@11063673
2015-08-19 14:10:07.143  INFO 5070 --- [       Thread-3] o.s.c.support.DefaultLifecycleProcessor  : Stopping beans in phase 0
2015-08-19 14:10:07.155  INFO 5070 --- [       Thread-3] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_PASSPORT-SERVICE/local.registerdisney.go.com - deregister  status: 404
2015-08-19 14:10:07.156  INFO 5070 --- [       Thread-3] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2015-08-19 14:10:07.156  INFO 5070 --- [       Thread-3] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans
2015-08-19 14:10:07.157  INFO 5070 --- [       Thread-3] c.n.e.EurekaDiscoveryClientConfiguration : Closing DiscoveryClient.jerseyClient
2015-08-19 14:10:07.158  INFO 5070 --- [       Thread-3] c.n.e.EurekaDiscoveryClientConfiguration : Removing application passport-service from eureka
2015-08-19 14:10:07.162  INFO 5070 --- [       Thread-3] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_PASSPORT-SERVICE/local.registerdisney.go.com - deregister  status: 404

output in Eureka-service log:

2015-08-19 14:07:15.642  INFO 4741 --- [hresholdUpdater] c.n.eureka.PeerAwareInstanceRegistry     : Current renewal threshold is : 1
2015-08-19 14:10:07.151  WARN 4741 --- [nio-8761-exec-7] com.netflix.eureka.InstanceRegistry      : DS: Registry: cancel failed because Lease is not registered for: PASSPORT-SERVICE:local.registerdisney.go.com
2015-08-19 14:10:07.151  INFO 4741 --- [nio-8761-exec-7] c.n.eureka.resources.InstanceResource    : Not Found (Cancel): PASSPORT-SERVICE - local.registerdisney.go.com
2015-08-19 14:10:07.160  WARN 4741 --- [nio-8761-exec-1] com.netflix.eureka.InstanceRegistry      : DS: Registry: cancel failed because Lease is not registered for: PASSPORT-SERVICE:local.registerdisney.go.com
2015-08-19 14:10:07.160  INFO 4741 --- [nio-8761-exec-1] c.n.eureka.resources.InstanceResource    : Not Found (Cancel): PASSPORT-SERVICE - local.registerdisney.go.com
2015-08-19 14:12:15.657  INFO 4741 --- [eerNodesUpdater] c.n.eureka.PeerAwareInstanceRegistry     : Adding replica node: http://localhost:8761/eureka/
2015-08-19 14:17:15.675  INFO 4741 --- [hresholdUpdater] c.n.eureka.PeerAwareInstanceRegistry     : Current renewal threshold is : 1

After I shutdown photo-service, I see the following error in

2015-08-19 14:27:15.706  INFO 4741 --- [hresholdUpdater] c.n.eureka.PeerAwareInstanceRegistry     : Current renewal threshold is : 1
2015-08-19 14:27:23.452  INFO 4741 --- [nio-8761-exec-5] c.n.eureka.resources.InstanceResource    : Found (Cancel): PHOTO-SERVICE - local.registerdisney.go.com
2015-08-19 14:27:23.461  WARN 4741 --- [nio-8761-exec-2] com.netflix.eureka.InstanceRegistry      : DS: Registry: cancel failed because Lease is not registered for: PHOTO-SERVICE:local.registerdisney.go.com
2015-08-19 14:27:23.461  INFO 4741 --- [nio-8761-exec-2] c.n.eureka.resources.InstanceResource    : Not Found (Cancel): PHOTO-SERVICE - local.registerdisney.go.com
2015-08-19 14:27:23.462  WARN 4741 --- [-Cancel-process] c.netflix.eureka.cluster.PeerEurekaNode  : The replication of PHOTO-SERVICE/local.registerdisney.go.com/Cancel failed with response code 404
2015-08-19 14:27:23.462  WARN 4741 --- [-Cancel-process] c.netflix.eureka.cluster.PeerEurekaNode  : PeerEurekaNode: http://localhost:8761/eureka/apps/: PHOTO-SERVICE/local.registerdisney.go.com : delete: missing entry.

I also tried running mvn spring-boot:run in each of the modules in same order above. I still see passport-service not registering with Eureka.

nkarthik82 commented 8 years ago

I also faced similar issue in my local. Interesting thing is when I started the photo-service in debug mode and waited for sometime in a debug point, it started successfully. I kept the debug point in discoveryClient.getInstances("photo-service") line.