Comments (8)
When eureka first starts up without peers it takes about 5 mins for it to start serving requests because it waits for all clients to register completely before it can give out the list. You can disable this by setting this
#Set this only for this sample service without which starting the instance will by default wait for the default of 5 mins
eureka.waitTimeInMsWhenSyncEmpty=0
In a production environment, it is recommended that you don't set this property. You might want to revert the other property changes above as they are unrelated.
from eureka.
Hi Karthik-vn,
Thanks for the reply. I'm actually already setting that parameter, but it doesn't seem to make a difference. Here's what I have for a config:
Tomcat setenv.sh:
export JAVA_OPTS="$JAVA_OPTS \
-Deureka.enableSelfPreservation=false \
-Deureka.registration.enabled=false \
-Deureka.environment=dev \
-Deureka.datacenter=ndc"
echo $JAVA_OPTS
And my eureka-server.properties (masked):
#Set this only for this sample service without which starting the instance will by default wait for the default of 5 mins
eureka.waitTimeInMsWhenSyncEmpty=0
#AWS access key which has access to EIP binding and looking up autoscaling information
eureka.awsAccessId=*****
eureka.awsSecretKey=******
@next=eureka-${environment}-${region}.properties
And finally eureka-server-dev.properties (masked):
#AWS access key which has access to EIP binding and looking up autoscaling information
eureka.awsAccessId=******
eureka.awsSecretKey=*******
from eureka.
@jfenner - this might sound silly, but are you rebuilding the eureka-server webapp with the new properties being set?
also, you might want to try setting those -D's in the actually eureka-server.properties file itself.
here's a link to my FluxCapacitor Netflix OSS FAQ that describes this issue: https://github.com/cfregly/fluxcapacitor/wiki/NetflixOSS-FAQ#eureka-service-discovery-load-balancer
The eureka.registration.enabled=false should have taken care of the problem (it has for others), so i wonder if those -D's aren't being picked up for some reason.
i just added karthik's recent suggestion of setting eureka.waitTimeInMsWhenSyncEmpty=0 to the FAQ as i hadn't heard of that before.
lemme know if that helps.
-chris
from eureka.
I'm also seeing this, even with eureka.waitTimeInMsWhenSyncEmpty
set to 0
. While this is hard to see with Tomcat, attempting to run under Jetty shows a tremendous number of stack traces as Eureka server tries and fails to connect to itself with the Eureka client, presumably because it's still attempting to come up.
from eureka.
@NiteshKant @cfregly @karthik-vn This is actually happening in EurekaBootStrap.contextInitialized
, when it calls registry.syncUp()
(roughly line 102, depending on which PRs are merged when you look this up). syncUp()
will sleep up to, by default, five times, for 30 seconds, until it can find a peer to register with. There's your 3-5 minute start-up time with the default .properties
files.
There are two possible fixes to this:
- Modify the wiki to also note that you have to set
eureka.numberRegistrySyncRetries
to0
for debugging - Introduce a new setting, called something like
eurekaServer.testingMode
, that bypasses the initialsyncUp
call entirely.
The first is obviously less work, but second's also pretty simple. Thoughts?
from eureka.
@bpollack I personally like the option 2. so that there is less configuration to set.
In fact we should be able to support starting the servers with no eureka peers configured. This would automatically remove all these issues. Thoughts?
from eureka.
@NiteshKant Hmm, I like your idea. Will quickly whip up a PR in that style for feedback.
from eureka.
To eliminate syncUp just set eureka.numberRegistrySyncRetries=0
. Once it is set, the server starts up instantly.
I propose to close this issue, as there was no follow up on it for some time, and there is alternative approach to achieve this goal.
from eureka.
Related Issues (20)
- JerseyEurekaHttpClient issue with 404 responses in Spring Boot 3.x HOT 4
- Netflix HOT 1
- Unable to register Eureka server [Error: eureka registration FAILED: status: 404 body: undefined] HOT 1
- DependencyConvergence failed for spring-cloud-starter-netflix-eureka-client 3.1.5 and 4.0.3
- How can I add "ip prefer" with "rest api"?
- weld-001408: unsatisfied dependencies for type EurekaServerContext with qualifiers @default
- updateDelta() bug? In come case, reconcileHashCode inconsistencies may occur after updating
- Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat HOT 1
- eureka client failed to renew lease after a period of time
- Unable to properly log out of the Eureka service after registration
- Status HOT 2
- Inconsistent service instances caused by synchronization issues between Eureka servers HOT 1
- WARN Ignoring onDemand update due to rate limiter
- Uplift httpclient to 5.x HOT 1
- Eureka Client - CVE-2023-2976
- Eureka server 500 when "overriddenstatus" is omitted from request body
- Eureka client using vulnerable version of apache commons-configuration. HOT 1
- Error in connection between Eureka client and Eureka registration center HOT 1
- com.netflix.hystrix.exception.HystrixRuntimeException: api timed-out and no fallback available
- com.netflix.discovery.DiscoveryClient: DiscoveryClient_EUREKA-TEST-CLIENT/eureka-client-544b94f967-gcx2f:eureka-test-client - was unable to send heartbeat! HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eureka.