# Reindex remote cluster connection timeout

**URL:** <https://discuss.elastic.co/t/reindex-remote-cluster-connection-timeout/356922>\
**Category:** Elasticsearch\
**Tags:** reindex\
**Created:** [April 7, 2024, 4:05pm UTC](https://discuss.elastic.co/t/reindex-remote-cluster-connection-timeout/356922 "2024-04-07T16:05:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neoaddix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neoaddix/32/118260_2.png) [@neoaddix](https://discuss.elastic.co/u/neoaddix)\
**Post date:** [April 7, 2024, 4:05pm UTC](https://discuss.elastic.co/t/reindex-remote-cluster-connection-timeout/356922/1 "2024-04-07T16:05:27Z")

</div>

I'm trying to reindex an index from a remote cluster

```auto
POST _reindex?wait_for_completion=false
{
  "source": {
    "remote": {
      "host": "https://remote-cluster.eu-west-1.aws.found.io:9200",
      "username": "xxx",
      "password": "xxx"
    },
    "index": "index-remote"
  },
  "dest": {
    "index": "index-local"
  }
}

```

I'm using Elastic Cloud, both clusters are in the same account/organisation. I have setup certificate trust between the two

And I set the `reindex.remote.whitelist` in each of the clusters, pointing to the other cluster and I still get a connection timeout

```auto
[instance-0000000013] 56668 failed with exception java.net.ConnectException: Timeout connecting to [remote-cluster.eu-west-1.aws.found.io/xx.xx.xxx.xxx:9200] at org.apache.http.nio.pool.RouteSpecificPool.timeout(RouteSpecificPool.java:169) ~[?:?] at org.apache.http.nio.pool.AbstractNIOConnPool.requestTimeout(AbstractNIOConnPool.java:632) ~[?:?] at org.apache.http.nio.pool.AbstractNIOConnPool$InternalSessionRequestCallback.timeout(AbstractNIOConnPool.java:898) ~[?:?] at org.apache.http.impl.nio.reactor.SessionRequestImpl.timeout(SessionRequestImpl.java:198) ~[?:?] at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processTimeouts(DefaultConnectingIOReactor.java:213) ~[?:?] at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:158) ~[?:?] at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:351) ~[?:?] at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:221) ~[?:?] at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64) ~[?:?] at java.lang.Thread.run(Thread.java:1570) ~[?:?]

```

Anyone any suggestions?

Thanks

Jeroen

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 7, 2024, 6:34pm UTC](https://discuss.elastic.co/t/reindex-remote-cluster-connection-timeout/356922/2 "2024-04-07T18:34:31Z")

</div>

> [@neoaddix](#):
>
> ```auto
> "remote": {
> "host": "https://remote-cluster.eu-west-1.aws.found.io:9200",
> 
> ```

One quick thing is `9200` is not the correct port used used by ESS and will not work... Try `443` and yes you need to specifically add it.

Also not exactly sure what you mean by

> [@neoaddix](#):
>
> have setup certificate trust between the two

You should just beable to set the Trusted Environments...

Can you share what you did assume you meant these settings

 ![Screenshot 2024-04-07 at 12.00.31 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/1/41f67bef18f798ea6dce1a9ed7b97cc989bbc8df.png)

Have you considered CCR?

> **[Enable cross-cluster search and cross-cluster replication | Elasticsearch...](https://www.elastic.co/guide/en/cloud/current/ec-enable-ccs.html)**

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 7, 2024, 7:06pm UTC](https://discuss.elastic.co/t/reindex-remote-cluster-connection-timeout/356922/3 "2024-04-07T19:06:29Z")

</div>

I'd recommend doing this kind of reindex using CCS rather than the HTTP-based reindex-from-remote. Needs v8.12.0 or later ([#96968](https://github.com/elastic/elasticsearch/pull/96968)) on the reindexing cluster.

---

<div class="post-metadata">

**Author:** ![neoaddix](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neoaddix/32/118260_2.png) [@neoaddix](https://discuss.elastic.co/u/neoaddix)\
**Post date:** [April 8, 2024, 6:05am UTC](https://discuss.elastic.co/t/reindex-remote-cluster-connection-timeout/356922/4 "2024-04-08T06:05:25Z")

</div>

@stephenb

> [@stephenb](#):
>
> One quick thing is `9200` is not the correct port used used by ESS and will not work... Try `443` and yes you need to specifically add it.

🤦‍♂️ yes that did the trick

Thanks both for helping @DavidTurner too.

I am using CCR btw, the reason to not do it here is that there are a lot of smaller indices on the remote cluster that I 1) don't want to create following indices for since I have to create 1 for every index and 2) I would like to reindex to 1 index on my local cluster.

I created auto-follow indices for all new ones so this reindexing from the remote is a one off action

Thanks again!

Jeroen

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 8, 2024, 6:19am UTC](https://discuss.elastic.co/t/reindex-remote-cluster-connection-timeout/356922/5 "2024-04-08T06:19:02Z")

</div>

> [@neoaddix](#):
>
> I am using CCR btw

That's good, but NB I'm suggesting using CCS, i.e. cross-cluster **search** for the reindex operation.
