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 ?