您需要为您的 Logstash 和 Talend ESB 索引重建索引。
步骤
-
运行以下命令查看所有现有的索引:
curl -XGET 'oldhost9200/_cat/indices'
将oldhost
替换为在 7.2.x 中使用的 Elasticsearch 集群的 IP 地址或主机名。 -
从远程集群为您的 Logstash 索引重建索引,以便将文档从 7.2.x 中使用的索引转换为 7.3.x 中使用的索引:
curl -XPOST 'localhost:9200/_reindex?pretty' -H 'Content-Type: application/json' -d' { "source": { "remote": { "host": "http://oldhost:9200" }, "index": "logstash-YYYY.MM.dd" }, "dest": { "index": "logstash-YYYY.MM.dd" } } '
-
从远程集群为您的 Talend ESB 索引重建索引,以便将文档从 6.5.x 中使用的索引转换为 7.3.x 中使用的索引:
curl -XPOST 'localhost:9200/_reindex?pretty' -H 'Content-Type: application/json' -d' { "source": { "remote": { "host": "http://oldhost:9200" }, "index": "talendesb-YYYY.MM.dd" }, "dest": { "index": "talendesb-YYYY.MM.dd" } } '
注:您必须逐一迁移所有
logstash-YYYY.MM.dd
和talendesb-YYYY.MM.dd
索引,或仅选择您想要迁移的索引。ⓘ适用产品:
Big Data Platform
如果您指定 logstash-* 作为索引名称,您将收到类似如下所示的错误:
ⓘ适用产品:
Data Fabric
Data Management Platform
Data Services Platform
MDM Platform
Real-Time Big Data Platform
如果您指定 logstash-* 或 talendesb-* 作为索引名称,您将收到类似如下所示的错误:
"failures" : [ { "index" : "logstash-*", "type" : "xxxxxxxx", "id" : "xxxxxxxxxxxxxx", "cause" : { "type" : "invalid_index_name_exception", "reason" : "Invalid index name [logstash-*], must not contain the following characters [ , \", *, \\, <, |, ,, >, /, ?]", "index_uuid" : "_na_", "index" : "logstash-*" }, "status" : 400 }, { "index" : "logstash-*", "type" : "xxxxxx", "id" : "xxxxxxxxxxxxxxx", "cause" : { "type" : "invalid_index_name_exception", "reason" : "Invalid index name [logstash-*], must not contain the following characters [ , \", *, \\, <, |, ,, >, /, ?]", "index_uuid" : "_na_", "index" : "logstash-*" }, "status" : 400 } ]