Issue while creating snapshot error - path.repo setting is empty

I have a secure elasticsearch cluster running in kubernetes environment. I want to enable snapshots for the same. I added path.repo in config and also mounted persistent volume to be used as a repo.

path.repo: ["/mnt/snapshots"]

Using below volumeMount:

  • name: elasticsearch-snapshots
    mountPath: /mnt/snapshots

Volumes:-

  • name: elasticsearch-snapshots
    persistentVolumeClaim:
    claimName: snapshots

pvc.yaml:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: snapshots
spec:
accessModes:

  • ReadWriteOnce
    resources:
    requests:
    storage: 10Gi

I used the api command to create repo but got below error -:

curl -XPUT --cacert crt.pem -u elastic:password "https://es-coordinating.gbi-gotu.svc.lb.usrno1.mine.io:9200/_snapshot/snapshot-repo" -H 'Content-Type: application/json' -d'

{

"type": "fs",

"settings": {

"location": "/mnt/snapshots"

}

}

'

{"error":{"root_cause":[{"type":"repository_exception","reason":"[snapshot-repo] location [/mnt/snapshots] doesn't match any of the locations specified by path.repo because this setting is empty"}],"type":"repository_exception","reason":"[snapshot-repo] failed to create repository","caused_by":{"type":"repository_exception","reason":"[snapshot-repo] location [/mnt/snapshots] doesn't match any of the locations specified by path.repo because this setting is empty"}},"status":500}

I have added the same path.repo field to other nodes also but do I need to mount the same PVC to other nodes as well ?

All nodes in the cluster must have exactly the same setting and the path it points to must be a shared file system that all nodes can access.

Thanks for the response. This has more to do with the kubernetes side issue as I'm unable to create a PVC with ReadWriteMany so as to share it among different pods.
Do you know anything supported out of the box in kubernetes for this ?

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