Error during setup es cluster with docker on different vm 7.5

Hi,

I try to setup es cluster with two nodes on different machines.
That's my master elasticsearch.yml file:

cluster.name: "xyz"
network.host: 0.0.0.0
discovery.seed_hosts: ["10.8.11.86", "192.168.207.206"]
node.master: true
node.voting_only: false
node.name: "master-1"
cluster.initial_master_nodes: "master-1"

That's my slave elasticsearch.yml:

cluster.name: "xyz"
network.host: 0.0.0.0
discovery.seed_hosts: ["10.8.11.86", "192.168.207.206"]
node.master: false
node.voting_only: false
node.name: "slave-1"
node.data: true

I got connection between nodes, tested with telnet.
After booting first, the master, i've no errors and it's working fine. After booting my slave I've no errors also but node doesn't reach the master. That's my log from slave:

{"type": "server", "timestamp": "2019-12-13T12:20:46,055Z", "level": "INFO", "component": "o.e.x.s.a.s.FileRolesStore", "cluster.name": "xyz", "node.name": "slave-1", "message": "parsed [0] roles from file [/usr/share/elasticsearch/config/roles.yml]" }
{"type": "server", "timestamp": "2019-12-13T12:20:46,473Z", "level": "INFO", "component": "o.e.x.m.p.l.CppLogMessageHandler", "cluster.name": "xyz", "node.name": "slave-1", "message": "[controller/108] [Main.cc@110] controller (64 bit): Version 7.5.0 (Build 17d1c724ca38a1) Copyright (c) 2019 Elasticsearch BV" }
{"type": "server", "timestamp": "2019-12-13T12:20:47,047Z", "level": "DEBUG", "component": "o.e.a.ActionModule", "cluster.name": "xyz", "node.name": "slave-1", "message": "Using REST wrapper from plugin org.elasticsearch.xpack.security.Security" }
{"type": "server", "timestamp": "2019-12-13T12:20:47,180Z", "level": "INFO", "component": "o.e.d.DiscoveryModule", "cluster.name": "xyz", "node.name": "slave-1", "message": "using discovery type [zen] and seed hosts providers [settings]" }
{"type": "server", "timestamp": "2019-12-13T12:20:47,897Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "xyz", "node.name": "slave-1", "message": "initialized" }
{"type": "server", "timestamp": "2019-12-13T12:20:47,898Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "xyz", "node.name": "slave-1", "message": "starting ..." }
{"type": "server", "timestamp": "2019-12-13T12:20:48,032Z", "level": "INFO", "component": "o.e.t.TransportService", "cluster.name": "xyz", "node.name": "slave-1", "message": "publish_address {172.20.0.2:9300}, bound_addresses {0.0.0.0:9300}" }
{"type": "server", "timestamp": "2019-12-13T12:20:49,160Z", "level": "INFO", "component": "o.e.b.BootstrapChecks", "cluster.name": "xyz", "node.name": "slave-1", "message": "bound or publishing to a non-loopback address, enforcing bootstrap checks" }
{"type": "server", "timestamp": "2019-12-13T12:21:19,179Z", "level": "WARN", "component": "o.e.n.Node", "cluster.name": "xyz", "node.name": "slave-1", "message": "timed out while waiting for initial discovery state - timeout: 30s" }
{"type": "server", "timestamp": "2019-12-13T12:21:19,222Z", "level": "INFO", "component": "o.e.h.AbstractHttpServerTransport", "cluster.name": "xyz", "node.name": "slave-1", "message": "publish_address {172.20.0.2:9200}, bound_addresses {0.0.0.0:9200}" }
{"type": "server", "timestamp": "2019-12-13T12:21:19,223Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "xyz", "node.name": "slave-1", "message": "started" }

Master does log nothing about some connections. The log with: "message": "timed out while waiting for initial discovery state - timeout: 30s" is confusing me. Is there something i missing?

Thanks a lot,
KM

If someone is facing the same issue, the solution i found is to delete -p flag from docker run command and set --network host so elasticsearch uses the default host network. I believe there's some issues in discovering hosts when you use docker and network created by docker.

Cheers,
KM

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