Error during setup es cluster with docker on different vm 7.5


I try to setup es cluster with two nodes on different machines.
That's my master elasticsearch.yml file: "xyz"
discovery.seed_hosts: ["", ""]
node.master: true
node.voting_only: false "master-1"
cluster.initial_master_nodes: "master-1"

That's my slave elasticsearch.yml: "xyz"
discovery.seed_hosts: ["", ""]
node.master: false
node.voting_only: false "slave-1" 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", "": "xyz", "": "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", "": "xyz", "": "slave-1", "message": "[controller/108] [] 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", "": "xyz", "": "slave-1", "message": "Using REST wrapper from plugin" }
{"type": "server", "timestamp": "2019-12-13T12:20:47,180Z", "level": "INFO", "component": "o.e.d.DiscoveryModule", "": "xyz", "": "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", "": "xyz", "": "slave-1", "message": "initialized" }
{"type": "server", "timestamp": "2019-12-13T12:20:47,898Z", "level": "INFO", "component": "o.e.n.Node", "": "xyz", "": "slave-1", "message": "starting ..." }
{"type": "server", "timestamp": "2019-12-13T12:20:48,032Z", "level": "INFO", "component": "o.e.t.TransportService", "": "xyz", "": "slave-1", "message": "publish_address {}, bound_addresses {}" }
{"type": "server", "timestamp": "2019-12-13T12:20:49,160Z", "level": "INFO", "component": "o.e.b.BootstrapChecks", "": "xyz", "": "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", "": "xyz", "": "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", "": "xyz", "": "slave-1", "message": "publish_address {}, bound_addresses {}" }
{"type": "server", "timestamp": "2019-12-13T12:21:19,223Z", "level": "INFO", "component": "o.e.n.Node", "": "xyz", "": "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,

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.


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