question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find a way to configure Eureka client with Docker swarm mode

See original GitHub issue

When using Eureka client with Docker swarm mode, I didn’t find a way to correctly configure the client to notify the correct hostname / ip. With Docker swarm mode you have at least two networks (if the container exposes a port to the public network), the ingress and the overlay network used for internal cluster communication (the correct one to use for Eureka). The problem is that, in each container, you have two interfaces eth0 and eth1; these are assigned randomically to the ingress or overlay ip thus is not possible to benefit from spring.cloud.inetutils.ignoredInterfaces property. So what happens is that randomically Eureka clients advertise the correct host configuration. Did you have any similar case to this or is there a specific Eureka configuration that can help me with that?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:25 (6 by maintainers)

github_iconTop GitHub Comments

19reactions
cecchisandronecommented, Mar 30, 2017

I have found two solutions to this problem:

  1. Specifying a custom network value in Docker swarm and using spring.cloud.inetutils.preferredNetworks property
  2. Using eureka.instance.hostName: service-name and eureka.instance.preferIpAddress: false, where service-name is the same service-name specified in the Docker compose file

What do you think about them?

12reactions
binakotcommented, Nov 23, 2017

UPDATE4:

Day 2️⃣. I added code below in all my spring-boot apps in a cluster.

@Configuration
public class EurekaClientConfig {

    @Bean
    @Autowired
    @Profile("docker")
    public EurekaInstanceConfigBean eurekaInstanceConfig(final InetUtils inetUtils) throws IOException {
        final String hostName = System.getenv("HOSTNAME");
        String hostAddress = null;

        final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
        for (NetworkInterface netInt : Collections.list(networkInterfaces)) {
            for (InetAddress inetAddress : Collections.list(netInt.getInetAddresses())) {
                if (hostName.equals(inetAddress.getHostName())) {
                    hostAddress = inetAddress.getHostAddress();
                }

                System.out.printf("%s: %s / %s\n", netInt.getName(),  inetAddress.getHostName(), inetAddress.getHostAddress());
            }
        }

        if (hostAddress == null) {
            throw new UnknownHostException("Cannot find ip address for hostname: " + hostName);
        }

        final EurekaInstanceConfigBean config = new EurekaInstanceConfigBean(inetUtils);
        config.setHostname(hostName);
        config.setIpAddress(hostAddress);
        return config;
    }
}

Lets check config and registry services.

Config:

eth2: 979c83c891fa / 10.0.0.3
eth1: 172.21.0.3 / 172.21.0.3
eth0: 10.255.0.4 / 10.255.0.4
lo: 10.0.0.2 / 10.0.0.2
lo: 10.255.0.3 / 10.255.0.3
lo: localhost / 127.0.0.1
<application>
  <name>CONFIG</name>
  <instance>
    <instanceId>config:b9701dfcc9f70001937fc53e9c3dbebb</instanceId>
    <hostName>10.0.0.3</hostName>
    <app>CONFIG</app>
    <ipAddr>10.0.0.3</ipAddr>
    <status>UP</status>
    <...>
  </instance>
</application>

Registry:

eth2: b2c8b40d16de / 10.0.0.5
eth1: 172.21.0.4 / 172.21.0.4
eth0: 10.255.0.6 / 10.255.0.6
lo: 10.0.0.4 / 10.0.0.4
lo: 10.255.0.5 / 10.255.0.5
lo: localhost / 127.0.0.1
<application>
  <name>REGISTRY</name>
  <instance>
    <instanceId>registry:07942e8b1a5cb63062d0caa7da9529f9</instanceId>
    <hostName>10.0.0.5</hostName>
    <app>REGISTRY</app>
    <ipAddr>10.0.0.5</ipAddr>
    <status>UP</status>
    <...>
  </instance>
</application>

Overlay network

[
    {
        "Name": "stack_default",
        "Id": "mnln7pi1y53chqcqfl5njmap3",
        "Created": "2017-11-23T05:37:47.3809552Z",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.0.0.0/24",
                    "Gateway": "10.0.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "5210e982c5dac5f60295fe8b838c0125ef57af59ef674109aaf311976f48ea90": {
                "Name": "stack_rabbitmq.1.9ai08boa6ts8v6aanwd3fpjbv",
                "EndpointID": "32d9066c6daaee194ebd771ea959b8783d012744fd564ca791776aa43faf2d96",
                "MacAddress": "02:42:0a:00:00:07",
                "IPv4Address": "10.0.0.7/24",
                "IPv6Address": ""
            },
            "979c83c891fa39b4d1ed3c2c95de9209eba15217afde8a5f115ab68c609381fa": {
                "Name": "stack_config.1.84it2lq7j67vmxeibtvp0q7eq",
                "EndpointID": "aee5c133b60f4b21c92f4b6196ef1a29ec4803414348b2363b41e240fbf788d8",
                "MacAddress": "02:42:0a:00:00:03",
                "IPv4Address": "10.0.0.3/24",
                "IPv6Address": ""
            },
            "b2c8b40d16de987d87d6ec6cd44acb036246249c1316daf0511b7a07ad41236d": {
                "Name": "stack_registry.1.x7j9gzh4gu1id44j60d0ilx8e",
                "EndpointID": "0126dd6894d961bfe4a6f7788dc1f5a6d9b20bc53021798a5e4c41126f4053b1",
                "MacAddress": "02:42:0a:00:00:05",
                "IPv4Address": "10.0.0.5/24",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4097"
        },
        "Labels": {
            "com.docker.stack.namespace": "stack"
        },
        "Peers": [
            {
                "Name": "moby-e6a48a47d001",
                "IP": "192.168.65.2"
            }
        ]
    }
]

Remember, I asked about 10.0.0.2 / 10.0.0.2, 10.0.0.4 / 10.0.0.4 and so on which Eureka uses by default. Network interfaces show this one as Loopback. Actually every service in Docker Swarm has 3 loobpack and 3 eth interfaces. When we set to prefer 10.0 addresses in yaml configuration, we force to use this loopback, because the real eth hostname in hex format (979c83c891fa, b2c8b40d16de, etc).


Okay, we got correct IP addresses on Eureka server from their clients. But we lost other configurations: urls, ports and so on. That’s why requests to gateway and other communications through Eureka stop working…

We need something like this:

<application>
  <name>CONFIG</name>
  <instance>
    <instanceId>config:effc6bb2ad867575d2c83a451bd1c04b</instanceId>
    <hostName>10.0.0.16</hostName>
    <app>CONFIG</app>
    <ipAddr>10.0.0.16</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="true">8888</port>
    <securePort enabled="false">443</securePort>
    <countryId>1</countryId>
    <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
      <name>MyOwn</name>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>30</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1511418416077</registrationTimestamp>
      <lastRenewalTimestamp>1511418416077</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1511418414924</serviceUpTimestamp>
    </leaseInfo>
    <metadata class="java.util.Collections$EmptyMap"/>
    <homePageUrl>http://10.0.0.16:8888/</homePageUrl>
    <statusPageUrl>http://10.0.0.16:8888/info</statusPageUrl>
    <healthCheckUrl>http://10.0.0.16:8888/health</healthCheckUrl>
    <vipAddress>config</vipAddress>
    <secureVipAddress>config</secureVipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1511418416077</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1511418265181</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
</application>

But with new custom EurekaClientConfig configuration we have:

<application>
  <name>CONFIG</name>
  <instance>
    <instanceId>config:1d4a762c49306da5e8038bfa74dd72b9</instanceId>
    <hostName>10.0.0.7</hostName>
    <app>CONFIG</app>
    <ipAddr>10.0.0.7</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="true">80</port>
    <securePort enabled="false">443</securePort>
    <countryId>1</countryId>
    <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
      <name>MyOwn</name>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>30</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1511418992485</registrationTimestamp>
      <lastRenewalTimestamp>1511419172515</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1511418991404</serviceUpTimestamp>
    </leaseInfo>
    <metadata class="java.util.Collections$EmptyMap"/>
    <homePageUrl>http://10.0.0.7:80/</homePageUrl>
    <statusPageUrl>http://10.0.0.7:80/info</statusPageUrl>
    <healthCheckUrl>http://10.0.0.7:80/health</healthCheckUrl>
    <vipAddress>config</vipAddress>
    <secureVipAddress>config</secureVipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1511418992485</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1511418869926</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
</application>

UPDATE5:

I override bean from autoconfiguration org.springframework.cloud.netflix.eureka. EurekaClientAutoConfiguration#eurekaInstanceConfigBean() like this:

@Configuration
@EnableConfigurationProperties
@Profile("docker")
public class EurekaClientConfig {

    private ConfigurableEnvironment env;
    private RelaxedPropertyResolver propertyResolver;

    public EurekaClientConfig(final ConfigurableEnvironment env) {
        this.env = env;
        this.propertyResolver = new RelaxedPropertyResolver(env);
    }

    @Bean
    @Primary
    public EurekaInstanceConfigBean eurekaInstanceConfigBean(final InetUtils inetUtils) throws IOException {
        final String hostName = System.getenv("HOSTNAME");
        String hostAddress = null;

        final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
        for (NetworkInterface netInt : Collections.list(networkInterfaces)) {
            for (InetAddress inetAddress : Collections.list(netInt.getInetAddresses())) {
                if (hostName.equals(inetAddress.getHostName())) {
                    hostAddress = inetAddress.getHostAddress();
                }

                System.out.printf("Inet %s: %s / %s\n", netInt.getName(),  inetAddress.getHostName(), inetAddress.getHostAddress());
            }
        }
        if (hostAddress == null) {
            throw new UnknownHostException("Cannot find ip address for hostname: " + hostName);
        }

        final int nonSecurePort = Integer.valueOf(propertyResolver.getProperty("server.port", propertyResolver.getProperty("port", "8080")));

        final EurekaInstanceConfigBean instance = new EurekaInstanceConfigBean(inetUtils);
        instance.setHostname(hostName);
        instance.setIpAddress(hostAddress);
        instance.setNonSecurePort(nonSecurePort);
        System.out.println(instance);
        return instance;
    }
}

And now I got next Eureka client registration:

<application>
  <name>CONFIG</name>
  <instance>
    <instanceId>config:a1b85f942f8d075984ff6ca490b476b1</instanceId>
    <hostName>10.0.0.5</hostName>
    <app>CONFIG</app>
    <ipAddr>10.0.0.5</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="true">8888</port>
    <securePort enabled="false">443</securePort>
    <countryId>1</countryId>
    <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
      <name>MyOwn</name>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>30</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1511430156036</registrationTimestamp>
      <lastRenewalTimestamp>1511430252197</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1511430131155</serviceUpTimestamp>
    </leaseInfo>
    <metadata class="java.util.Collections$EmptyMap"/>
    <homePageUrl>http://10.0.0.5:8888/</homePageUrl>
    <statusPageUrl>http://10.0.0.5:8888/info</statusPageUrl>
    <healthCheckUrl>http://10.0.0.5:8888/health</healthCheckUrl>
    <vipAddress>config</vipAddress>
    <secureVipAddress>config</secureVipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1511430156036</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1511430100452</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
</application>

And from container:

$ hostname
7aa5c788c463
$ hostname -i
10.0.0.5

It is exactly what I want ☕️ I need to test docker swarm scaling with replicas and my problem looks solved.


UPDATE6:

Finish 🥇 I got this works. Docker swarm service replications and Eureka are friends now.

eureka-final

<application>
  <name>TEMPLATE-SERVICE-1</name>
  <instance>
    <instanceId>template-service-1:431109dab3de8f77c471dc2719ba9c28</instanceId>
    <hostName>10.0.0.3</hostName>
    <app>TEMPLATE-SERVICE-1</app>
    <ipAddr>10.0.0.3</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="true">8080</port>
    <securePort enabled="false">443</securePort>
    <countryId>1</countryId>
    <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
      <name>MyOwn</name>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>30</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1511433565078</registrationTimestamp>
      <lastRenewalTimestamp>1511434508066</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1511433517989</serviceUpTimestamp>
    </leaseInfo>
    <metadata class="java.util.Collections$EmptyMap"/>
    <homePageUrl>http://10.0.0.3:8080/</homePageUrl>
    <statusPageUrl>http://10.0.0.3:8080/info</statusPageUrl>
    <healthCheckUrl>http://10.0.0.3:8080/health</healthCheckUrl>
    <vipAddress>template-service-1</vipAddress>
    <secureVipAddress>template-service-1</secureVipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1511433565078</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1511433517697</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
  <instance>
    <instanceId>template-service-1:2bef4192a3106139a306e9ad07fdeac2</instanceId>
    <hostName>10.0.0.18</hostName>
    <app>TEMPLATE-SERVICE-1</app>
    <ipAddr>10.0.0.18</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="true">8080</port>
    <securePort enabled="false">443</securePort>
    <countryId>1</countryId>
    <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
      <name>MyOwn</name>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>30</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1511434087896</registrationTimestamp>
      <lastRenewalTimestamp>1511434508066</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1511434087833</serviceUpTimestamp>
    </leaseInfo>
    <metadata class="java.util.Collections$EmptyMap"/>
    <homePageUrl>http://10.0.0.18:8080/</homePageUrl>
    <statusPageUrl>http://10.0.0.18:8080/info</statusPageUrl>
    <healthCheckUrl>http://10.0.0.18:8080/health</healthCheckUrl>
    <vipAddress>template-service-1</vipAddress>
    <secureVipAddress>template-service-1</secureVipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1511434087896</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1511434087766</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
</application>

<application>
  <name>TEMPLATE-SERVICE-2</name>
  <instance>
    <instanceId>template-service-2:4d066c17e11121460efb29fc82facd34</instanceId>
    <hostName>10.0.0.5</hostName>
    <app>TEMPLATE-SERVICE-2</app>
    <ipAddr>10.0.0.5</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="true">8080</port>
    <securePort enabled="false">443</securePort>
    <countryId>1</countryId>
    <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
      <name>MyOwn</name>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>30</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1511433565079</registrationTimestamp>
      <lastRenewalTimestamp>1511434506703</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1511433517053</serviceUpTimestamp>
    </leaseInfo>
    <metadata class="java.util.Collections$EmptyMap"/>
    <homePageUrl>http://10.0.0.5:8080/</homePageUrl>
    <statusPageUrl>http://10.0.0.5:8080/info</statusPageUrl>
    <healthCheckUrl>http://10.0.0.5:8080/health</healthCheckUrl>
    <vipAddress>template-service-2</vipAddress>
    <secureVipAddress>template-service-2</secureVipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1511433565079</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1511433516707</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
  <instance>
    <instanceId>template-service-2:8f4e5399cb6c20d0384c1ac4327bf8da</instanceId>
    <hostName>10.0.0.20</hostName>
    <app>TEMPLATE-SERVICE-2</app>
    <ipAddr>10.0.0.20</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="true">8080</port>
    <securePort enabled="false">443</securePort>
    <countryId>1</countryId>
    <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
      <name>MyOwn</name>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>30</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1511434220315</registrationTimestamp>
      <lastRenewalTimestamp>1511434519656</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1511434219932</serviceUpTimestamp>
    </leaseInfo>
    <metadata class="java.util.Collections$EmptyMap"/>
    <homePageUrl>http://10.0.0.20:8080/</homePageUrl>
    <statusPageUrl>http://10.0.0.20:8080/info</statusPageUrl>
    <healthCheckUrl>http://10.0.0.20:8080/health</healthCheckUrl>
    <vipAddress>template-service-2</vipAddress>
    <secureVipAddress>template-service-2</secureVipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1511434220315</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1511434219577</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
  <instance>
    <instanceId>template-service-2:96290f047823d00e46175f55b90c9cb2</instanceId>
    <hostName>10.0.0.19</hostName>
    <app>TEMPLATE-SERVICE-2</app>
    <ipAddr>10.0.0.19</ipAddr>
    <status>UP</status>
    <overriddenstatus>UNKNOWN</overriddenstatus>
    <port enabled="true">8080</port>
    <securePort enabled="false">443</securePort>
    <countryId>1</countryId>
    <dataCenterInfo class="com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo">
      <name>MyOwn</name>
    </dataCenterInfo>
    <leaseInfo>
      <renewalIntervalInSecs>30</renewalIntervalInSecs>
      <durationInSecs>90</durationInSecs>
      <registrationTimestamp>1511434221171</registrationTimestamp>
      <lastRenewalTimestamp>1511434520412</lastRenewalTimestamp>
      <evictionTimestamp>0</evictionTimestamp>
      <serviceUpTimestamp>1511434220659</serviceUpTimestamp>
    </leaseInfo>
    <metadata class="java.util.Collections$EmptyMap"/>
    <homePageUrl>http://10.0.0.19:8080/</homePageUrl>
    <statusPageUrl>http://10.0.0.19:8080/info</statusPageUrl>
    <healthCheckUrl>http://10.0.0.19:8080/health</healthCheckUrl>
    <vipAddress>template-service-2</vipAddress>
    <secureVipAddress>template-service-2</secureVipAddress>
    <isCoordinatingDiscoveryServer>false</isCoordinatingDiscoveryServer>
    <lastUpdatedTimestamp>1511434221171</lastUpdatedTimestamp>
    <lastDirtyTimestamp>1511434220463</lastDirtyTimestamp>
    <actionType>ADDED</actionType>
  </instance>
</application>
[
    {
        "Name": "stack_default",
        "Id": "vyei6hxull9le7ajma5n6r8gf",
        "Created": "2017-11-23T10:34:18.6336376Z",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.0.0.0/24",
                    "Gateway": "10.0.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "189f0ae2a2924ac45d844c957d9668030381f51a522c4d782c9c6806fc1d968b": {
                "Name": "stack_rabbitmq.1.lrpow8l5lxy051jsl1nhcxaje",
                "EndpointID": "990376d02a606c1a8bd7a61018321c6a99586245e0b233a40ba60d2877d76b86",
                "MacAddress": "02:42:0a:00:00:07",
                "IPv4Address": "10.0.0.7/24",
                "IPv6Address": ""
            },
            "1fef95280748ec36508c7b6d52a156f1332476211a9d7f5fb22e4d5e1f9e21d8": {
                "Name": "stack_template-service-2.3.2anjsglhw44jpxp47relufvv1",
                "EndpointID": "aa20fdd4d8cb783bb6eda8f191f4039f33464f94a43fec6f1a985514c285a32a",
                "MacAddress": "02:42:0a:00:00:14",
                "IPv4Address": "10.0.0.20/24",
                "IPv6Address": ""
            },
            "2a3af4cee6c8b14143c2408358aaebf0251fe3525fd6fc3a97c755518848c576": {
                "Name": "stack_monitor.1.rczns5q61fmflmwkmm2npl3iz",
                "EndpointID": "e70f108a4fff31a1445387bd549708b2e4a8a30d30e8173a3a5e083a61d4a860",
                "MacAddress": "02:42:0a:00:00:11",
                "IPv4Address": "10.0.0.17/24",
                "IPv6Address": ""
            },
            "6d06a459037fbed038b978353f4bd7838dcf049da35594a325cad6821aac7400": {
                "Name": "stack_registry.1.yecxlmhaezmnt2k76gzuw26jm",
                "EndpointID": "e6ee97f92c281b8a5cc64d800a474522c44daa5869dd5e01b0dce4746d557ccd",
                "MacAddress": "02:42:0a:00:00:0b",
                "IPv4Address": "10.0.0.11/24",
                "IPv6Address": ""
            },
            "a26eaa9094bef35a237d732c48f1771103f4874b62453a2bf98d7ba2da6b7653": {
                "Name": "stack_template-service-1.1.qpqya9b2ld8f5fl6if6evit0j",
                "EndpointID": "bcf7b2e685ee471652056963f9eb0d9e351ba969b14f813705a34c96e22931fc",
                "MacAddress": "02:42:0a:00:00:03",
                "IPv4Address": "10.0.0.3/24",
                "IPv6Address": ""
            },
            "aae4495d4012f9321fd1d69af5da3708b201e9bf95dea387a26d9865984cd0f7": {
                "Name": "stack_template-service-2.1.s6nvdc8cywj766t6h3wxssaam",
                "EndpointID": "48fb0ea7e8ad706a2f2a14c08b6ea1c16dabbb5664e86c449ed447d725c26d89",
                "MacAddress": "02:42:0a:00:00:05",
                "IPv4Address": "10.0.0.5/24",
                "IPv6Address": ""
            },
            "b84a6706b89d0d2ee2784385849ba3b7d094391cb8e6e445464f0b6f6e12e1a0": {
                "Name": "stack_config.1.6q03r8grjvq05ak9g0jgga3zg",
                "EndpointID": "c07ff9a1f5d5c302a0ca65104515994c004c4dbe1761ac12bc29a17ddedb3df9",
                "MacAddress": "02:42:0a:00:00:09",
                "IPv4Address": "10.0.0.9/24",
                "IPv6Address": ""
            },
            "cec008adc2e31257ab73ff495c709973e90ee54175c63947d0cf2b3ceec2734f": {
                "Name": "stack_auth.1.e3rw5edvumgzf3kq5078yvwsn",
                "EndpointID": "e79e03c37672cff86e5647e389bdcb50fc517f42d1d7561938743126e9995160",
                "MacAddress": "02:42:0a:00:00:0d",
                "IPv4Address": "10.0.0.13/24",
                "IPv6Address": ""
            },
            "d28b064353ba9776c0703eda529db61d47c1fb065e0494533fbfea7850e35544": {
                "Name": "stack_template-service-2.2.trxb2kaxg8uqvosf4sp887hcu",
                "EndpointID": "80ec6a0b57bdbec7b43b5e0784347292b9b5096384a0b49adbb47b9786b057cd",
                "MacAddress": "02:42:0a:00:00:13",
                "IPv4Address": "10.0.0.19/24",
                "IPv6Address": ""
            },
            "e3d0db794f525828b530f64900365bac9ff06bbd30cccd135556d0c8521c610b": {
                "Name": "stack_template-service-1.2.vl038gbz29jrralvhkp80ed7j",
                "EndpointID": "44d6fb2306db9ab936efbd7fb2c84e5691cf1ed4e845d178cff28c4db3ef030a",
                "MacAddress": "02:42:0a:00:00:12",
                "IPv4Address": "10.0.0.18/24",
                "IPv6Address": ""
            },
            "eec959f70e20d3c1ee4ee709ba6034d2d69a950628722c7d1435c3392d58ccaa": {
                "Name": "stack_gateway.1.r6expujs6l8q26htayzxc49ut",
                "EndpointID": "de7b895408d84eca063ee7ce032ac372ddbfc1e6d07881fc150e9935184eb9e8",
                "MacAddress": "02:42:0a:00:00:0f",
                "IPv4Address": "10.0.0.15/24",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4097"
        },
        "Labels": {
            "com.docker.stack.namespace": "stack"
        },
        "Peers": [
            {
                "Name": "moby-e6a48a47d001",
                "IP": "192.168.65.2"
            }
        ]
    }
]

Even Hystrix Dashboard understands replicas count via Feign commucations:

hystrix

At this moment I think I solved my problem with Spring Cloud + Docker Swarm. If not, I let you know 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot find a way to configure Eureka client with Docker swarm mode
When using Eureka client with Docker swarm mode, I didn't find a way to correctly configure the client to notify the correct hostname...
Read more >
Netflix Eureka Server and Client instance registration issue ...
We are deploying it as a docker service with Docker swarm for container orchestration. Everything works fine when we directly create the ...
Read more >
Use swarm mode routing mesh - Docker Documentation
The routing mesh routes all incoming requests to published ports on available nodes to an active container. To use the ingress network in...
Read more >
Eureka | Programmatic Ponderings
This command will initialize a Docker Swarm. Next, execute the stack deploy script, using an sh ./stack_deploy_local.sh command.
Read more >
Configuration - Prometheus.io
Docker Swarm SD configurations allow retrieving scrape targets from Docker Swarm engine. One of the following roles can be configured to discover targets: ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found