# Completed handshake with but follow up connection failed

**URL:** <https://discuss.elastic.co/t/completed-handshake-with-but-follow-up-connection-failed/271353>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [April 27, 2021, 9:57am UTC](https://discuss.elastic.co/t/completed-handshake-with-but-follow-up-connection-failed/271353 "2021-04-27T09:57:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![overbid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/overbid/32/87426_2.png) [@overbid](https://discuss.elastic.co/u/overbid)\
**Post date:** [April 27, 2021, 9:57am UTC](https://discuss.elastic.co/t/completed-handshake-with-but-follow-up-connection-failed/271353/1 "2021-04-27T09:57:51Z")

</div>

I'm trying to install via podman compose in 3 machines on AWS EC2

```
version: "3"
services:
  es01:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
    container_name: es01
    environment:
      - node.name=es01
      - cluster.name=es-thaicom-cluster
      - discovery.seed_hosts=es02,es03
      - cluster.initial_master_nodes=es01,es02,es03
      - "ES_JAVA_OPTS=-Xms3g -Xmx3g"
      - index.codec=best_compression
      - network.host=127.0.0.1
      - http.host=0.0.0.0
    extra_hosts:
      - "es01:127.0.0.1"
      - "es02:172.31.25.120"
      - "es03:172.31.18.77"
    dns:
      - 127.0.0.53
    ports:
      - 9200:9200
      - 9300:9300

```

But I got errors like

```
{
    "type": "server",
    "timestamp": "2021-04-27T09:17:10,150Z",
    "level": "WARN",
    "component": "o.e.d.HandshakingTransportAddressConnector",
    "cluster.name": "es-thaicom-cluster",
    "node.name": "es01",
    "message": "[connectToRemoteMasterNode[172.31.18.77:9300]] completed handshake with [{es03}{OJUZTeWBTNy5GBwJfzdGpA}{2g4EtF2ASICtc0h5bUv9-A}{10.0.2.100}{10.0.2.100:9300}{cdfhilmrstw}{ml.machine_memory=4124807168, ml.max_open_jobs=20, xpack.installed=true, ml.max_jvm_size=3221225472, transform.node=true}] but followup connection failed",
    "stacktrace": [
        "org.elasticsearch.transport.ConnectTransportException: [es03][10.0.2.100:9300] handshake failed. unexpected remote node {es01}{c-2xngTRTuS2TEU01hXFGA}{qzEYacQCSRq8XH9jrSdI3w}{10.0.2.100}{10.0.2.100:9300}{cdfhilmrstw}{ml.machine_memory=4124807168, ml.max_open_jobs=20, xpack.installed=true, ml.max_jvm_size=3221225472, transform.node=true}",
        "at org.elasticsearch.transport.TransportService.lambda$connectionValidator$5(TransportService.java:417) ~[elasticsearch-7.12.0.jar:7.12.0]",
        "at org.elasticsearch.action.ActionListener$MappedActionListener.onResponse(ActionListener.java:70) [elasticsearch-7.12.0.jar:7.12.0]",
        "at org.elasticsearch.transport.TransportService$5.onResponse(TransportService.java:503) [elasticsearch-7.12.0.jar:7.12.0]",
        "at org.elasticsearch.transport.TransportService$5.onResponse(TransportService.java:493) [elasticsearch-7.12.0.jar:7.12.0]",
        "at org.elasticsearch.action.ActionListenerResponseHandler.handleResponse(ActionListenerResponseHandler.java:43) [elasticsearch-7.12.0.jar:7.12.0]",
        "at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleResponse(TransportService.java:1280) [elasticsearch-7.12.0.jar:7.12.0]",
        "at org.elasticsearch.transport.TransportService$ContextRestoreResponseHandler.handleResponse(TransportService.java:1280) [elasticsearch-7.12.0.jar:7.12.0]",
        "at org.elasticsearch.transport.InboundHandler.doHandleResponse(InboundHandler.java:291) [elasticsearch-7.12.0.jar:7.12.0]",
        "at org.elasticsearch.transport.InboundHandler.lambda$handleResponse$1(InboundHandler.java:279) [elasticsearch-7.12.0.jar:7.12.0]",
        "at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673) [elasticsearch-7.12.0.jar:7.12.0]",
        "at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]",
        "at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]",
        "at java.lang.Thread.run(Thread.java:832) [?:?]"
    ]
}

```

How do I fix it?

---

<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 27, 2021, 10:51am UTC](https://discuss.elastic.co/t/completed-handshake-with-but-follow-up-connection-failed/271353/2 "2021-04-27T10:51:51Z")

</div>

> [@overbid](#):
>
> ````auto
> completed handshake with [{es03}{...}{10.0.2.100:9300}{...}] but followup connection failed
> unexpected remote node {es01}{...}{10.0.2.100:9300}```
> 
> ````

These two nodes both appear to be at `10.0.2.100:9300`. That won't work, you need to give each node its own address.

---

<div class="post-metadata">

**Author:** ![overbid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/overbid/32/87426_2.png) [@overbid](https://discuss.elastic.co/u/overbid)\
**Post date:** [April 27, 2021, 11:12am UTC](https://discuss.elastic.co/t/completed-handshake-with-but-follow-up-connection-failed/271353/3 "2021-04-27T11:12:19Z")

</div>

I change environment

- Remove `http.host` and `network.host`.
- Add `network.publish_host=172.31.44.179`.

It's work.

---

<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 27, 2021, 11:15am UTC](https://discuss.elastic.co/t/completed-handshake-with-but-follow-up-connection-failed/271353/4 "2021-04-27T11:15:57Z")

</div>

Although that might appear to work for now, I don't think it's the correct solution. See the [docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html) on network settings, particularly for `network.publish_host`:

> Use this setting only if binding to multiple addresses or using different addresses for publishing and binding.

I don't think either of these apply to you, so you should just set `network.host`.

---

<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:** [May 25, 2021, 11:49am UTC](https://discuss.elastic.co/t/completed-handshake-with-but-follow-up-connection-failed/271353/6 "2021-05-25T11:49:32Z")

</div>

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