# Cluster recovery after deleting indices directory

**URL:** <https://discuss.elastic.co/t/cluster-recovery-after-deleting-indices-directory/201276>\
**Category:** Elasticsearch\
**Created:** [September 26, 2019, 5:04pm UTC](https://discuss.elastic.co/t/cluster-recovery-after-deleting-indices-directory/201276 "2019-09-26T17:04:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergio\_Peral\_Aguiler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_peral_aguiler/32/45999_2.png) [@Sergio\_Peral\_Aguiler](https://discuss.elastic.co/u/Sergio_Peral_Aguiler)\
**Post date:** [September 26, 2019, 5:04pm UTC](https://discuss.elastic.co/t/cluster-recovery-after-deleting-indices-directory/201276/1 "2019-09-26T17:04:48Z")

</div>

Hello team,  
First of all, thank you for the product.

My question is: is there any way to recover a cluster after having removed the `path.data/nodes/<node>/indices` ? After having done that, my cluster is not able to find any master node. I have `master_not_discovered_exception` error. The credentials for the API are not working either.  
If there's absolutely no way to recover that cluster and the data, how can I bootstrap a new cluster? I've changed the `cluster.name` option in every node and I'm still unable to bootstrap a new cluster.

Please help! Thanks in advance.  
Regards,  
Sergio.

---

<div class="post-metadata">

**Author:** ![manish19](https://avatars.discourse-cdn.com/v4/letter/m/a88e57/32.png) [@manish19](https://discuss.elastic.co/u/manish19)\
**Post date:** [September 27, 2019, 5:33am UTC](https://discuss.elastic.co/t/cluster-recovery-after-deleting-indices-directory/201276/2 "2019-09-27T05:33:41Z")

</div>

Hi @Sergio_Peral_Aguiler,

> [@Sergio\_Peral\_Aguiler](#):
>
> If there's absolutely no way to recover that cluster and the data, how can I bootstrap a new cluster? I've changed the `cluster.name` option in every node and I'm still unable to bootstrap a new cluster.

You can only recover your indices/data if you have snapshot/backup of your data. There is no other way to recover your cluster in elasticsearch. However, for `master_not_discovered_exception` i need the logs to identify the problem.

could you please share the logs for the same?

> [@](#):
>
> I've changed the `cluster.name` option in every node and I'm still unable to bootstrap a new cluster.

can i know what error message are showing while starting elasticsearch cluster?

Thanks,  
Manish

---

<div class="post-metadata">

**Author:** ![Sergio\_Peral\_Aguiler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sergio_peral_aguiler/32/45999_2.png) [@Sergio\_Peral\_Aguiler](https://discuss.elastic.co/u/Sergio_Peral_Aguiler)\
**Post date:** [September 27, 2019, 12:27pm UTC](https://discuss.elastic.co/t/cluster-recovery-after-deleting-indices-directory/201276/3 "2019-09-27T12:27:40Z")

</div>

Hi @manish19,  
Thanks for your response.  
After deleting the `indices` folder, I think the credentials of the cluster were lost/corrupted and the API is throwing `unauthorized` error for every query. Then, I tried to set new credentials and got the following error:  
/usr/share/elasticsearch/bin/elasticsearch-setup-passwords auto

```
Failed to determine the health of the cluster running at [http://ES_IP:9200](http://ES_IP:9200/)
Unexpected response code [503] from calling GET http://ES_IP:9200/_cluster/health?pretty
Cause: master_not_discovered_exception

It is recommended that you resolve the issues with your cluster before running elasticsearch-setup-passwords.
It is very likely that the password changes will fail when run against an unhealthy cluster.

```

In the cluster logs I have:  
[2019-09-26T07:59:49,594][WARN][o.e.h.AbstractHttpServerTransport] [] caught exception while handling client http traffic, closing connection Netty4HttpChannel{localAddress=0.0.0.0/0.0.0.0:9200, remoteAddress=/127.0.0.1:40320}  
Authentication of [elastic] was terminated by realm [reserved] - failed to authenticate user [elastic]  
WARN ][o.e.c.c.ClusterFormationFailureHelper] [xxxxxxxxxxxxxx] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes

I can telnet between nodes through port 9300 and I can see the connections in netstat.

I understand the snapshot part, but I can't recover the snapshot because I can't use the API. How could I make the cluster work again (even though the data is lost)? Or how could I start a new cluster without reinstalling?

Thanks again.  
Regards,  
Sergio.

---

<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 25, 2019, 12:32pm UTC](https://discuss.elastic.co/t/cluster-recovery-after-deleting-indices-directory/201276/4 "2019-10-25T12:32:21Z")

</div>

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