title: How to perform a failover with Netflix/Eureka?
body: <p>I use Eureka as my service discovery and as a load balancer, and it is working fine when having two instances of a service "A", however when I stop one of this instances Eureka doesn't recognize that one of the instances is down and it keeps me showing an error page everytime the load balancer tries to use the dead instance.</p>
  
  <p>I have put the <code>enableSelfPreservation</code> to <code>false</code> to prevent that but it takes Eureka up to 3 - 5 minutes to unregister that service, however I want high availability over my service and I want to perform the failover immediately in a matter of seconds. Is this possible using Eureka, if not how can I achieve to use only the alive instances when the others are dead.</p>
  
  <p>I am using spring boot, here is my configuration for the Eureka server.</p>
  
  <pre><code>server:
    port: 8761
  
  eureka:
    instance:
      hostname: localhost
    client:
      registerWithEureka: false
      fetchRegistry: false
      serviceUrl:
        defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
    server:
      enableSelfPreservation: false
  </code></pre>