elasticsearch迁移数据

Posted 春风化作秋雨

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了elasticsearch迁移数据相关的知识,希望对你有一定的参考价值。

1、无密码情况

curl -X POST 'localhost:9200/_reindex?pretty' -H 'content-Type:application/json'  -d  '"source":"remote":"host":"http://172.31.187.255:9200","size":100,"index":"x-pack","query":"match_all":,"dest":"index":"x-pack"'

2、有密码情况

curl -X POST 'localhost:9200/_reindex?pretty' -H 'content-Type:application/json'  -d  '"source":"remote":"host":"http://172.31.187.255:9200","username":"elastic","password":"pica_elastic@1","size":100,"index":"x-pack","query":"match_all":,"dest":"index":"x-pack"'

3、本地服务也有密码

curl --user elastic:pica_elastic@1 -X POST 'localhost:9200/_reindex?pretty' -H 'content-Type:application/json'  -d  '"source":"remote":"host":"http://172.31.187.255:9200","username":"elastic","password":"pica_elastic@1","size":100,"index":"ocm_event_test","query":"match_all":,"dest":"index":"ocm_event_test"'

注意:请求尽量都归为一行,避免不必要的错误。

以上是关于elasticsearch迁移数据的主要内容,如果未能解决你的问题,请参考以下文章

Elasticsearch数据迁移与集群容灾

Elasticsearch 数据迁移

elasticsearch数据迁移——elasticsearch-dump使用

elasticdump 迁移 elasticsearch 数据

Elasticsearch数据迁移或者版本升级,如何快速提升迁移效率?

Elasticsearch数据迁移或者版本升级,如何快速提升迁移效率?