我已经尝试使用elasticdump导出/导入索引。我有两个服务器,在服务器A上是elasticsearch版本5.4,在服务器B上是elasticsearch版本7.10。当我尝试使用elasticdump (2.2)时,我已经在服务器A上尝试过了:
elasticdump --input="http://xx.xxx.xxx.xx:9200/myindex" --output="http://xx.xxx.xxx.xx:9200/myindex" --type=data --searchBody '{"query": { "match_all": {} }, "stored_fields": ["*"], "_source": true }'找到下面的最后几行:
Tue, 26 Jan 2021 08:19:20 GMT | got 100 objects from source elasticsearch (offset: 4900)
Tue, 26 Jan 2021 08:19:20 GMT | sent 100 objects to destination elasticsearch, wrote 0
Tue, 26 Jan 2021 08:19:20 GMT | got 100 objects from source elasticsearch (offset: 5000)
Tue, 26 Jan 2021 08:19:20 GMT | sent 100 objects to destination elasticsearch, wrote 0
Tue, 26 Jan 2021 08:19:20 GMT | got 100 objects from source elasticsearch (offset: 5100)
Tue, 26 Jan 2021 08:19:20 GMT | sent 100 objects to destination elasticsearch, wrote 0
Tue, 26 Jan 2021 08:19:20 GMT | got 32 objects from source elasticsearch (offset: 5200)
Tue, 26 Jan 2021 08:19:20 GMT | sent 32 objects to destination elasticsearch, wrote 0
Tue, 26 Jan 2021 08:19:20 GMT | got 0 objects from source elasticsearch (offset: 5232)
Tue, 26 Jan 2021 08:19:20 GMT | Total Writes: 0
Tue, 26 Jan 2021 08:19:20 GMT | dump complete在另一端没有写入数据。我已经尝试在文件系统上写入转储(json格式)并导入它,结果相同。
你能帮帮忙吗?谢谢
大卫
发布于 2021-01-26 21:57:20
最后,我使用了_reindex:
POST _reindex
{
"source": {
"remote": {
"host": "https://REMOTE_ELASTICSEARCH_ENDPOINT:PORT",
"username": "USER",
"password": "PASSWORD"
},
"index": "INDEX_NAME",
"query": {
"match_all": {}
}
},
"dest": {
"index": "INDEX_NAME"
}
}它工作得很完美。非常感谢
大卫
https://stackoverflow.com/questions/65898018
复制相似问题