o.e.c.c.ClusterFormationFailureHelper failed to resolve host

Hi
On the beginning I have a problem with configuration of two nodes on the same host.
As first I need to create a cluster
so at I've started from create network and swarm cluster.

I don't know why the host name is not resolve


elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  {"type": "server", "timestamp": "2022-03-09T17:20:50,360Z", "level": "WARN", "component": "o.e.d.SeedHostsResolver", "cluster.name": "elk-cluster", "node.name": "escoordination1", "message": "failed to resolve host [esmaster12:9301]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "stacktrace": ["java.net.UnknownHostException: esmaster12: Name or service not known",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) ~[?:?]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:933) ~[?:?]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1519) ~[?:?]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:852) ~[?:?]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.net.InetAddress.getAllByName0(InetAddress.java:1509) ~[?:?]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.net.InetAddress.getAllByName(InetAddress.java:1367) ~[?:?]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.net.InetAddress.getAllByName(InetAddress.java:1301) ~[?:?]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at org.elasticsearch.transport.TcpTransport.parse(TcpTransport.java:597) ~[elasticsearch-7.16.1.jar:7.16.1]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at org.elasticsearch.transport.TcpTransport.addressesFromString(TcpTransport.java:539) ~[elasticsearch-7.16.1.jar:7.16.1]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at org.elasticsearch.transport.TransportService.addressesFromString(TransportService.java:1111) ~[elasticsearch-7.16.1.jar:7.16.1]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at org.elasticsearch.discovery.SeedHostsResolver.lambda$resolveHostsLists$0(SeedHostsResolver.java:152) ~[elasticsearch-7.16.1.jar:7.16.1]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:718) ~[elasticsearch-7.16.1.jar:7.16.1]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]",
elk-cluster_escoordination1.1.tafjchwrv3ay@srv20900aam    |  "at java.lang.Thread.run(Thread.java:833) [?:?]"] }

version: "3.7"

services:
  escoordination1:
    image: private/elk-docker/elasticsearch/elasticsearch:7.16.1
    container_name: escoordination1
    environment:
      - node.name=escoordination1
      - xpack.security.enabled=true
      - xpack.security.http.ssl.enabled=true
      - xpack.security.http.ssl.key=certs/escoordination1/escoordination1.key
      - xpack.security.http.ssl.certificate_authorities=certs/ca/ca.crt
      - xpack.security.http.ssl.certificate=certs/escoordination1/escoordination1.crt
      - xpack.security.transport.ssl.enabled=true
      - xpack.security.transport.ssl.verification_mode=certificate
      - xpack.security.transport.ssl.certificate_authorities=certs/ca/ca.crt
      - xpack.security.transport.ssl.certificate=certs/escoordination1/escoordination1.crt
      - xpack.security.transport.ssl.key=certs/escoordination1/escoordination1.key
      - xpack.license.self_generated.type=basic
      - ELASTIC_USERNAME=elastic
      - ELASTIC_PASSWORD=o8toW7nf64DAy3
      - cluster.name=elk-cluster
      - discovery.seed_hosts=esmaster12:9301
      - cluster.initial_master_nodes=esmaster12,escoordination1
      - bootstrap.memory_lock=false
      - ingest.geoip.downloader.enabled=false
      - "ES_JAVA_OPTS=-Xms4g -Xmx4g"


    ports:
      - "9200:9201"
      - "9300:9301"
      #map docker host: port in the container
    networks:
      - mynet
    volumes:
      - /home/elasticsearch/certificates/:/usr/share/elasticsearch/config/certs
      - /opt/ssd/disk3/data_coordinator/:/usr/share/elasticsearch/data/

    ulimits:
      memlock:
        soft: -1
        hard: -1
    deploy:
      placement:
        constraints:  
        - node.hostname == srv20900aam
      mode: "replicated"
      replicas: 1
      resources:
        limits:
          memory: 4G
networks:
    mynet:
      external: true
version: "3.7"

services:
  esmaster12:
    image: private/elk-docker/elasticsearch/elasticsearch:7.16.1
    container_name: esmaster12
    environment:
      - node.name=esmaster12
      - xpack.security.enabled=true
      - xpack.security.http.ssl.enabled=true
      - xpack.security.http.ssl.key=certs/esmaster12/esmaster12.key
      - xpack.security.http.ssl.certificate_authorities=certs/ca/ca.crt
      - xpack.security.http.ssl.certificate=certs/esmaster12/esmaster12.crt
      - xpack.security.transport.ssl.enabled=true
      - xpack.security.transport.ssl.verification_mode=certificate
      - xpack.license.self_generated.type=basic
      - xpack.security.transport.ssl.certificate_authorities=certs/ca/ca.crt
      - xpack.security.transport.ssl.certificate=certs/esmaster12/esmaster12.crt
      - xpack.security.transport.ssl.key=certs/esmaster12/esmaster12.key
      - ELASTIC_USERNAME=elastic
      - ELASTIC_PASSWORD=o8toW7nf64DAy3
      - cluster.name=elk-cluster
      - discovery.seed_hosts=esmaster12:9300
      - cluster.initial_master_nodes=esmaster12,escoordination1
      - bootstrap.memory_lock=false
      - ingest.geoip.downloader.enabled=false
      - "ES_JAVA_OPTS=-Xms4g -Xmx4g"


    ports:
      - "9201:9200"
      - "9301:9300"
    networks:
      - mynet
    volumes:
      - /home/elasticsearch/certificates/:/usr/share/elasticsearch/config/certs
      - /opt/ssd/disk1/master1/:/usr/share/elasticsearch/data/

    ulimits:
      memlock:
        soft: -1
        hard: -1
    deploy:
      placement:
        constraints:  
        - node.hostname == srv20900aam
      mode: "replicated"
      replicas: 1
      resources:
        limits:
          memory: 4G
networks:
    mynet:
      external: true

elk-cluster_esmaster12.1.i5zdmb73dkpe@srv20900aam | {"type": "server", "timestamp": "2022-03-09T17:23:22,667Z", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "elk-cluster", "node.name": "esmaster12", "message": "master not discovered or elected yet, an election requires a node with id [_3JZjGqtTwOtbsdME4zXCw], have only discovered non-quorum [{esmaster12}{kJ53-U-PRe2vaeAnG_T0Jw}{4f36-9sWRzmkE_16JoL5Pw}{10.0.9.49}{10.0.9.49:9300}{cdfhilmrstw}]; discovery will continue using [10.0.9.39:9300] from hosts providers and [{esmaster12}{kJ53-U-PRe2vaeAnG_T0Jw}{4f36-9sWRzmkE_16JoL5Pw}{10.0.9.49}{10.0.9.49:9300}{cdfhilmrstw}] from last-known cluster state; node term 1, last-accepted version 46 in term 1" }

address comes from created docker network

root@srv20900aam kickstart_elk_cluster]# docker network inspect mynet
[
    {
        "Name": "mynet",
        "Id": "uestqty0u6haej0i8ovu8mxr3",
        "Created": "2022-03-09T18:20:33.876756863+01:00",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.0.9.0/24",
                    "Gateway": "10.0.9.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "3dd23e1ddcd5a1932e337e52a41d823fd1d0914c23bfe59d137222af1a6605be": {
                "Name": "elk-cluster_escoordination1.1.tafjchwrv3aywwfwbewihrc5w",
                "EndpointID": "ef629b6b6ca9382794cc3e856fc7d9072e78142df5e5b59ef7c2e466f1c71823",
                "MacAddress": "02:42:0a:00:09:26",
                "IPv4Address": "10.0.9.38/24",
                "IPv6Address": ""
            },
            "3e3852284a709462069382b994e5fa5c22bfcaaa7536b97b4415bdd24c66c25d": {
                "Name": "elk-cluster_esmaster12.1.i5zdmb73dkpe98hb50hwptwbp",
                "EndpointID": "2a170cac454019c95fdca7933abe33e23159233425f1c11d73f087470df32cf8",
                "MacAddress": "02:42:0a:00:09:31",
                "IPv4Address": "10.0.9.49/24",
                "IPv6Address": ""
            },
            "lb-mynet": {
                "Name": "mynet-endpoint",
                "EndpointID": "f4f4368732969646340edb277d2955f1c2e111d325ae4bd55ee5b402c7c74a1a",
                "MacAddress": "02:42:0a:00:09:24",
                "IPv4Address": "10.0.9.36/24",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4102"
        },
        "Labels": {},
        "Peers": [
            {
                "Name": "54c11880751d",
                "IP": "10.242.229.56"
            }
        ]
    }

and ingress network from swarm:

[root@srv20900aam]# docker network inspect ingress
[
    {
        "Name": "ingress",
        "Id": "2n4lb8kjweitacgkgzgj4v7ch",
        "Created": "2022-03-09T17:30:37.609606072+01:00",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.255.0.0/16",
                    "Gateway": "10.255.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": true,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "3dd23e1ddcd5a1932e337e52a41d823fd1d0914c23bfe59d137222af1a6605be": {
                "Name": "elk-cluster_escoordination1.1.tafjchwrv3aywwfwbewihrc5w",
                "EndpointID": "e64a1be91b7cd19dcb0a75e4f8f263c7cd43536ea57cf140039c0fb11ca144be",
                "MacAddress": "02:42:0a:ff:00:64",
                "IPv4Address": "10.255.0.100/16",
                "IPv6Address": ""
            },
            "3e3852284a709462069382b994e5fa5c22bfcaaa7536b97b4415bdd24c66c25d": {
                "Name": "elk-cluster_esmaster12.1.i5zdmb73dkpe98hb50hwptwbp",
                "EndpointID": "291237e1314f9b252f02c61aa4c397548ab6b543237cdf232ab8f52780a67d07",
                "MacAddress": "02:42:0a:ff:00:6f",
                "IPv4Address": "10.255.0.111/16",
                "IPv6Address": ""
            },
            "ingress-sbox": {
                "Name": "ingress-endpoint",
                "EndpointID": "ffd8bf5fef660784abf7cf46d016bf28900effdc0c9daf943bafcb18e03816d9",
                "MacAddress": "02:42:0a:ff:00:02",
                "IPv4Address": "10.255.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4096"
        },
        "Labels": {},
        "Peers": [
            {
                "Name": "54c11880751d",
                "IP": "10.242.229.56"
            },
            {
                "Name": "18d7f7f56917",
                "IP": "10.242.229.54"
            },
            {
                "Name": "2db17fcc1d47",
                "IP": "10.242.229.55"
            }
        ]
    }
]

I suspect there is a problem with the port configuration, but I am asking for your insights and suggestions

ok, so I left info for rest of member. When You will run the nodes on the same host be patient, synchronizing them via discovery seed takes some time if it is a docker swarm installation.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.