Technical Documentation: Netflix/eureka
โน๏ธ Provenance: Multi-Tier Ingestion ยท CodeWiki Reference
Overview (`README.md`)
Eureka
Eureka is a RESTful (Representational State Transfer) service that is primarily used in the AWS cloud for the purpose of
discovery, load balancing and failover of middle-tier servers. It plays a critical role in Netflix mid-tier infra.
Building
The build requires java8 because of some required libraries that are java8 (servo), but the source and target
compatibility are still set to 1.7. Note that tags should be checked out to perform a build.
Contributing
For any non-trivial change (or a large LoC-wise change), please open an issue first to make sure there's alignment on
the scope, the approach, and the viability.
Support
Community-driven mostly, feel free to open an issue with your question, the maintainers are looking over these
periodically. Issues with the most minimal repro possible have the highest chance of being answered.
Documentation
Please see wiki for detailed documentation.
Overview (`eureka-client-archaius2/README.md`)
This is a version of eureka-client that has been ported to use Archaius 2.x as the backing configuration system. Please note that this client is still work in progress. This client is also only java8 compatible (as Archaius 2.x is only java8 compatible).
Overview (`eureka-client-jersey2/README.md`)
Please note that this jersey2 compatible Eureka client (eureka-client-jersey2) is created and maintained by the community. Netflix does not currently use this library internally.
Overview (`eureka-core-jersey2/README.md`)
Please note that this jersey2 compatible Eureka core (eureka-core-jersey2) is created and maintained by the community. Netflix does not currently use this library internally.
Overview (`eureka-examples/README.md`)
Example Overview
The eureka example requires 3 participants:
- a centralized eureka server for registration and discovery
- an example service to register with eureka that exposes a REST endpoint
- an example client that discovers the example service via discovery, and then queries the example service on it's
registered REST endpoint.
Setting up the Eureka server
- Edit eureka-server.properties and uncomment the two settings that makes the demo server start up faster (via disabling safeguards)
- Build the application.
- The above build also sets up all the libraries needed for running the demo service and the demo client.
- Copy the WAR artifact to your tomcat deployment directory under _$TOMCAT_HOME/webapps/
cp ./eureka-server/build/libs/eureka-server-XXX-SNAPSHOT.war $TOMCAT_HOME/webapps/eureka.war
5. Create (or add to) a setenv.sh in tomcat/bin/ with the following java opts (these are for the demo server to start up fast, see EurekaServerConfig.java for their documentation):JAVA_OPTS="
-Deureka.waitTimeInMsWhenSyncEmpty=0
-Deureka.numberRegistrySyncRetries=0"
- Start your tomcat server. Access http://localhost:8080/eureka to verify the information there. Your server's eureka client should register itself in 30 seconds and you should see that information there.
Running the examples directly
- Start up a local eureka server
- Run the example service first with
./gradlew :eureka-examples:runExampleServiceand wait until you see "Service started and ready to process requests.." indicating that is had registered with eureka. - Run the example client with
./gradlew :eureka-examples:runExampleClient.
Running the examples as an app
- Start up a local eureka server
- Build a zip distribution with
./gradlew :eureka-examples:distZip - In the distribution run
./bin/ExampleEurekaServiceand wait until you see "Service started and ready to process requests.." indicating that is had registered with eureka. - In the distribution run
./bin/ExampleEurekaClientto run the example client.
Examples Provided
ExampleEurekaService
An example service that registers itself with eureka. (Note: prefer the DI version of creation in ExampleEurekaGovernatedService).
ExampleEurekaGovernatedService
The same as the ExampleEurekaService, where Governator/Guice is used to initialize everything. The gradle javaExec for this is ./gradlew :eureka-examples:runExampleGovernatedService and the distribution generated script is ./bin/ExampleEurekaGovernatedService
ExampleEurekaClient
An example use case of the eureka client to find a particular application/vip (in this case the example service) via eureka for communication.
Overview (`eureka-client/src/main/java/com/netflix/discovery/shared/resolver/README.md`)
Much of the code in this package are still experimental and subject to major refactoring down the line.
They should not be exposed through the normal eureka-client APIs, so use directly at your own risk.
Overview (`eureka-client/src/main/java/com/netflix/discovery/shared/transport/README.md`)
Much of the code in this package are still experimental and subject to major refactoring down the line.
They should not be exposed through the normal eureka-client APIs, so use directly at your own risk.
--- METRICS ---
- Files Extracted: 7
- Estimated Token Budget: ~1395 tokens
- Canonical Reference: https://codewiki.google/github.com/Netflix/eureka