How to recover data from a renamed Elasticsearch cluster?

I spent most of 12 hours indexing 70 million documents in Elasticsearch (1.4) on a single node installation, one server in Ubuntu 14.04 EC2 block. However, this completed successfully before taking a snapshot of my server. I thought it would be wise to rename the cluster so that it would not accidentally join production boxes in the future, that it was a mistake! After renaming in the elasticsearch.yml file and restarting the ES service, my indexes disappeared.

I saw that the data was still present in the data directory under the old cluster name, I tried to stop the ES by manually moving the data to the file system and then starting the ES service again, but still no luck. Then I tried to rename back to the previous name of the cluster, putting everything in place and still nothing. The data is still there, all 44 GB, but I have no idea how to get it back. I spent the last 2 hours of searching, and all I can find is advice on how to recover from a snapshot that I don’t have. Any advice would be greatly appreciated - I really hope I haven't lost my day job. I will never rename a cluster again!

Thanks in advance.

+6
source share
1 answer

I finally fixed it myself: I stopped the cluster, deleted the nodes directory that was created in the new cluster, copied my old directort nodes for keeping the old structure exactly, launched the elasticsearch folder only in case, started the cluster and sighed with relieved to see 72 million documents!

+8
source

Source: https://habr.com/ru/post/982351/


All Articles