Change data path elasticsearch

I am using Elasticsearch Version 5.6.8 . I am changing the elasticsearch path data in elasticsearch.yml to a new folder in a new mountpoint . When i restart the elasticsearch service its giving below error

[2018-06-13T15:49:36,873][ERROR][o.e.b.Bootstrap ] Exception
java.lang.IllegalStateException: detected index data in default.path.data [/var/lib/elasticsearch] where there should not be any; check the logs for details

I have already done chown elasticsearch:elasticsearch for the new folder ..Why is elasticsearch complaining of index data in default.path.data

Please help

Is this the old data path, or the new one?
I assume it's the old one.

This error is telling you that you have configured your ES node to use a custom data path, but you also have index data in the default data path (/var/lib/elasticsearch).
This is almost always a mistake, and if ES starts writing to the new data path, then you will get yourself into a state with diverging indices that probably cannot be recovered correctly.

When you create a new (replacement) data path, you need to manually move the data from the old path to the new path. Feel free to keep a copy of the old data somewhere, but don't keep it in the old data path.

I came about this but for elasticsearch ..looks like same behaviour ..But my elasticsearch is 5.6.8 ..The blog says its fixed from 5.3 versions :frowning:

Please read my reply above.

The behaviour you are seeing is intentional. It is not a bug, it is attempting to prevent your data from being corrupted due to bugs or misconfiguration.

You can read that message as if it were saying:

You have changed the path.data from its default value to another value, but there is still data in the default location. This could be a misconfiguration, or it could be the result of a bug. Please investigate and make sure that your index data in in the correct place before you restart your node.

Ok ..Got it ..Thanks

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