gpt4 book ai didi

elasticsearch - 如何从备份还原到新索引?

转载 作者:行者123 更新时间:2023-12-02 22:56:37 26 4
gpt4 key购买 nike

从备份中还原数据时,我有些困惑。我使用以下命令创建了索引的备份:

PUT /_snapshot/my_backup
{
"type": "fs",
"settings": {
"location": "D:\\my_backup"
}
}


PUT /_snapshot/my_backup/snapshot_1?wait_for_completion=true
{
"indices": "customers",
"ignore_unavailable": true,
"include_global_state": false
}

然后,我从我的elasticsearch中删除所有索引。现在,我想从备份中恢复。我能怎么做?我检查了文档,然后感到更加困惑。

我目前正在尝试追踪
POST /_snapshot/my_backup/snapshot_1/_restore
{
"indices": "ecommerce",
"ignore_unavailable": "true",
"include_global_state": false,
"rename_pattern": "ecommerce",
"rename_replacement": "jal1"
}

请帮忙。我想从给定的备份中还原。

最佳答案

尝试检查备份数据的索引名称。在你的情况下尝试

GET http://localhost:9200/_snapshot/my_backup/_all

您可以找到提供的索引名称。

现在,您可以将后置查询与上述查询中的索引一起使用
POST /_snapshot/my_backup/snapshot_1/_restore
{
"indices": "your_indices_name",
"ignore_unavailable": "true",
"include_global_state": false,
"rename_pattern": "your_indices_name",
"rename_replacement": "your_new_indices_name"
}

希望这对您有用。

关于elasticsearch - 如何从备份还原到新索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51740113/

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