I try to reindex from a remote server. Elasticsearch instance on the remote server is behind a nginx proxy and its url is api.example.com/api/elasticsearch on port 80.
I'm able to access the remote elasticsearch and perform queries. E.g.
curl http://api.example.com:80/api/elasticsearch/_cat/indices?v
gives the expected result.
However when I try to reindex a local elasticsearch index from the remote index as follows
curl -X POST http://elasticsearch:9200/_reindex -d '{
"source": {
"remote": {
"host": "http://api.example.com/api/elasticsearch:80"
},
"index": "alias_name"
},
"dest": {
"index": "index_name"
}
}'
I receive an error:
{"error":{"root_cause":[{"type":"unknown_host_exception","reason":"api.example.com/api/elasticsearch: Name or service not known"}],"type":"unknown_host_exception","reason":"api.example.com/api/elasticsearch: Name or service not known"},"status":500}
nginx
proxy between them that listened on an explicit port and forwarded calls. Pretty silly that this was necessary but it worked great. – Bruce MacKenzie