1
votes

I've set two master nodes in my cluster but it only shows "elastic-master" not "elastic-slave".(second node is not shown).How can I resolve it? I've already followed Elasticsearch documents but nothing changed!

My host file setting:

sudo nano /etc/hosts
192.168.143.30 elastic-master
192.168.143.23 elastic-slave

My config file:

# ---------------------------------- Cluster ------------------------------
cluster.name: elastic-a

# ------------------------------------ Node -------------------------------
node.name: elastic-master
node.master: true
node.data: true

# ---------------------------------- Network ------------------------------
network.host: 192.168.143.30
http.port: 9200
# --------------------------------- Discovery -----------------------------
discovery.seed_hosts: ["192.168.143.30","192.168.143.23"]
cluster.initial_master_nodes: ["elastic-slave", "elastic-master"]

My config file on second one:

# ---------------------------------- Cluster ------------------------------
cluster.name: elastic-a

# ------------------------------------ Node -------------------------------
node.name: elastic-slave
node.master: true
node.data: true

# ---------------------------------- Network ------------------------------
network.host: 192.168.143.23
http.port: 9200
# --------------------------------- Discovery -----------------------------
discovery.seed_hosts: ["192.168.143.30","192.168.143.23"]
cluster.initial_master_nodes: ["elastic-slave", "elastic-master"]
1
check and share the logs of two machinehamid bayat
Which version are you using?leandrojmp
@hamidbayat Which log do you want to see?Techmod
@leandrojmp CentOS 7 ,Elasticsearch 7.5 and Kibana 7.5Techmod
Your discovery settings are wrong, those changed in version 7, you need to discovery.seed_hosts and cluster.initial_master_nodes as explained in the documentation, also, this is your full elasticsearcy.yml? You are missing the cluster.name config, it should be the same on both.leandrojmp

1 Answers

0
votes

"First stopped the service (sudo service elasticsearch stop). Delete the data (sudo rm -rf /var/lib/elasticsearch/*) and restart the service (sudo service elasticsearch restart). Now work all !!" Found answer in here: Add nodes to make local cluster Elasticsearch [7.8]