如何从S3存储桶恢复Solr备份



我有一个up&使用solr操作符在Kubernetes上运行SolrCloud v8.11集群。

在S3存储桶上启用了备份。

如何正确写入请求以执行存储在S3存储桶中的备份的RESTORE

我无法弄清楚在向Solr发出的Restore API请求中,我必须提供的locationsnapshotName应该是什么。

为了发现这些值,我尝试执行LISTBACKUP操作,但在这种情况下,location值也是错误的。。。

$ curl https://my-solrcloud.example.org/solr/admin/collections?action=LISTBACKUP&name=collection-name&repository=collection-backup&location=my-s3-bucket/collection-backup
{
"responseHeader":{
"status":400,
"QTime":70},
"error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"specified location s3:///my-s3-bucket/collection-backup/ does not exist.",
"code":400}}
## The Log in cluster writes:
org.apache.solr.common.SolrException: specified location s3:///my-s3-bucket/collection-backup/ does not exist. => org.apache.solr.common.SolrException: specified location s3:///my-s3-bucket/collection-backup/ does not exist.

毕竟,定期备份按预期工作,但迟早会执行RESTORE action,目前尚不清楚如何正确执行。

提前谢谢。

有点晚了,但我在寻找相同答案时遇到了这个问题。邮件列表上有一个帖子帮助我弄清楚了这应该如何工作。

我发现有关这方面的文档非常令人困惑,但location相对于备份存储库似乎是。因此,repository参数已经说明了bucket名称,而name参数将是您试图列出的备份的名称。Solr随后将S3路径构建为CCD_ 11。因此,位置应该简单地为:/

假设您已经为SolrCloud部署设置了backupRepository,如下所示:

backupRepositories:
- name: "my-backup-repo"
s3:
region: "us-east-1"
bucket: "my-s3-bucket"

您已经创建了一个SolrBackup,如下所示:

---
apiVersion: solr.apache.org/v1beta1
kind: SolrBackup
metadata:
name: "my-collection-backup"
spec:
repositoryName: "my-backup-repo"
solrCloud: "my-solr-cloud"
collections:
- "my-collection"

LISTBACKUP的完整cURL命令为:

$ curl https://my-solrcloud.example.org/solr/admin/collections 
-d action=LISTBACKUP 
-d name=my-collection-backup 
-d repository=my-backup-repo 
-d location=/

与RESTORE命令类似:

$ curl https://my-solrcloud.example.org/solr/admin/collections 
-d action=RESTORE 
-d name=my-collection-backup 
-d repository=my-backup-repo 
-d location=/ 
-d collection=my-collection-restore

我遇到了同样的问题,解决方案是添加集合名称作为后缀:

"name" => SolrBackup.metadata.name + '-' + SolrBackup.spec.collection

来自@matthew的例子:

curl -X POST http://localhost:8983/v2/collections/backups -H 'Content-Type: application/json' -d '
{
"list-backups" : {
"name": "my-collection-backup-my-collection",
"repository": "my-backup-repo",
"location": "/"
}
}
'

参考Git问题

最新更新