Stackoverflow user
Stackoverflow user

Reputation: 61

Solr backup, restore, listbackup api doesn't work

I installed Solr cluster on kubernetes (ubuntu) as per below links .

https://artifacthub.io/packages/helm/apache-solr/solr-operator https://artifacthub.io/packages/helm/apache-solr/solr

I mount cifs storage and created persistent volume as per below link.

https://github.com/kubernetes-csi/csi-driver-smb

I use that persistent volume to backup Solr as per below link.

https://apache.github.io/solr-operator/docs/solr-backup/

When I run backup (yaml as specified in the link) from within Kubernetes, its working fine. And it creates a backup.

But when i call backup api with - http://solrserver/solr/admin/collections?action=BACKUP&name=bkpname&collection=collection&repository=repositoryname&location=/; getting AccessDeniedException

when i call listbackup or restore, getting below errors respectively.

Incremental backup URI [file:///bkpname] expected to hold a single directory. Number found: 0" ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0

Upvotes: 1

Views: 530

Answers (1)

khichar.anil
khichar.anil

Reputation: 4984

I also got the same error and finally resolved it by adding collection name as suffix.

Carefully review the folder created at the backup location. In my case it was Amazon S3 and the backup created with a folder/prefix name <backup_name>-<collection_name>

Here is the working command:

curl http://localhost:8983/solr/admin/collections \
  -d action=LISTBACKUP \
  -d name=solr-backup-<collection_name>\
  -d repository=solr-backup-s3-repo \
  -d location=/

curl http://localhost:8983/solr/admin/collections \
  -d action=RESTORE \
  -d name=solr-backup-<collection_name> \
  -d repository=solr-backup-s3-repo \
  -d location=/ \
  -d collection=<collection_name>

Upvotes: 0

Related Questions