Change data path elasticsearch

(Sreejith) #1

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 [/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

Please help

(Tim Vernum) #2

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.

(Sreejith) #3

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:

(Tim Vernum) #4

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 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.

(Sreejith) #5

Ok ..Got it ..Thanks

(system) #6

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