# Failed to obtain node locks, tried \[/usr/share/elasticsearch/data\]; maybe these locations are not writable or multiple nodes were started on the same data path?

**URL:** <https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264>\
**Category:** Elasticsearch\
**Created:** [February 23, 2023, 6:35am UTC](https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264 "2023-02-23T06:35:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![limedong1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limedong1/32/117628_2.png) [@limedong1](https://discuss.elastic.co/u/limedong1)\
**Post date:** [February 23, 2023, 6:35am UTC](https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264/1 "2023-02-23T06:35:16Z")

</div>

I use k8s built a ela cluster, I in the yaml document data directory: / usr/share/elasticsearch/data local hostpath path is: / data/elasticsearch/data

- This is directory permission information:  
drwxr-xr-x. 3 1000 1000 18 Feb 22 11:25 elasticsearch

What if we solved this problem, because we now have one data directory mounted in three containers

---

<div class="post-metadata">

**Author:** ![limedong1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limedong1/32/117628_2.png) [@limedong1](https://discuss.elastic.co/u/limedong1)\
**Post date:** [February 23, 2023, 6:41am UTC](https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264/2 "2023-02-23T06:41:39Z")

</div>

- My elasticsearch image is version 8.6.0

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [February 23, 2023, 6:43am UTC](https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264/3 "2023-02-23T06:43:03Z")

</div>

Welcome to our community! 😃

> [@limedong1](#):
>
> because we now have one data directory mounted in three containers

You can't do that, you need to have something like `/data/elasticsearch/data0`, `/data/elasticsearch/data1`, `/data/elasticsearch/data2`, ie specific directories for each node.

---

<div class="post-metadata">

**Author:** ![limedong1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limedong1/32/117628_2.png) [@limedong1](https://discuss.elastic.co/u/limedong1)\
**Post date:** [February 23, 2023, 6:44am UTC](https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264/4 "2023-02-23T06:44:35Z")

</div>

- I see what you mean,How do I set up a different data directory for each node in the cluster?

---

<div class="post-metadata">

**Author:** ![limedong1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limedong1/32/117628_2.png) [@limedong1](https://discuss.elastic.co/u/limedong1)\
**Post date:** [February 23, 2023, 6:45am UTC](https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264/5 "2023-02-23T06:45:35Z")

</div>

In k8s

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 23, 2023, 6:47am UTC](https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264/6 "2023-02-23T06:47:49Z")

</div>

Each master and data node pod need a dedicated persistent volume.

---

<div class="post-metadata">

**Author:** ![limedong1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/limedong1/32/117628_2.png) [@limedong1](https://discuss.elastic.co/u/limedong1)\
**Post date:** [February 23, 2023, 7:02am UTC](https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264/8 "2023-02-23T07:02:25Z")

</div>

I understand what you mean, but I am not sure how to add a private data directory for each container of ela cluster in k8s

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [February 23, 2023, 7:15am UTC](https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264/9 "2023-02-23T07:15:49Z")

</div>

That is a k8s question and not directly related to Elasticsearch, so I will leave that for someone else.

---

<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:** [March 23, 2023, 7:16am UTC](https://discuss.elastic.co/t/failed-to-obtain-node-locks-tried-usr-share-elasticsearch-data-maybe-these-locations-are-not-writable-or-multiple-nodes-were-started-on-the-same-data-path/326264/10 "2023-03-23T07:16:33Z")

</div>

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