# Elasticsearch failed to start when running with PVC in OKE

**URL:** <https://discuss.elastic.co/t/elasticsearch-failed-to-start-when-running-with-pvc-in-oke/363340>\
**Category:** Elasticsearch\
**Created:** [July 18, 2024, 9:38am UTC](https://discuss.elastic.co/t/elasticsearch-failed-to-start-when-running-with-pvc-in-oke/363340 "2024-07-18T09:38:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Praveen\_Reddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveen_reddy/32/111480_2.png) [@Praveen\_Reddy](https://discuss.elastic.co/u/Praveen_Reddy)\
**Post date:** [July 18, 2024, 9:38am UTC](https://discuss.elastic.co/t/elasticsearch-failed-to-start-when-running-with-pvc-in-oke/363340/1 "2024-07-18T09:38:21Z")

</div>

Elastic failing to start with below error. When i don't link any mount points then it is working. But when i link with PVC it fails to start. Looks like it is related to permission issue.

"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?",  
"error.stack\_trace":"java.lang.IllegalStateException: failed to obtain node locks, tried [/usr/share/elasticsearch/data];

**My PVC is like below**  
apiVersion: v1  
kind: PersistentVolumeClaim  
metadata:  
name: esdata-pvc  
spec:  
accessModes:  
- ReadWriteOnce  
resources:  
requests:  
storage: 10Gi

and i am using in my deployment file like below

```
      volumeMounts:
        - name: esdata
          mountPath: /usr/share/elasticsearch/data

  volumes:
    - name: esdata
      persistentVolumeClaim:
        claimName: esdata-pvc

```

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [July 18, 2024, 12:38pm UTC](https://discuss.elastic.co/t/elasticsearch-failed-to-start-when-running-with-pvc-in-oke/363340/2 "2024-07-18T12:38:52Z")

</div>

Hi @Praveen_Reddy ,

Welcome! Do you have another Elasticsearch process already running? This could be the process is unable to get a lock on these locations as another Elasticsearch process has the lock.

---

<div class="post-metadata">

**Author:** ![Praveen\_Reddy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/praveen_reddy/32/111480_2.png) [@Praveen\_Reddy](https://discuss.elastic.co/u/Praveen_Reddy)\
**Post date:** [July 18, 2024, 1:00pm UTC](https://discuss.elastic.co/t/elasticsearch-failed-to-start-when-running-with-pvc-in-oke/363340/3 "2024-07-18T13:00:00Z")

</div>

No. I have only one elastic running. Also what i notice is with docker compose testing, the mount point if i create manaully it is working fine where as if the process itslef creating the mount point i see same behavior

volumes:  
- ./elasticsearch-data:/usr/share/elasticsearch/data
