From 859a79ad353ecdb4be55b32a9bee04efa0a98614 Mon Sep 17 00:00:00 2001 From: "Tummala Dhanvi (c0mrad3)" Date: Tue, 18 Jul 2017 22:09:43 +0530 Subject: [PATCH] Document prefer hostname #2084 (#2092) --- docs/src/main/asciidoc/spring-cloud-netflix.adoc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/src/main/asciidoc/spring-cloud-netflix.adoc b/docs/src/main/asciidoc/spring-cloud-netflix.adoc index 05f8b920..fddbb0d5 100644 --- a/docs/src/main/asciidoc/spring-cloud-netflix.adoc +++ b/docs/src/main/asciidoc/spring-cloud-netflix.adoc @@ -487,6 +487,14 @@ of services rather than the hostname. Set `eureka.instance.preferIpAddress` to `true` and when the application registers with eureka, it will use its IP Address rather than its hostname. +[TIP] +==== +If hostname can't be determined by Java, then IP address is sent to Eureka. +Only explict way of setting hostname is by using `eureka.instance.hostname`. +You can set your hostname at the run time using environment variable, for +example `eureka.instance.hostname=${HOST_NAME}`. +==== + == Circuit Breaker: Hystrix Clients Netflix has created a library called https://github.com/Netflix/Hystrix[Hystrix] that implements the http://martinfowler.com/bliki/CircuitBreaker.html[circuit breaker pattern]. In a microservice architecture it is common to have multiple layers of service calls.