0
votes

I have a problem with configuring Elasticsearch with 2 nodes. First one lets say called "node1" will be master and the second "node2" will be slave. I created 2 virtual machines using VirtualBox. I set in configure that one is master(true) and the second is slave(master=false). It cant discovery automatically (I got an error no known master node, scheduling a retry ). I tried this Elasticsearch Cluster - No known master node, scheduling a retry but it doesnt help. I also changed MAC addresses of both virtual machines to be the same and got the same problem. But when I run both nodes on one virtual machine it works perfectly. I think the problem can be in virtualbox (network settings or something). Can somebody help me?

1

1 Answers

1
votes

Review your reach between those nodes. firewall is the main problem in these cases. try using ufw

on the slave

sudo ufw allow from <ipMaster>
sudo ufw allow out from any to <ipMaster>

on the master

sudo ufw allow from <ipSlave>
sudo ufw allow out from any to <ipSlave>

take a look on discovery settings under the elasticsearch.yml file as well

under

/etc/elasticsearch/elasticsearch.yml

use your favorite text editor

nano /etc/elasticsearch/elasticsearch.yml

find the following lines:

discovery.zen.ping.unicast.hosts

AND SET:

discovery.zen.ping.unicast.hosts: ["<ipMaster>","<ipSlave>"]

ensure also that both nodes share the same "cluster.name" but different "node.name", under the same file find the lines:

cluster.name
node.name

AND then Set:

on the master

cluster.name: MyCluster
node.name: Master01

on the slave

cluster.name: MyCluster
node.name: Slave01