gpt4 book ai didi

elasticsearch - Windows上的ElasticSearch备份,Linux上的Restore

转载 作者:行者123 更新时间:2023-12-02 23:20:14 26 4
gpt4 key购买 nike

我正在尝试在Windows上的ElasticSearch 6.2.2中备份索引并在Linux上的ElasticSearch 6.2.3上还原它。我正在执行以下步骤,但是在Linux机器(基于https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html)上却看不到快照:

在Windows上注册快照存储库

PUT /_snapshot/my_backup
{
"type": "fs",
"settings": {
"location": "C:\\EsBackup",
"compress": true
}
}

在Windows上创建快照
PUT /_snapshot/my_backup/bcp?wait_for_completion=true
{
"indices":"myindex"
}

检查快照是否已创建
GET /_snapshot/my_backup/bcp

显示成功
{
"snapshots": [
{
"snapshot": "bcp",
"uuid": "xGLvw4JnRqadcyg4fxH1HA",
"version_id": 6020299,
"version": "6.2.2",
"indices": [
"bcp"
],
"include_global_state": true,
"state": "SUCCESS",
"start_time": "2018-05-10T16:48:22.970Z",
"start_time_in_millis": 1525970902970,
"end_time": "2018-05-10T16:48:36.816Z",
"end_time_in_millis": 1525970916816,
"duration_in_millis": 13846,
"failures": [],
"shards": {
"total": 3,
"failed": 0,
"successful": 3
}
}
]
}

我将文件复制到linux,并检查文件的大小和数量是否相同。 (大约200个文件,大小为500MB)。我将所有内容复制到文件夹 ~/elasticsearch-6.2.3/backup
初始化存储库
curl -X PUT "localhost:9200/_snapshot/my_backup" -H 'Content-Type: application/json' -d'{"type": "fs","settings": {"location": "~/elasticsearch-6.2.3/backup","compress": true}}'

并得到确认: {"acknowledged":true}
所以我检查哪些快照可用
curl -X GET "localhost:9200/_snapshot/my_backup/_status"

但列表为空 {"snapshots":[]}
并还原
curl -X POST "localhost:9200/_snapshot/my_backup/bcp/_restore?pretty"

返回错误
{
"error" : {
"root_cause" : [
{
"type" : "snapshot_restore_exception",
"reason" : "[my_backup:bcp] snapshot does not exist"
}
],
"type" : "snapshot_restore_exception",
"reason" : "[my_backup:bcp] snapshot does not exist"
},
"status" : 500
}

我想走哪一步?我试图_verify存储库,它是有效的。版本6.2.2和6.2.3应该兼容。

最佳答案

elasticsearch.yml文件中添加以下内容:

path.repo: /path/to/repo

关于elasticsearch - Windows上的ElasticSearch备份,Linux上的Restore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50278255/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com