I am getting the following error when I change path.data to /opt/elk,
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 fixed it by deleting nodes in /var/lib/elasticsearch and restarted elasticsearch.
But my question is, shall I delete /var/lib/elasticsearch directory to avoid future issues?
[2017-11-11T18:31:53,983][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
at org.elasticsearch.node.Node.checkForIndexDataInDefaultPathData(Node.java:575) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.node.Node.<init>(Node.java:274) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.node.Node.<init>(Node.java:244) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:232) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:232) ~[elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:351) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.cli.Command.main(Command.java:88) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.5.1.jar:5.5.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.5.1.jar:5.5.1]
[2017-11-11T18:31:53,988][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [prod-coordinating-node] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: detected index data in default.path.data [/var/lib/elasticsearch] where there should not be any; check the logs for details
"/opt/logs/prod.log" 392L, 53453C
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#
path.data: /opt/elk
# Path to log files:
#
path.logs: /opt/logs
#
For my project, I am exactly using Elasticsearc, Logstash, and Kibana. So I named it as ELK.
I am not ingesting any data to elasticsearch at this point. I am still in cluster build out phase and encountered this issue. One more thing to add, I have installed Kibana on the same node. That might have caused the issue because Kibana by default has an index named '.kibana'.
Also, I have read this issue is in elasticsearch 5.3.x and was fixed in further versions. Is this still an issue in 5.5.x too?
You do not need to delete /var/lib/elasticsearch, only relocate any index data that you have there. The message you are seeing should only appear if there are indeed indices in /var/lib/elasticsearch. Are you saying that you're still getting this message even though that path is now free of index data? Can you confirm by providing the output of tree /var/lib/elasticsearch?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.