AWS ElasticSearch从远程集群重新索引的问题,包括方案、主机和白名单。

问题描述 投票:0回答:1

背景:我们有两个AWS ElasticSearch集群,版本为6.8,在同一个AWS账户和地区。

  • 我们有两个AWS ElasticSearch集群,版本为6.8,在同一个AWS账户和地区。
  • 我们需要将其中一个索引从集群1(source)重新索引到集群2(dest)。

我试着使用6.8版本的重索引API,就像下面描述的那样 ES的文件

POST <https://endpoint of destination Elasticsearch>/_reindex 

    {
      "source": {
        "remote": {
          "host": "https://endpoint-of-source-elasticsearch-cluster-1.es.amazonaws.com"
        },
        "index": "source-index-name"
      },
      "dest": {
        "index": "destination-index-name"
      }
    }

问题。

我收到以下错误信息

{
    "error": {
        "root_cause": [
            {
                "type": "x_content_parse_exception",
                "reason": "[8:3] [reindex] failed to parse field [source]"
            }
        ],
        "type": "x_content_parse_exception",
        "reason": "[8:3] [reindex] failed to parse field [source]",
        "caused_by": {
            "type": "illegal_argument_exception",
            "reason": "[host] must be of the form [scheme]://[host]:[port](/[pathPrefix])? but was [https://endpoint-of-source-elasticsearch-cluster-1.es.amazonaws.com]",
            "caused_by": {
                "type": "u_r_i_syntax_exception",
                "reason": "The port was not defined in the [host]: https://endpoint-of-source-elasticsearch-cluster-1.es.amazonaws.com"
            }
        }
    },
    "status": 400
}

可能的原因。

  1. 主机参数必须包含方案、主机、端口(如 https:/otherhost:9200)。)按照文档的规定。
  2. 远程主机必须在 elasticsearch.yaml 中使用 reindex.remote.whiteelist 属性显式地加入白名单。

由于我使用的是AWS集群,我不知道如何按照host,post的方案,也不知道如何白名单集群,因为我不知道如何在AWS集群上做这些改动。

请求帮助,如果有什么变通的办法。谢谢。

amazon-web-services elasticsearch aws-lambda cloud elastic-stack
1个回答
3
投票

不幸的是,在AWS托管的Elasticsearch中,你将无法修改静态配置设置,比如reindex.remote.whiteelist参数,因为要配置reindex.remote.whiteelist参数需要修改elasticsearch.yml文件。这是因为AWS ES管理服务,目前客户还没有办法访问OSFile系统。

作为替代品。

  1. 你可以拿一个 手动快照 的域,并将其还原为新的域。与从远程重新索引相比,这种方法一次只影响一个域,即快照来自的域或快照还原到的域。

  2. 您也可以使用 Logstash 与Elasticsearch 输入产出 插件来从您的原始域中的索引中读取数据,并将其编入任何其他的索引。索引域.

© www.soinside.com 2019 - 2024. All rights reserved.