How to rename and join an elasticsearch server preserving data

elasticsearch

I tested elasticsearch and decided to make a cluster. To this I renamed the node and defined a cluster

cluster.name = mycluster
node.name = firstnode

When restarting the changes are taken into account but the existing data is not visible anymore (http://myserver.example.com:9200/_plugin/head/ show no indices).

When removing the two lines above and restarting the indices are back.

How can I rename the node preserving existing data?

Best Answer

It is enough to rename the folder holding the data.

The folder created by default for a standalone server is called elasticsearch, renaming it to the cluster name (mycluster in the context of the question) makes the previous data available.

Related Topic