jimmy
jimmy

Reputation: 2021

Removing Elasticsearch index offline

I have a problem with an elasticsearch instance that refuses to start up and is stuck on Initializing. Elaticsearch stuck using 99% cpu and all shards are Initializing

My guess is that something is wrong with the data stored in one of the indexes. So I am thinking I might just go ahead and remove all the logs and start over. This is not a production system and the logs so far will probably never be used.

However, since the system is still stuck with trying to recover I am not able to remove the index using the REST API. So i was thinking I could probably remove it manually by removing the physical file/folder. So my questions are:

  1. Which file/folder should I remove?
  2. Is it possible to just move the file/folder and recover them again later if I figure out what was wrong?

Upvotes: 1

Views: 1449

Answers (1)

Yeikel
Yeikel

Reputation: 935

As you are not posting your ES version , I will assume that you are running version 2.x

In my local version elasticsearch-2.3.5 and based on my cluster configuration :

 cluster.name: local

Data is stored at

elasticsearch-2.3.5\data\CLUSTERNAME\nodes\x\indices

Where x is the number of the node.

The folder structure here is as follows :

enter image description here

So if you have only one node where replication is not present , if you backup that folder and restore it later , it is okay to do so. Now , if we're talking about more than one node . You will need to stop both nodes before you try to do such operation to avoid possible conflicts.

Steps I did :

-Stop ElasticSearch

-Backup `elasticsearch-2.3.5\data\local`

-Remove `elasticsearch-2.3.5\data\local`

-Start the server

Upvotes: 1

Related Questions