# Indexes cannot be referenced after cluster configuration

**URL:** <https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970>\
**Category:** Elasticsearch\
**Created:** [July 19, 2022, 3:18am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970 "2022-07-19T03:18:34Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![its-ogawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/its-ogawa/32/120829_2.png) [@its-ogawa](https://discuss.elastic.co/u/its-ogawa)\
**Post date:** [July 19, 2022, 3:18am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/1 "2022-07-19T03:18:34Z")

</div>

I am creating an Elasticsearch cluster.  
I am deleting the Elasticsearch node configuration that was already running on a single node and configuring a cluster with two newly created Elasticsearch nodes.

Here, the cluster is built, but the health of the existing index is now red and cannot be referenced from kibana.  
How can I recover them?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 19, 2022, 3:30am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/2 "2022-07-19T03:30:43Z")

</div>

What version are you running?

---

<div class="post-metadata">

**Author:** ![its-ogawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/its-ogawa/32/120829_2.png) [@its-ogawa](https://discuss.elastic.co/u/its-ogawa)\
**Post date:** [July 19, 2022, 3:32am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/3 "2022-07-19T03:32:17Z")

</div>

7.12.0.  
Elasticsearch and Kibana are the same version.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 19, 2022, 3:33am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/4 "2022-07-19T03:33:28Z")

</div>

> [@its-ogawa](#):
>
> I am deleting the Elasticsearch node configuration that was already running on a single node and configuring a cluster with two newly created Elasticsearch nodes.

Can you elaborate more on what you did here?

---

<div class="post-metadata">

**Author:** ![its-ogawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/its-ogawa/32/120829_2.png) [@its-ogawa](https://discuss.elastic.co/u/its-ogawa)\
**Post date:** [July 19, 2022, 3:38am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/5 "2022-07-19T03:38:04Z")

</div>

Stopped existing Elasticsearch and removed directories under nodes.

```auto
# systemctl stop elasticsearch
# rm -rf /var/lib/elasticsearch/nodes/

```

Then, after starting the new Elasticsearch to be added, we started Elasticsearch again.

```auto
# systemctl start elasticsearch

```

The cluster configuration seems to be working.

```auto
# curl -XGET "XXX.XXX.XXX.XXX:9200/_cat/nodes?v"
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
XXX.XXX.XXX.XXX 14 78 1 0.00 0.00 0.00 cdfhilmrstw - ELSTEST-02
XXX.XXX.XXX.XXX 31 97 1 0.00 0.02 0.05 cdfhilmrstw * ELSTEST-01

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 19, 2022, 3:40am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/6 "2022-07-19T03:40:50Z")

</div>

Ok if you have done this;

> [@its-ogawa](#):
>
> ```auto
> # rm -rf /var/lib/elasticsearch/nodes/
> 
> ```

Then it's not surprising that this happens;

> [@its-ogawa](#):
>
> Here, the cluster is built, but the health of the existing index is now red and cannot be referenced from kibana.

As the index data no longer exists.

---

<div class="post-metadata">

**Author:** ![its-ogawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/its-ogawa/32/120829_2.png) [@its-ogawa](https://discuss.elastic.co/u/its-ogawa)\
**Post date:** [July 19, 2022, 3:44am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/7 "2022-07-19T03:44:12Z")

</div>

Oh. That's the bad news.  
What is the correct procedure to configure a cluster while retaining the existing index?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 19, 2022, 3:54am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/8 "2022-07-19T03:54:51Z")

</div>

Take a snapshot and then restore it.

---

<div class="post-metadata">

**Author:** ![its-ogawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/its-ogawa/32/120829_2.png) [@its-ogawa](https://discuss.elastic.co/u/its-ogawa)\
**Post date:** [July 19, 2022, 3:56am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/9 "2022-07-19T03:56:52Z")

</div>

> Completely wipe the node by deleting the contents of its data folder.

> **[Bootstrapping a cluster | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html)**

Does this not imply the above operation?

---

<div class="post-metadata">

**Author:** ![its-ogawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/its-ogawa/32/120829_2.png) [@its-ogawa](https://discuss.elastic.co/u/its-ogawa)\
**Post date:** [July 19, 2022, 4:01am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/10 "2022-07-19T04:01:37Z")

</div>

Does the snapshot need as much disk space as the current index?  
Is it difficult to run Elasticsearch while it is running?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 19, 2022, 4:17am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/11 "2022-07-19T04:17:49Z")

</div>

Yes, but you also need to make note of;

> Once an Elasticsearch node has joined an existing cluster, or bootstrapped a new cluster, it will not join a different cluster.

> [@its-ogawa](#):
>
> Does the snapshot need as much disk space as the current index?  
> Is it difficult to run Elasticsearch while it is running?

Yes, nope!

---

<div class="post-metadata">

**Author:** ![its-ogawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/its-ogawa/32/120829_2.png) [@its-ogawa](https://discuss.elastic.co/u/its-ogawa)\
**Post date:** [July 19, 2022, 5:02am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/12 "2022-07-19T05:02:15Z")

</div>

Yes, I am. I have often struggled with this issue.  
For example, I had the following problems

```auto
#tail -n 100 /var/log/elasticsearch/elasticsearch.log | grep WARN
... snip ...
[2022-07-13T16:42:12,171][WARN][o.e.c.c.ClusterFormationFailureHelper] [ELSTEST-02] master not discovered or elected yet, an election requires a node with id [9DzP6zJnQbevgRgYmpGUug], have only discovered non-quorum [{ELSTEST-02}{fcux0tenQhSC-tuDyJRz_w}{EKW7ln-2RNCO39oRXiQ_uA}{ELSTEST-02}{XXX.XXX.XXX.XXX}{XXX.XXX.XXX.XXX:9300}{cdfhilmrstw}]; discovery will continue using [] from hosts providers and [{ELSTEST-02}{fcux0tenQhSC-tuDyJRz_w}{EKW7ln-2RNCO39oRXiQ_uA}{ELSTEST-02}{XXX.XXX.XXX.XXX}{XXX.XXX.XXX.XXX:9300}{cdfhilmrstw}] from last-known cluster state; node term 20, last-accepted version 756 in term 20

```

To solve this, I decided to delete the node directory, but I did not realize that this operation would break the index.

Is there any way to add a new node without breaking the existing node and index?

---

<div class="post-metadata">

**Author:** ![its-ogawa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/its-ogawa/32/120829_2.png) [@its-ogawa](https://discuss.elastic.co/u/its-ogawa)\
**Post date:** [July 19, 2022, 5:15am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/13 "2022-07-19T05:15:08Z")

</div>

Hmmm, I'm not sure how Elasticsearch behaves.  
Somehow it worked this time.

I started another Elasticsearch with a cluster configuration while I was running a single node Elasticsearch, and then restarted the existing Elasticsearch.

This time I was able to create a cluster configuration without breaking the indexes that the existing Elasticsearch was collecting.

This is my ideal cluster extension.  
Is this a correct operation?

---

<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 16, 2022, 5:15am UTC](https://discuss.elastic.co/t/indexes-cannot-be-referenced-after-cluster-configuration/309970/14 "2022-08-16T05:15:26Z")

</div>

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