# Trouble setting up an elasticsearch cluster

**URL:** <https://discuss.elastic.co/t/trouble-setting-up-an-elasticsearch-cluster/203245>\
**Category:** Elasticsearch\
**Created:** [October 11, 2019, 1:50pm UTC](https://discuss.elastic.co/t/trouble-setting-up-an-elasticsearch-cluster/203245 "2019-10-11T13:50:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtudisco](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@mtudisco](https://discuss.elastic.co/u/mtudisco)\
**Post date:** [October 11, 2019, 1:50pm UTC](https://discuss.elastic.co/t/trouble-setting-up-an-elasticsearch-cluster/203245/1 "2019-10-11T13:50:12Z")

</div>

Hi, i'm trying to set up a cluster with 3 nodes

es-node1  
es-node2  
es-node3

installed elasticsearch 7.4 on 3 nodes con configure elasticsearch.yml with the following:

```
cluster.name: es-cluster
node.name: es-node1
node.master: true
node.data: true
bootstrap.memory_lock: true
network.host: 0.0.0.0
discovery.seed_hosts: ["es-node1"]
cluster.initial_master_nodes: ["es-node1"]

```

however when i start nodes each node starts its own cluster:

> ```
> [root@es-node1 elasticsearch]# curl -XGET http://192.168.90.225:9200/_cluster/health?pretty
> {
> "cluster_name" : "es-cluster",
> "status" : "yellow",
> "timed_out" : false,
> "number_of_nodes" : 1,
> "number_of_data_nodes" : 1,
> "active_primary_shards" : 85,
> "active_shards" : 85,
> "relocating_shards" : 0,
> "initializing_shards" : 0,
> "unassigned_shards" : 44,
> "delayed_unassigned_shards" : 0,
> "number_of_pending_tasks" : 0,
> "number_of_in_flight_fetch" : 0,
> "task_max_waiting_in_queue_millis" : 0,
> "active_shards_percent_as_number" : 65.89147286821705
> }
> 
> ```

Selinux is in permissive and firewall down to avoid trouble.

Any idea?

---

<div class="post-metadata">

**Author:** ![mtudisco](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@mtudisco](https://discuss.elastic.co/u/mtudisco)\
**Post date:** [October 11, 2019, 6:46pm UTC](https://discuss.elastic.co/t/trouble-setting-up-an-elasticsearch-cluster/203245/2 "2019-10-11T18:46:56Z")

</div>

Finally made it work, had to start each node with a slightliy different configuration

```
node1:
cluster.name: es-cluster
node.name: es-node1
node.master: true
node.data: true
bootstrap.memory_lock: true
network.host: 192.168.90.225
#network.host: 0.0.0.0
discovery.seed_hosts:
 - es-node1
 - es-node2
 - es-node3
cluster.initial_master_nodes:
 - es-node1

node2: 
cluster.name: es-cluster
node.name: es-node2
node.master: true
node.data: true
bootstrap.memory_lock: true
network.host: 192.168.90.226
#network.host: 0.0.0.0
discovery.seed_hosts:
 - es-node1
 - es-node2
 - es-node3
cluster.initial_master_nodes:
 - es-node1
 - es-node2

node3:
cluster.name: es-cluster
node.name: es-node3
node.master: true
node.data: true
bootstrap.memory_lock: true
network.host: 192.168.90.227
#network.host: 0.0.0.0
discovery.seed_hosts:
 - es-node1
 - es-node2
 - es-node3
cluster.initial_master_nodes:
 - es-node1
 - es-node2
 - es-node3
```

---

<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:** [October 12, 2019, 9:03am UTC](https://discuss.elastic.co/t/trouble-setting-up-an-elasticsearch-cluster/203245/3 "2019-10-12T09:03:28Z")

</div>

For the benefit of future readers, the solution described above contains a misconfiguration which can result in data loss. From [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html):

> **WARNING** : You must set `cluster.initial_master_nodes` to the same list of nodes on each node on which it is set in order to be sure that only a single cluster forms during bootstrapping...

This is not what you have done.

---

<div class="post-metadata">

**Author:** ![mtudisco](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@mtudisco](https://discuss.elastic.co/u/mtudisco)\
**Post date:** [October 14, 2019, 12:19pm UTC](https://discuss.elastic.co/t/trouble-setting-up-an-elasticsearch-cluster/203245/4 "2019-10-14T12:19:44Z")

</div>

Thanks David, but with all nodes in cluster.initial\_master\_nodes cluster did not start.  
However in the way i managed to get it started now i see all nodes forming the cluster:

```
curl --cacert /etc/elasticsearch/certs/ca.crt -u elastic -XGET https://192.168.90.225:9200/_cat/nodes?v
Enter host password for user 'elastic':
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.90.226 14 21 0 0.00 0.01 0.05 dilm - es-node2
192.168.90.227 9 21 0 0.00 0.01 0.05 dilm * es-node3
192.168.90.225 8 21 0 0.00 0.01 0.05 dilm - es-node1

```

So i guess i got a single cluster, what else do you think might have been wrong?

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:** [October 14, 2019, 12:24pm UTC](https://discuss.elastic.co/t/trouble-setting-up-an-elasticsearch-cluster/203245/5 "2019-10-14T12:24:39Z")

</div>

> [@mtudisco](#):
>
> So i guess i got a single cluster, what else do you think might have been wrong?

Fortunately it looks like you did indeed get a single cluster, but this was luck. You could have ended up with two.

All three nodes is the correct setting for `cluster.initial_master_nodes ` so I suspect something else was going wrong there. Do you have logs from the case where the cluster did not start? If so can you share them here?

---

<div class="post-metadata">

**Author:** ![mtudisco](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@mtudisco](https://discuss.elastic.co/u/mtudisco)\
**Post date:** [October 14, 2019, 12:29pm UTC](https://discuss.elastic.co/t/trouble-setting-up-an-elasticsearch-cluster/203245/6 "2019-10-14T12:29:52Z")

</div>

Unfortunatelly i dont have logs, whenever it did not work i deleted the logs prior to some modification to avoid having to dig to much into the logs on the next try.

regards

---

<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:** [October 14, 2019, 12:31pm UTC](https://discuss.elastic.co/t/trouble-setting-up-an-elasticsearch-cluster/203245/7 "2019-10-14T12:31:16Z")

</div>

Ok, not to worry. If you manage to reproduce it again then please get back in touch and we'll try and work out what's happening.

---

<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:** [November 11, 2019, 12:31pm UTC](https://discuss.elastic.co/t/trouble-setting-up-an-elasticsearch-cluster/203245/8 "2019-11-11T12:31:21Z")

</div>

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