cloudserver icon indicating copy to clipboard operation
cloudserver copied to clipboard

localMetadata is getting locked when trying to have more than one replica of cloudserver

Open apoorva-dapake-bh opened this issue 3 years ago • 2 comments

I need to have multiple instances of zenko cloudserver running. To have this I tried changing yaml file to have replicas: 2 as mentioned below:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: zenko
spec:
  **replicas: 2**

But getting error at start up of second pod

{"name":"S3","time":1658382950138,"**error":"IO error: lock /usr/src/app/lib/../localMetadata/rootDB/LOCK: Resource temporarily unavailable"**,"stack":"OpenError: IO error: lock /usr/src/app/lib/../localMetadata/rootDB/LOCK: Resource temporarily unavailable\n at /usr/src/app/node_modules/levelup/lib/levelup.js:119:23\n at /usr/src/app/node_modules/abstract-leveldown/abstract-leveldown.js:38:14\n at /usr/src/app/node_modules/levelup/node_modules/deferred-leveldown/deferred-leveldown.js:31:21\n at /usr/src/app/node_modules/encoding-down/node_modules/abstract-leveldown/abstract-leveldown.js:38:14\n at /usr/src/app/node_modules/abstract-leveldown/abstract-leveldown.js:38:14","level":"fatal","message":"caught error","hostname":"zenko-85b78565d-r24pk","pid":106}

yaml file section for volume mounts:

volumeMounts:
       - name: zenkodata
         mountPath: /usr/src/app/localMetadata
         subPath: localMetadata
       - mountPath: /usr/src/app/locationConfig.json
         subPath: locationConfig.json
         name: locationconfig
volumes:
       - name: zenkodata
         persistentVolumeClaim:
           claimName: zenko-claim
       - configMap:
           name: config-map-zenko
           items:
             - key: locationConfig.json
               path: locationConfig.json              
         name: locationconfig

Please help me to have multiple instances for cloudserver running.

apoorva-dapake-bh avatar Jul 21 '22 15:07 apoorva-dapake-bh

Im receiving the same error aswell, when trying to run multiple replicas. Have you had any luck finding out the cause? Thanks in advance. EDIT: I suspect that it is likely because my storage provisioner for my cluster is just local-path, and that it cannot handle sharing between multiple pods/containers. I haven't had time to test out with using one that can support RWX, but will see if I can test it out later. UPDATE: tested out with a storage class supporting RWX, but it yielded the same error.

andhrs avatar Jul 27 '22 10:07 andhrs