我正在尝试将原来的1.5弹性索引升级到6.0,根据docs (https://www.elastic.co/guide/en/elasticsearch/reference/6.0/reindex-upgrade.html),我可以在6.0中创建一个新的索引,然后使用remote reindex (https://www.elastic.co/guide/en/elasticsearch/reference/6.0/reindex-upgrade-remote.html)从远程重新索引。
这两个实例都在码头容器中运行,我只是想在实际生产中之前在本地测试这一点。
我可以看到在我的旧索引中有索引的文档.
curl -XGET 'http://localhost:9200/old_index/_search?pretty'
{
"took" : 8,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
"_index" : "old_index",
"_type" : "item",
"_id" : "92",
"_score" : 1.0,
"_source":{"user_id":3,"slug":"asdfaisjeilej","name":"lake.jpgasdad","item_type":"image","created_at":"2018-01-23T18:11:30Z","deleted_at":null,"content_length":1252171}
}]}
}在我的ElasticSearch6.0实例中创建了一个新的索引(new_index)之后,通过稍微不同的映射(将字符串类型更改为文本),然后使用以下命令从远程重新索引。(注意:与我在端口9400中运行的其他实例相比)
curl -XPOST 'localhost:9400/_reindex?pretty' -H 'Content-Type: application/json' -d'
{
"source": {
"remote": {
"host": "http://localhost:9200"
},
"index": "old_index"
},
"dest": {
"index": "new_index"
}
}我得到以下答复
{
"took" : 136,
"timed_out" : false,
"total" : 0,
"updated" : 0,
"created" : 0,
"deleted" : 0,
"batches" : 0,
"version_conflicts" : 0,
"noops" : 0,
"retries" : {
"bulk" : 0,
"search" : 0
},
"throttled_millis" : 0,
"requests_per_second" : -1.0,
"throttled_until_millis" : 0,
"failures" : [ ]
}因此,基本上,来自old_index的文档没有被复制到new_index中,我不知道为什么会发生这种情况。是否有一步我错过了,我正在跟踪的elasticsearch文档,与他们明显地读。
发布于 2018-11-06 10:10:13
正如我所提到的,在从Elasticsearch-2迁移到Elasticsearch-6之前,我在没有dockers的暂存环境中测试了远程重新索引时,也遇到了同样的问题。我的解决办法是创建一个旧版本的实例(不是在docker上),从备份加载它,并从它重新索引到没有在docker上运行的elasticsearch 6实例。
如果仍然希望在docker上运行elasticsearch 6,则始终可以将数据加载到容器中。
希望你觉得这有帮助。
https://stackoverflow.com/questions/48532332
复制相似问题