netflix-eurekaconsulspring-cloud-netflixspring-cloud-consul

Eureka and Consul


I am implementing a service discovery and I evaluating two options: Eureka and Consul.

Help me decide! I am leaning towards Eureka, but I need to clear a main tech problem. My infrastructure is based on openshift. I can have multiple containers running Eureka Servers behind a load balancer. As far as I know each server needs to communicate with each other. Also, Eureka is mainly used with AWS...

(newbie) Question:

1) How can I configure each Eureka Server to communicate with each other? I have a single (load balanced) URL. My fear is that each server potentially may become desynchronized.

2) Am i missing something?


Solution

  • You're right, each of the Eureka Server must communicate with each other. You can also play with regions depending on your approach.

    To make it work (without zones), you must configure the property:

    eureka.client.service-url.defaultZone: http://1st-eureka-server-ip-or-hostname:port/eureka/,http://2nd-eureka-server-hostname:porta/eureka/
    

    The configuration above accepts a comma-delimited set of IP/hostname of all the Eureka Servers.

    If you want to have a multi-zone configuration, I recommend you to read this blog post.