# How does one setup a clustered elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-does-one-setup-a-clustered-elasticsearch/190017>\
**Category:** Elasticsearch\
**Created:** [July 11, 2019, 1:06pm UTC](https://discuss.elastic.co/t/how-does-one-setup-a-clustered-elasticsearch/190017 "2019-07-11T13:06:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maasid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maasid/32/48327_2.png) [@maasid](https://discuss.elastic.co/u/maasid)\
**Post date:** [July 11, 2019, 1:06pm UTC](https://discuss.elastic.co/t/how-does-one-setup-a-clustered-elasticsearch/190017/1 "2019-07-11T13:06:31Z")

</div>

Hello,

I'm on the verge of raging and flipping my desk. I have tried to setup a elasticsearch cluster version 7.2.0 and this is just not working. Here's my problem: Each master node is creating their own single node cluster. I understand why this is happening as my config says the following:

```
cluster.initial_master_nodes:
 - ${NODE_NAME}
discovery.seed_hosts:
 - ${NODE_NAME}

```

# Above is issue 1. So lets say I put in the following config:

```
cluster.initial_master_nodes:
      - elasticsearch-master01
      - elasticsearch-master02
      - elasticsearch-master03
 discovery.seed_hosts:
      - ${NODE_NAME}

```

Then I get the following error in my logs:

```
"message": "skipping cluster bootstrapping as local node does not match bootstrap requirements: [elasticsearch-master01, elasticsearch-master02, elasticsearch-master03]"
"message": "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-master01, elasticsearch-master02, elasticsearch-master03] to bootstrap a cluster: have discovered []; discovery will continue using [] from hosts providers and.....

```

# Above is issue 2. So lets say I put in the following config:

```
cluster.initial_master_nodes:
      - elasticsearch-master01
      - elasticsearch-master02
      - elasticsearch-master03

 discovery.seed_hosts:
      - elasticsearch-discovery

```

Then guess what....I get the same error as number 2.

```
"message": "skipping cluster bootstrapping as local node does not match bootstrap requirements: [elasticsearch-master01, elasticsearch-master02, elasticsearch-master03]"
"message": "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-master01, elasticsearch-master02, elasticsearch-master03] to bootstrap a cluster: have discovered []; discovery will continue using [] from hosts providers and.....

```

# Above is issue 3. Issue number 3's config is based on elasticsearch own configuration:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/discovery-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/discovery-settings.html)

I use the default port on the discovery 9300.

Here is my complete config:

```
cluster:
  name: elastic

node.master: true
node.data: true
node.ingest: true

processors: ${PROCESSORS:1}

network.host: 0.0.0.0

cluster.initial_master_nodes:
  - elasticsearch-master01
  - elasticsearch-master02
  - elasticsearch-master03

path:
  data: /data/data
  logs: /data/log

discovery.seed_hosts:
  - elasticsearch-discovery

xpack.license.self_generated.type: basic
xpack.monitoring.enabled: true
xpack.security.enabled: true
xpack.watcher.enabled: false
xpack.ml.enabled: false
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /usr/share/elasticsearch/config/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /usr/share/elasticsearch/config/elastic-certificates.p12

xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.verification_mode: certificate
xpack.security.http.ssl.keystore.path: /usr/share/elasticsearch/config/elastic-certificates.p12
xpack.security.http.ssl.truststore.path: /usr/share/elasticsearch/config/elastic-certificates.p12
xpack.security.http.ssl.client_authentication: optional

```

SO! I must have missed something, can someone please explain what.

---

<div class="post-metadata">

**Author:** ![maasid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/maasid/32/48327_2.png) [@maasid](https://discuss.elastic.co/u/maasid)\
**Post date:** [July 11, 2019, 1:19pm UTC](https://discuss.elastic.co/t/how-does-one-setup-a-clustered-elasticsearch/190017/2 "2019-07-11T13:19:07Z")

</div>

Solved! for anyone who comes accross this, you have to match you pod name with the name in the cluster.initial\_master\_nodes:

I did this by setting a static name in the NODE\_NAME in my deployment file and then in the config, node.name: ${NODE\_NAME}

---

<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:** [July 11, 2019, 2:34pm UTC](https://discuss.elastic.co/t/how-does-one-setup-a-clustered-elasticsearch/190017/3 "2019-07-11T14:34:44Z")

</div>

Yes, that looks like it was exactly the problem. Here is a [link to the relevant docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html#modules-discovery-bootstrap-cluster-fqdns) to give future readers a bit more context too:

> The node names used in the `cluster.initial_master_nodes` list must exactly match the `node.name` properties of the nodes.

---

<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:** [August 8, 2019, 2:34pm UTC](https://discuss.elastic.co/t/how-does-one-setup-a-clustered-elasticsearch/190017/4 "2019-08-08T14:34:51Z")

</div>

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