ES.6 Node can't join master (Docker)

Hi !

At first, here's my following architecture :

  • 1 Docker swarm cluster running 2 Elasticsearch 6.4.2 nodes without troubles. They're called isbg01 and isbg02. IP :
  • 1 Docker no-swarm in the same datacentre but on a different VM, running 1 Elasticsearch 6.4.2, isbg03. IP :

All ports are open (iptables INPUT/OUTPUT/FORWARD on accept).
isbg01 and isbg02 form a cluster and works perfectly well, however, when I try to add isbg03 to the cluster, the following message appears in the isbg03 logs :

    [2018-10-22T14:42:03,732][WARN ][o.e.d.z.ZenDiscovery     ] [isbg03] failed to connect to master [{isbg02}{CLIuWm25TrC6lsNNRL2-0w}{Vvh09X8ISHivXNjSENCJKw}{}{}{ml.machine_memory=5182058496, ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}], retrying...
org.elasticsearch.transport.ConnectTransportException: [isbg02][] general node connection failure
        at org.elasticsearch.transport.TcpTransport.openConnection( ~[elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.transport.TcpTransport.connectToNode( ~[elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.transport.TransportService.connectToNode( ~[elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.transport.TransportService.connectToNode( ~[elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.discovery.zen.ZenDiscovery.joinElectedMaster( [elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.discovery.zen.ZenDiscovery.innerJoinCluster( [elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.discovery.zen.ZenDiscovery.access$2500( [elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.discovery.zen.ZenDiscovery$JoinThreadControl$ [elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ [elasticsearch-6.4.2.jar:6.4.2]
        at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
        at java.util.concurrent.ThreadPoolExecutor$ [?:?]
        at [?:?]
Caused by: java.lang.IllegalStateException: java.lang.InterruptedException
        at org.elasticsearch.transport.TcpChannel.awaitConnected( ~[elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.transport.TcpTransport.openConnection( ~[elasticsearch-6.4.2.jar:6.4.2]
        ... 11 more
Caused by: java.lang.InterruptedException
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos( ~[?:?]
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos( ~[?:?]
        at org.elasticsearch.common.util.concurrent.BaseFuture$Sync.get( ~[elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.common.util.concurrent.BaseFuture.get( ~[elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.transport.TcpChannel.awaitConnected( ~[elasticsearch-6.4.2.jar:6.4.2]
        at org.elasticsearch.transport.TcpTransport.openConnection( ~[elasticsearch-6.4.2.jar:6.4.2]
        ... 11 more

Yet there's nothing to be found in isbg02's logs.

To simplify the problem, I've temporary removed isbg01, and slightly modified config files to try to connect isbg02 and isbg03 together.

Here are the configuration files : isbg isbg02 [""]
discovery.zen.minimum_master_nodes: 2 /var/lib/elasticsearch

. isbg isbg03 [""]
discovery.zen.minimum_master_nodes: 2

Curl-ing nodes from each other works (port 9200 gives me the traditionnal JSON, 9300 for isbg03 and 9301 for isbg02 gives me the "this is not an HTTP port".

I'm running out of ideas here. It seems that the firewall isn't blocking anything and they're running the same ES version.
Any idea on how to solve this ?

Thanks a lot !

Solved !

I had to set

network.publish_host: <VM IP>
transport.tcp.port: 9301 #If different from 9200
http.port: 9301

and bind with docker port 9301 to 9301 (instead of doing 9300 to 9301)

1 Like

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