# Kubernetes scale statefulsets error: \[node.max\_local\_storage\_nodes\] (was \[1\])?

**URL:** <https://community.cratedb.com/t/kubernetes-scale-statefulsets-error-node-max-local-storage-nodes-was-1/1448>\
**Category:** CrateDB\
**Created:** [April 7, 2023, 2:10pm UTC](https://community.cratedb.com/t/kubernetes-scale-statefulsets-error-node-max-local-storage-nodes-was-1/1448 "2023-04-07T14:10:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bla](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@bla](https://community.cratedb.com/u/bla)\
**Post date:** [April 7, 2023, 2:10pm UTC](https://community.cratedb.com/t/kubernetes-scale-statefulsets-error-node-max-local-storage-nodes-was-1/1448/1 "2023-04-07T14:10:19Z")

</div>

Hello,  
I’m trying to run a crateDB, version 4.8.1, on a AKS cluster, in statefulsets, and if I try to scale my service,  
following the documentation.

But I’ve got that error on the secondary pods:

```auto
Defaulted container "crate" out of: crate, init-sysctl (init)
[2023-04-07T13:26:48,051][WARN][o.e.b.ElasticsearchUncaughtExceptionHandler] [cratedb-crate-1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: failed to obtain node locks, tried [[/data/data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
        at org.elasticsearch.bootstrap.StartupExceptionProxy.<init>(StartupExceptionProxy.java:30) ~[crate-app.jar:4.8.1]
        at io.crate.bootstrap.CrateDB.init(CrateDB.java:162) ~[crate-app.jar:4.8.1]
        at io.crate.bootstrap.CrateDB.execute(CrateDB.java:138) ~[crate-app.jar:4.8.1]
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:81) ~[crate-server.jar:?]
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[crate-cli.jar:?]
        at org.elasticsearch.cli.Command.main(Command.java:90) ~[crate-cli.jar:?]
        at io.crate.bootstrap.CrateDB.main(CrateDB.java:91) ~[crate-app.jar:4.8.1]
        at io.crate.bootstrap.CrateDB.main(CrateDB.java:84) ~[crate-app.jar:4.8.1]
Caused by: java.lang.IllegalStateException: failed to obtain node locks, tried [[/data/data]] with lock id [0]; maybe these locations are not writable or multiple nodes were started without increasing [node.max_local_storage_nodes] (was [1])?
        at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:301) ~[crate-server.jar:?]
        at org.elasticsearch.node.Node.<init>(Node.java:306) ~[crate-server.jar:?]
        at io.crate.node.CrateNode.<init>(CrateNode.java:49) ~[crate-app.jar:4.8.1]
        at org.elasticsearch.bootstrap.BootstrapProxy$1.<init>(BootstrapProxy.java:192) ~[crate-app.jar:4.8.1]
        at org.elasticsearch.bootstrap.BootstrapProxy.setup(BootstrapProxy.java:192) ~[crate-app.jar:4.8.1]
        at org.elasticsearch.bootstrap.BootstrapProxy.init(BootstrapProxy.java:266) ~[crate-app.jar:4.8.1]
        at io.crate.bootstrap.CrateDB.init(CrateDB.java:158) ~[crate-app.jar:4.8.1]

```

PVC description:

```auto
Annotations: pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
               volume.beta.kubernetes.io/storage-provisioner: file.csi.azure.com
               volume.kubernetes.io/storage-provisioner: file.csi.azure.com
Finalizers: [kubernetes.io/pvc-protection]
Capacity: 10Gi
Access Modes: RWX
VolumeMode: Filesystem

```

What can I do ?  
Best regards,

Brice

---

<div class="post-metadata">

**Author:** ![proddata](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/proddata/32/1379_2.png) [@proddata](https://community.cratedb.com/u/proddata)\
**Post date:** [April 7, 2023, 2:17pm UTC](https://community.cratedb.com/t/kubernetes-scale-statefulsets-error-node-max-local-storage-nodes-was-1/1448/2 "2023-04-07T14:17:59Z")

</div>

Your PVC has `RWX`(aka. `ReadWriteMany`) as access mode. Your PVC is most likely attached to multiple nodes. While CrateDB nodes could share a volume (though not recommended) they can not share the same data folder (anymore - was possible in older versions).

See our documentation: [CrateDB and Kubernetes — CrateDB: Tutorials](https://crate.io/docs/crate/tutorials/en/latest/containers/kubernetes/kubernetes.html#controller)

```yaml
 volumeClaimTemplates:
    # Use persistent storage.
    - metadata:
        name: data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 1Gi

```

saying `ReadWriteOnce` for [access mode](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes)

---

<div class="post-metadata">

**Author:** ![bla](https://avatars.discourse-cdn.com/v4/letter/b/5f8ce5/32.png) [@bla](https://community.cratedb.com/u/bla)\
**Post date:** [April 7, 2023, 3:35pm UTC](https://community.cratedb.com/t/kubernetes-scale-statefulsets-error-node-max-local-storage-nodes-was-1/1448/3 "2023-04-07T15:35:06Z")

</div>

Thank you for your answer, I’ve try but I’ve got the same error. I presum that the problem is also because I use a fileshare…  
best regards 🙂
