Background:
- We have two AWS ElasticSearch clusters on version 6.8 in same AWS account and region.
- We need to reindex one of the index from cluster 1 (source) to cluster 2 (dest).
I tried to use reindex API for 6.8 as described in documentation of 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"
}
}
Problem:
I'm getting below error
{
"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
}
Probable cause:
- The host parameter must contain a scheme, host, port (e.g. https://otherhost:9200) as per doc.
- Remote hosts have to be explicitly whitelisted in elasticsearch.yaml using the reindex.remote.whitelist property
Since I'm using AWS clusters I'm not sure how to follow the scheme of host,post or how to whitelist cluster, because I don't know how to do these changes on AWS cluster.
Request to help, If any workaround available. Thanks,