Good morning.
Some colleagues in the office requested me to investigate how could they create a backup policy for their indices.
The first doubt I have is if using a NFS directory could work as an approach.
The master nodes and data nodes would include the path.repo to that directory.
This is something I managed to do at home with VMs but I would like to apply that strategy also to K8s
If this is possible my colleagues dont want to use Kibana to manage the snapshot. So the option would be creating snapshot on daily basis and eventually running a restore from CLI too.
From the dev tool at home I managed to run succesfully the restore from the DevTools section in Kibana.
I runned:
POST /_snapshot/my_fs_backup/my_snapshot_2022.11.12/_restore
{
"indices": ".ds-filebeat-8.4.3-2022.11.04-000001,filebeat-8.4.3"
}
And it work perfectly
Now I tried to do it from the ubuntu's cli at home by using:
curl -XPUT --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic:blablabla "https://localhost:9200/_snapshot/my_fs_backup/my_snapshot_2022.11.12/_restore" -d '{ "indices": ".dWs-filebeat-8.4.3-2022.11.04-000001,filebeat-8.4.3"}}'
Which returned:
{"error":"Incorrect HTTP method for uri [/_snapshot/my_fs_backup/my_snapshot_2022.11.12/_restore] and method [PUT], allowed: [POST]","status":405}
I tried
curl -PUT --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic:blablabla "https://localhost:9200/_snapshot/my_fs_backup/my_snapshot_2022.11.12/_restore" -d '{ "indices": ".dWs-filebeat-8.4.3-2022.11.04-000001,filebeat-8.4.3"}}'
which returned
{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406}
And well, this are basically my questions.
A) Can I use this approach in our own self-manage K8s cluster to backup snapshot (NFS+CLI commands)?
B) what is the right syntax I should use?
Thank you very much and best regards.