# Can't get a two-node cluster to work

**URL:** <https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140>\
**Category:** Elasticsearch\
**Created:** [August 24, 2020, 2:49pm UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140 "2020-08-24T14:49:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arp](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Arp](https://discuss.elastic.co/u/Arp)\
**Post date:** [August 24, 2020, 2:49pm UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140/1 "2020-08-24T14:49:55Z")

</div>

Hi,

So, I installed oss-7.9 on two VMs with RH8.  
All I want is a cluster with two nodes, of which one acts as a replica.

I have the same config on both VMs, though of course with different IPs and node names, differences are shown in brackets:

```
 cluster.name: "cluster-3"
 node.name: "node-1" ["node-2"]
 network.host: 10.0.2.39 [10.0.2.32]
 http.port: 9200
 transport.host: 10.0.2.39
 transport.port: 9300
 node.master: true
 node.data: true
 discovery.zen.ping.unicast.hosts: ["10.0.2.32:9300","10.0.2.39:9300"]
 discovery.zen.minimum_master_nodes: 2

```

But looking at the cluster state on either of the machines, it never shows two nodes.  
I don't think that any important port is blocked. I can even use curl from one machine to look at the state on the other.

Any suggestions?

(Please don't tell me that the oss version does not support this 🙂 )

Thanks.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [August 24, 2020, 6:56pm UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140/2 "2020-08-24T18:56:52Z")

</div>

The OSS version does indeed support this (but the default distribution is recommended for a large number of other reasons).

The `discovery.zen.*` settings are obsolete in this version and should be removed. Instead, configure things following the [instructions on this page](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/discovery-settings.html). You'll probably have to wipe the data path of both nodes too since they've likely formed independent clusters which cannot now be merged together.

---

<div class="post-metadata">

**Author:** ![Steve\_Mushero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steve_mushero/32/22441_2.png) [@Steve\_Mushero](https://discuss.elastic.co/u/Steve_Mushero)\
**Post date:** [August 25, 2020, 2:09am UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140/3 "2020-08-25T02:09:28Z")

</div>

> [@Arp](#):
>
> `transport.host: 10.0.2.39`

Hope that's not the same on both nodes - best to not set transport.host at all, so it'll just use your network.host setting, which (in my opinion) should be set to 0.0.0.0 for simplicity and consistency across nodes.

---

<div class="post-metadata">

**Author:** ![Arp](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Arp](https://discuss.elastic.co/u/Arp)\
**Post date:** [August 25, 2020, 7:53am UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140/4 "2020-08-25T07:53:10Z")

</div>

Thanks, I will give it a try.  
if I restart the elasticsearch service, or stop and start it manually, how do I prevent them from forming their own node and instead wait to see if there is another one?

---

<div class="post-metadata">

**Author:** ![Arp](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Arp](https://discuss.elastic.co/u/Arp)\
**Post date:** [August 25, 2020, 8:04am UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140/5 "2020-08-25T08:04:13Z")

</div>

Thanks, I removed it.

---

<div class="post-metadata">

**Author:** ![Arp](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Arp](https://discuss.elastic.co/u/Arp)\
**Post date:** [August 25, 2020, 8:05am UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140/6 "2020-08-25T08:05:14Z")

</div>

It is working! Thanks.

Though it's weird, I'm pretty sure I tried this configuration already, using discovery.seed.. and not using transport.host...  
But I never deleted the data path ...

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [August 25, 2020, 8:41am UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140/7 "2020-08-25T08:41:39Z")

</div>

> [@Arp](#):
>
> how do I prevent them from forming their own node and instead wait to see if there is another one

This is covered in [these docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html#_auto_bootstrapping_in_development_mode), but the TLDR is that setting `discovery.seed_hosts` disables auto-bootstrapping.

Also see the **NOTE** at the bottom of that page which says if you did accidentally auto-bootstrap then you should wipe the nodes and start again.

Steve's right too, you only need `transport.host` if you have a strange setup involving listening on multiple interfaces. Almost always you want to set `network.host` only. Also no need to set `http.port` or `transport.port`, nor to mention `:9300` in the seed hosts, nor to set the node roles. IOW this is all you need:

```auto
 cluster.name: "cluster-3"
 node.name: "node-1" # [resp. "node-2"]
 network.host: "10.0.2.39" # [resp. "10.0.2.32"]
 discovery.seed_hosts: ["10.0.2.32","10.0.2.39"]

```

(also `cluster.initial_master_nodes: ["node-1","node-2"]`, but only the first time you run them)

---

<div class="post-metadata">

**Author:** ![Arp](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Arp](https://discuss.elastic.co/u/Arp)\
**Post date:** [August 31, 2020, 8:54am UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140/8 "2020-08-31T08:54:53Z")

</div>

Hi again.

One more thing: This is still working and is nice. Node 2 automatically gets the same messages as node 1.

But I noticed, that if I disconnect node 2, for some reason, I can reload kibana on node 2, but on node 1 I get a timeout, and rsyslog messages are not saved in elasticsearch ...

Is there an option to have node 1 still receive messages and node 2 to just resync after it is online again?

I remember seeing a minimum master nodes option, but I think this was for zen, which is not supposed to be used anymore.

---

<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:** [August 31, 2020, 8:58am UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140/9 "2020-08-31T08:58:37Z")

</div>

For high availability [you need a minimum of 3 nodes](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/high-availability-cluster-small-clusters.html).

---

<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:** [September 28, 2020, 8:58am UTC](https://discuss.elastic.co/t/cant-get-a-two-node-cluster-to-work/246140/10 "2020-09-28T08:58:41Z")

</div>

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