# Elasticsearch Failure node lock error

**URL:** <https://discuss.elastic.co/t/elasticsearch-failure-node-lock-error/188015>\
**Category:** Elasticsearch\
**Created:** [June 28, 2019, 9:50am UTC](https://discuss.elastic.co/t/elasticsearch-failure-node-lock-error/188015 "2019-06-28T09:50:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xelrod](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xelrod/32/49521_2.png) [@Xelrod](https://discuss.elastic.co/u/Xelrod)\
**Post date:** [June 28, 2019, 9:50am UTC](https://discuss.elastic.co/t/elasticsearch-failure-node-lock-error/188015/1 "2019-06-28T09:50:38Z")

</div>

Hi,

I've changed the data path to a shared folder under /mnt/share/elasticsearch. And moved the elasticsearch folder there. When I try to start elasticsearch I get the following error.

```
Caused by: java.nio.file.AccessDeniedException: /mnt/share/elasticsearch/nodes/0/node.lock**
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]
        at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:182) ~[?:?]
        at java.nio.channels.FileChannel.open(FileChannel.java:292) ~[?:?]
        at java.nio.channels.FileChannel.open(FileChannel.java:345) ~[?:?]
        at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:125) ~[lucene-core-8.0.0.jar:8.0.0 2ae4746365c1ee72a0047ced7610b2096e438979 - jimczi - 2019-03-08 11:58:55]
        at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41) ~[lucene-core-8.0.0.jar:8.0.0 2ae4746365c1ee72a0047ced7610b2096e438979 - jimczi - 2019-03-08 11:58:55]
        at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45) ~[lucene-core-8.0.0.jar:8.0.0 2ae4746365c1ee72a0047ced7610b2096e438979 - jimczi - 2019-03-08 11:58:55]
        at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:212) ~[elasticsearch-7.1.0.jar:7.1.0]
        at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:267) ~[elasticsearch-7.1.0.jar:7.1.0]
        at org.elasticsearch.node.Node.<init>(Node.java:272) ~[elasticsearch-7.1.0.jar:7.1.0]
        at org.elasticsearch.node.Node.<init>(Node.java:252) ~[elasticsearch-7.1.0.jar:7.1.0]
        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:211) ~[elasticsearch-7.1.0.jar:7.1.0]
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:211) ~[elasticsearch-7.1.0.jar:7.1.0]
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:325) ~[elasticsearch-7.1.0.jar:7.1.0]
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.1.0.jar:7.1.0]
        ... 6 more

```

The permissions on the folder are as follows.

```
root@laboelk01:/var/lock/subsys# ls -l /mnt/share/elasticsearch/                                                                                                  
total 0
drwxr-xr-x 2 root root 0 May 17 15:37 nodes

```

I think it has something to do with node lock but I've been unsuccessful in resolving the issue.  
If anybody could help me out it I would greatly appreciate it.

-Luka

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [June 28, 2019, 11:15am UTC](https://discuss.elastic.co/t/elasticsearch-failure-node-lock-error/188015/2 "2019-06-28T11:15:43Z")

</div>

It looks like your data path is owned by `root` and no other users can modify it, whereas Elasticsearch is not (and should not be) running as `root`. You should change the owner of the data path to the user of the Elasticsearch process.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 26, 2019, 11:15am UTC](https://discuss.elastic.co/t/elasticsearch-failure-node-lock-error/188015/3 "2019-07-26T11:15:51Z")

</div>

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