ElasticSearch-如何对现有索引进行一对一复制 [英] ElasticSearch - How to make a 1-to-1 copy of an existing index

查看:999
本文介绍了ElasticSearch-如何对现有索引进行一对一复制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Elasticsearch 2.3.3,并尝试为现有索引进行精确复制。 (使用与Elasticsearch安装捆绑在一起的reindex插件)

I'm using Elasticsearch 2.3.3 and trying to make an exact copy of an existing index. (using the reindex plugin bundled with Elasticsearch installation)

问题是复制了数据,但忽略了诸如映射和分析器之类的设置。

The problem is that the data is copied but settings such as the mapping and the analyzer are left out.

准确复制现有索引(包括所有设置)的最佳方法是什么?

What is the best way to make an exact copy of an existing index, including all of its settings?

我的主要目标是创建副本,更改副本,并且只有在一切顺利的情况下,才将别名切换到该副本。 (零宕机时间的备份和还原)

My main goal is to create a copy, change the copy and only if all went well switch an alias to the copy. (Zero downtime backup and restore)

推荐答案

以下内容似乎完全达到了我想要的目的:

使用快照和还原我能够还原到其他索引:

Using Snapshot And Restore I was able to restore to a different index:

POST / _snapshot / index_backup / snapshot_1 / _restore
{
indices:原始索引,
ignore_unavailable:true,
include_global_state:false,
rename_pattern : original_index,
rename_replacement: replica_index
}

我目前可以说,它已经完全完成了我所需要的。
我的原始索引的1对1副本。

As far as I can currently tell, it has accomplished exactly what I needed. A 1-to-1 copy of my original index.

我还怀疑此操作的性能比为我的目的进行重新索引要好。

I also suspect this operation has better performance than re-indexing for my purposes.

这篇关于ElasticSearch-如何对现有索引进行一对一复制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆