I start elasticsearch on my laptop with docker-compose up -d es01, let the container start completly. Stop the containers with docker-compose stop. Then i do docker-compose up -d es01 again and elasticsearch gives me master not discovered or elected yet or when i check with
master not discovered or elected yet,
an election requires a node with id [alRw_LTeRqi8H9_0-0EAwg],
have discovered [] which is not a quorum;
discovery will continue using [127.0.0.1:9300, 127.0.0.1:9301, 127.0.0.1:9302, 127.0.0.1:9303, 127.0.0.1:9304]
from hosts providers and [{es01}{6VQf4azMRd-DqmZorZ357A}{yvhISyJ3TtSRPeK_mQjtZg}{172.19.0.3}{172.19.0.3:9300}{ml.machine_memory=1572864000, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 1, last-accepted version 16 in term 1"
This node is looking for another node with ID alRw_LTeRqi8H9_0-0EAwg to perform an election. Looking earlier in the logs I see that node es02 has this ID. However this node can't find es02 at any of the listed addresses.
discovery will continue using [127.0.0.1:9300, 127.0.0.1:9301, 127.0.0.1:9302, 127.0.0.1:9303, 127.0.0.1:9304]
It looks like es01 isn't looking for es02 in the right places. You need to make sure that each node knows how to find the other by setting discovery.seed_hosts.
It is the right answer, yes. I didn't realise we were taking about the docker-compose file in the reference manual, but it does indeed look to be missing that. Thanks for pointing it out!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.