Krish
Krish

Reputation: 2002

How to eliminate the "Eureka may be incorrectly claiming instances are up when they're not" warning on Eureka Dashboard?

How to eliminate the following message on Eureka server dashboard? Will it cause any issue to my services?

EMERGENCY! EUREKA MAY BE INCORRECTLY CLAIMING INSTANCES ARE UP WHEN THEY'RE NOT. RENEWALS ARE LESSER THAN THRESHOLD AND HENCE THE INSTANCES ARE NOT BEING EXPIRED JUST TO BE SAFE.

Eureka dashboard

Thanks.

Upvotes: 31

Views: 50655

Answers (7)

Anwar3006
Anwar3006

Reputation: 1

To resolve this issue after setting up your Eureka server, verify that the following properties in your application.properties or application.yml file are set to false:

eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false

This configuration stops the Eureka Server's internal client from registering itself and querying the Service Registry when it starts up. This traditionally presents itself as a

‘TransportException: Cannot Execute Request on Any Known Server’

error in your terminal when you start up the server and it can also lead to the above warning on the Eureka Dashboard.

After setting register-with-eureka to false and the issue persists, you can then use:

eureka.server.renewal-percent-threshold=0.49

The relationship between the Renews Threshold and the Renews can also lead to the above issue. If you have two instances of a service/two distinct services, they would send four renewal requests every minute (2 instances * 1 renewal every 30 seconds). With the default threshold of 1, Eureka would expect 5 renewals (4 actual renewals + a cushion based on expected renewals). This could lead to an issue since there are fewer actual renewals than the renews threshold expects, resulting in the warning.

By lowering the threshold to 0.49, you are effectively allowing Eureka to tolerate a lower renewal rate before raising a warning. In this example, this means Eureka now expects less than 50% of the maximum possible renewals before issuing a warning, giving more leeway and preventing unnecessary alerts that instances may be incorrectly marked as "up." In production, however, you can spin up two Eureka Servers and set

eureka.client.register-with-eureka=true

and this should be enough.

Upvotes: 0

Guaru
Guaru

Reputation: 49

in client add:

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

Upvotes: -1

Rinky
Rinky

Reputation: 1

I was facing same error for service registry. By adding

implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'

in build.gradle was able to resolve the issue.

Upvotes: -2

java beginner
java beginner

Reputation: 47

I had this same error. make sure you have

<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency>

in your client pom. NOT the server dependency.

Upvotes: -2

Godwin Tusime
Godwin Tusime

Reputation: 151

if you are using application.properties add

eureka.instance.lease-renewal-interval-in-seconds=0


to your file

Upvotes: 4

Khairul Bashar Lemon
Khairul Bashar Lemon

Reputation: 667

On your EurekaServer configuration properties file, change the value of wait-time-in-ms-when-sync-empty to zero or delete this line, cause default value is zero.

eureka:
  server:
    wait-time-in-ms-when-sync-empty: 0

Upvotes: 5

Imranmadbar
Imranmadbar

Reputation: 5480

Sample Disable this warning: add this property on application.properties file

 eureka.renewalPercentThreshold=0.85

OR

 eureka.server.enableSelfPreservation=false

But enableSelfPreservation also shows another warning message that you disable it.

Upvotes: 20

Related Questions