Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with Eureka server

I have a local eureka server and one client

Eureka:

server:
 port: 1111

eureka:
 instance:
   prefer-ip-address: true
 client:
   registerWithEureka: false
   fetchRegistry: false
   serviceUrl:
      defaultZone: http://127.0.0.1:1111/eureka/
 server:
   waitTimeInMsWhenSyncEmpty: 0    

Client:

eureka:
  instance:
    prefer-ip-address: true
  client:
    serviceUrl:
    defaultZone: http://127.0.0.1:1111/eureka/

I have 2 problems:

1) Eureka server throws in log:

NullPointerException: at com.netflix.eureka.resources.StatusResource.isReplicaAvailable

2) The client connecting with Eureka, but after some time I see in his log next:

RedirectingEurekaHttpClient : Request execution error javax.ws.rs.WebApplicationException: null at com.netflix.discovery.provider.DiscoveryJerseyProvider.readFrom(DiscoveryJerseyProvider.java:110)

RetryableEurekaHttpClient : Request execution failure DiscoveryClient : DiscoveryClient_MW/192.168.0.100:client:8080 - was unable to send heartbeat!

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

In log Eureka I see:

InstanceRegistry : DS: Registry: lease doesn't exist, registering resource: CLIENT - 192.168.0.100:client:8080 InstanceResource : Not Found (Renew): CLIENT - 192.168.0.100:client:8080

In Eureka web console the client has a UP status, but also there is a big inscription:

RENEWALS ARE LESSER THAN THE THRESHOLD. THE SELF PRESERVATION MODE IS TURNED OFF.THIS MAY NOT PROTECT INSTANCE EXPIRY IN CASE OF NETWORK/OTHER PROBLEM

Although connection is working and I can get link to my client throught Eureka.

Could you explain what it means and how I can get rid from that?

like image 507
slippery Avatar asked May 12 '16 12:05

slippery


People also ask

What do I do if my Eureka server is down?

You just need to wrap your call to eureka Server with Hystrix, so that it breaks circuit when the Server is down, preventing unnecessary calls.

Is Eureka server deprecated?

According to the Eureka wiki (https://github.com/Netflix/eureka/wiki), the Eureka 2.0 has been discontinued. The open source work on eureka 2.0 has been discontinued.

How do I test my Eureka server?

Test the ApplicationVisit the eureka-client in the browser, at http://localhost:8080/service-instances/a-bootiful-client . There, you should see the ServiceInstance for the eureka-client reflected in the response.

Why do we need Eureka server?

Eureka Server is an application that holds the information about all client-service applications. Every Micro service will register into the Eureka server and Eureka server knows all the client applications running on each port and IP address. Eureka Server is also known as Discovery Server.


1 Answers

serviceUrl:
defaultZone: http://127.0.0.1:1111/eureka/

in client setting YML, you should add space before "defaultZone" like this:

serviceUrl:
  defaultZone: http://127.0.0.1:1111/eureka/

else defaultZone is same level with serviceUrl. thanks

like image 94
徐琮杰 Avatar answered Sep 30 '22 06:09

徐琮杰