elasticsearch fail to start gives erorr elasticsearch fail to start gives erorr elasticsearch elasticsearch

elasticsearch fail to start gives erorr


Look in /etc/sysconfig/elasticsearch for the values of ES_USER and ES_GROUP -- the default setting for both is elasticsearch. If that user cannot write to your data directory, then you will see this error. Since the data directory appears to be under your home directory, this could be the issue. You can either modify the settings for ES_USER and ES_GROUP or change the permissions for the data directory.


There could be multiple causes of this error, Elasticsearch stores its data in the file system and location of that is specified in elasticsearch.yml and while starting elasticsearch, it checks whether it can write data to that location or not, if yes, then it would acquire a lock on that location so that other process can't write to that location which prevents the data loss and corruption.

Also, this depends on the version of Elasticsearch, in current major version 7.X, Elasticsearch changed the way it writes to the same location when there are multiple installations on the same machine and before that it used node.max_local_storage_nodes to allow multiple installations on the same machine.

Tips to fix the issue

  1. Check if multiple Elasticsearch process is running and you intend to do it.
  2. Check if Elasticsearch have write access to the location, as mentioned in the previous answer.
  3. Check the version of elasticsearch and see if you are using the correct configuration.