# Elasticsearch: setting up cluster with two nodes

**URL:** <https://discuss.elastic.co/t/elasticsearch-setting-up-cluster-with-two-nodes/247994>\
**Category:** Elasticsearch\
**Created:** [September 9, 2020, 11:18am UTC](https://discuss.elastic.co/t/elasticsearch-setting-up-cluster-with-two-nodes/247994 "2020-09-09T11:18:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Techmod](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@Techmod](https://discuss.elastic.co/u/Techmod)\
**Post date:** [September 9, 2020, 11:18am UTC](https://discuss.elastic.co/t/elasticsearch-setting-up-cluster-with-two-nodes/247994/1 "2020-09-09T11:18:42Z")

</div>

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:

```auto
cd /etc/elasticsearch
sudo nano hosts
192.168.143.30 elastic-master
192.168.143.23 elastic-slave

```

#my cluster setting:

```auto
cd /etc/elasticsearch
sudo nano elasticsearch.yml
cluster.name: “cluster1”

```

for "elastic-master" (192.168.143.30) setting

```auto
node.name: “elastic-master”
node.master: true
node.data: true
networkhost: 192.168.143.30
discovery.zen.ping.unicast.hosts: ["192.168.143.30","192.168.143.23"]
discovery.zen.minimum_master_nodes: 2

```

for "elastic-slave" (192.168.143.23) setting

```auto
node.name: “elastic-slave”
node.master: true
node.data: true
networkhost:192.168.143.23
discovery.zen.ping.unicast.hosts: ["192.168.143.30","192.168.143.23"]
discovery.zen.minimum_master_nodes: 2

```

---

<div class="post-metadata">

**Author:** ![Emanuil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanuil/32/36783_2.png) [@Emanuil](https://discuss.elastic.co/u/Emanuil)\
**Post date:** [September 9, 2020, 1:14pm UTC](https://discuss.elastic.co/t/elasticsearch-setting-up-cluster-with-two-nodes/247994/2 "2020-09-09T13:14:33Z")

</div>

What's in each node's logs? grep for `zen-disco` lines if there's too much information. I'm guessing a network problem prevents them from seeing each other.

Can you access each node from the other one? I.e. while ssh-ed into `192.168.143.30` can you `telnet 192.168.143.23 9300` and the other way around?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 9, 2020, 1:29pm UTC](https://discuss.elastic.co/t/elasticsearch-setting-up-cluster-with-two-nodes/247994/3 "2020-09-09T13:29:42Z")

</div>

Which version of Elasticsearch are you using? That configuration is no longer valid if you are using version 7.x.

---

<div class="post-metadata">

**Author:** ![Techmod](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@Techmod](https://discuss.elastic.co/u/Techmod)\
**Post date:** [September 12, 2020, 5:19am UTC](https://discuss.elastic.co/t/elasticsearch-setting-up-cluster-with-two-nodes/247994/4 "2020-09-12T05:19:33Z")

</div>

```auto
# ---------------------------------- 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"]

```

I just updated my config file.  
I tried telnet and it worked on both sides.

---

<div class="post-metadata">

**Author:** ![Techmod](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@Techmod](https://discuss.elastic.co/u/Techmod)\
**Post date:** [September 12, 2020, 5:20am UTC](https://discuss.elastic.co/t/elasticsearch-setting-up-cluster-with-two-nodes/247994/5 "2020-09-12T05:20:36Z")

</div>

CentOS 7 ,Elasticsearch 7.5 and Kibana 7.5  
Yes and I just updated my config file.

---

<div class="post-metadata">

**Author:** ![Techmod](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@Techmod](https://discuss.elastic.co/u/Techmod)\
**Post date:** [September 15, 2020, 5:28am UTC](https://discuss.elastic.co/t/elasticsearch-setting-up-cluster-with-two-nodes/247994/6 "2020-09-15T05:28:54Z")

</div>

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 !!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 13, 2020, 6:25am UTC](https://discuss.elastic.co/t/elasticsearch-setting-up-cluster-with-two-nodes/247994/8 "2020-10-13T06:25:48Z")

</div>

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