How to solve node lock error in elasticsearch?

Elasticsearch is successfully run but after get some response i got this type of error.

"java.lang.IllegalStateException: Failed to obtain node lock, is the following location writable?: [/media/amit/208B7C972F88BACC/elasticsearch-2.1.0/data/elasticsearch]"

How can i resolved it?

There might be more to the exception telling you the cause of the failure to the obtain the node lock. Do you have that detail as well? If not, you can also start Elasticsearch with trace logging: ./bin/elasticsearch --loggger.env=TRACE which might print more detail while it's trying to obtain the lock. Either there will be an underlying IOException (maybe you do not have write permissions as the error message suggests) or there was a failure obtaining the lock (a race condition with another node started at the same time?). It's also possible that there is a leftover unreleased node.lock file? If so, you can just remove this file.

2 Likes