# Connection timed out when remote cluster re-indexing

**URL:** <https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694>\
**Category:** Elasticsearch\
**Created:** [March 25, 2022, 11:44am UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694 "2022-03-25T11:44:37Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)\
**Post date:** [March 25, 2022, 11:44am UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/1 "2022-03-25T11:44:37Z")

</div>

Getting Connection timed out error while re-indexing data from old cluster to new cluster.

`curl: (28) Failed to connect to elasticsearchurl port 9200: Connection timed out`

We are using curl command like this

```auto

curl -X POST "https://destination_cluster_url:9200/_reindex?pretty" -H 'Content-Type: application/json' -d'
{
  "source": {
    "remote": {
      "host": "https://source_cluster_host:9200"
    },
    "index": "old_index"
       
  },
  "dest": {
    "index": "new_index"
  }
}

```

Do we need to make additional configuration??

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 25, 2022, 1:08pm UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/2 "2022-03-25T13:08:34Z")

</div>

Have a look at the `wait_for_complete` option.

> **[Reindex API | Elasticsearch Guide \[8.1\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-task-api)**

---

<div class="post-metadata">

**Author:** ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)\
**Post date:** [March 25, 2022, 1:12pm UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/3 "2022-03-25T13:12:11Z")

</div>

I have not tried but its default value is true correct??

```auto
`wait_for_completion`

(Optional, Boolean) If `true` , the request blocks until the operation is complete. Defaults to `true` .

```

---

<div class="post-metadata">

**Author:** ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)\
**Post date:** [March 25, 2022, 1:46pm UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/4 "2022-03-25T13:46:27Z")

</div>

tried but no luck

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 26, 2022, 4:42am UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/5 "2022-03-26T04:42:42Z")

</div>

Yes. Set it to `false`.

---

<div class="post-metadata">

**Author:** ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)\
**Post date:** [March 28, 2022, 5:54am UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/6 "2022-03-28T05:54:54Z")

</div>

getting

```auto
"error" : {
    "type" : "null_pointer_exception",
    "reason" : null
  }

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 28, 2022, 6:17am UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/7 "2022-03-28T06:17:23Z")

</div>

You probably have a full error message in the logs. Please share it, please share the full request and the full response as well.

---

<div class="post-metadata">

**Author:** ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)\
**Post date:** [March 28, 2022, 6:21am UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/8 "2022-03-28T06:21:36Z")

</div>

I think we are not able to connect Elasticsearch cluster with port number(default 9200)? Do we really need it?I have only url of the cluster?

---

<div class="post-metadata">

**Author:** ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)\
**Post date:** [March 28, 2022, 6:48am UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/9 "2022-03-28T06:48:21Z")

</div>

Here is request/response something like

**Request** :

```auto
 curl -X POST "https://vpc-new-cluster-url:443/_reindex?wait_for_completion=false&pretty" -H 'Content-Type: application/json' -d'
{
  "source": {
    "remote": {
      "host": "https://vpc-old-cluster-url:443"
    },
    "index": index0"
  },
  "dest": {
    "index": "index000001"
  }
}
'

```

**Response** {  
"task" : "taskid2321"  
}

**Task Details** using /\_tasks/{taskid}

```auto
{
  "completed" : true,
  "task" : {
    "node" : "...",
    "id" : 3232,
    "type" : "transport",
    "action" : "indices:data/write/reindex",
    "status" : {
      "total" : 0,
      "updated" : 0,
      "created" : 0,
      "deleted" : 0,
      "batches" : 0,
      "version_conflicts" : 0,
      "noops" : 0,
      "retries" : {
        "bulk" : 0,
        "search" : 0
      },
      "throttled_millis" : 0,
      "requests_per_second" : -1.0,
      "throttled_until_millis" : 0
    },
    "description" : "...",
    "start_time_in_millis" : 1648449610121,
    "running_time_in_nanos" : 5070569,
    "cancellable" : true,
    "headers" : { }
  },
  "error" : {
    "type" : "null_pointer_exception",
    "reason" : null
  }
}

```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 28, 2022, 7:38am UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/10 "2022-03-28T07:38:32Z")

</div>

What are the full Elasticsearch logs?

---

<div class="post-metadata">

**Author:** ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)\
**Post date:** [March 28, 2022, 7:42am UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/11 "2022-03-28T07:42:20Z")

</div>

Can you please help me where we can find it?

---

<div class="post-metadata">

**Author:** ![Prashant\_Kamble](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@Prashant\_Kamble](https://discuss.elastic.co/u/Prashant_Kamble)\
**Post date:** [March 28, 2022, 11:52am UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/12 "2022-03-28T11:52:32Z")

</div>

Did anyone get a chance to look into this?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 28, 2022, 1:00pm UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/13 "2022-03-28T13:00:28Z")

</div>

Please be patient in waiting for responses to your question and refrain from pinging multiple times asking for a response or opening multiple topics for the same question. This is a community forum, it may take time for someone to reply to your question. For more information please refer to the [Community Code of Conduct](https://www.elastic.co/community/codeofconduct) specifically the section "Be patient". Also, please refrain from pinging folks directly, this is a forum and anyone that participates might be able to assist you.

If you are in need of a service with an SLA that covers response times for questions then you may want to consider talking to us about a [subscription](https://www.elastic.co/subscriptions).

It's fine to answer on your own thread after 2 or 3 days (not including weekends) if you don't have an answer.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 28, 2022, 1:02pm UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/14 "2022-03-28T13:02:46Z")

</div>

It depends on your OS. But the documentation will tell you.

For example: [Install Elasticsearch with Debian Package | Elasticsearch Guide [8.1] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html#deb-layout) tells that logs should be in `/var/log/elasticsearch`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 25, 2022, 1:02pm UTC](https://discuss.elastic.co/t/connection-timed-out-when-remote-cluster-re-indexing/300694/15 "2022-04-25T13:02:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
