Elasticsearch won\'t start using ./bin/elasticsearch
.
It raises the following exception:
- ElasticsearchIllegalStateException[Failed to obtain n
As with many others here replying, this was caused by wrong permissions on the directory (not owned by the elasticsearch user). In our case it was caused by uninstalling Elasticsearch and reinstalling it (via yum, using the official repositories).
As of this moment, the repos do not delete the nodes
directory when they are uninstalled, but they do delete the elasticsearch
user/group that owns it. So then when Elasticsearch is reinstalled, a new, different elasticsearch
user/group is created, leaving the old nodes
directory still present, but owned by the old UID/GID. This then conflicts and causes the error.
A recursive chown as mentioned by @oleksii is the solution.