# Cannot connect to remote ElasticSearch server

**URL:** <https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308>\
**Category:** Elasticsearch\
**Created:** [March 21, 2019, 12:54pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308 "2019-03-21T12:54:41Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 25, 2019, 11:56am UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/21 "2019-03-25T11:56:32Z")

</div>

```
transport.host: 10.0.1.4
transport.tcp.port: 9300 
http.port: 9200
network.host: 0.0.0.0
```

---

<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, 2019, 12:27pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/22 "2019-03-25T12:27:30Z")

</div>

On your local machine try:

```auto
curl -XGET http://127.0.0.1:9200
curl -XGET http://localhost:9200

```

You can also change:

```
network.host: 0.0.0.0

```

to

```
network.host: 10.0.1.4

```

And restart the node  
Note that you won't be able to use `localhost` or `127.0.0.1` but only `10.0.1.4`.

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 25, 2019, 12:33pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/23 "2019-03-25T12:33:30Z")

</div>

Thanks for your reply. After changing

```auto
network.host: 0.0.0.0

```

to

```auto
network.host: 10.0.1.4

```

I see the following when running `curl -XGET http://localhost:9200`:

`curl: (7) Failed to connect to localhost port 9200: Connection refused`

Before that change, I saw the following instead:

```
{
  "name" : "8F-Edn5",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "x7V8Sr8KTRu8_pNixpjOkQ",
  "version" : {
    "number" : "6.6.2",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "3bd3e59",
    "build_date" : "2019-03-06T15:16:26.864148Z",
    "build_snapshot" : false,
    "lucene_version" : "7.6.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
```

---

<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, 2019, 12:36pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/24 "2019-03-25T12:36:20Z")

</div>

But what is the output of:

```auto
curl -XGET http://10.0.1.4:9200

```

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 25, 2019, 12:40pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/25 "2019-03-25T12:40:12Z")

</div>

```
{
  "name" : "8F-Edn5",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "x7V8Sr8KTRu8_pNixpjOkQ",
  "version" : {
    "number" : "6.6.2",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "3bd3e59",
    "build_date" : "2019-03-06T15:16:26.864148Z",
    "build_snapshot" : false,
    "lucene_version" : "7.6.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
```

---

<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, 2019, 12:40pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/26 "2019-03-25T12:40:30Z")

</div>

So that's what you wanted right?

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 25, 2019, 12:41pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/27 "2019-03-25T12:41:11Z")

</div>

I still cannot access the remote server from my local machine, even with the changes.

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 25, 2019, 12:42pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/28 "2019-03-25T12:42:32Z")

</div>

Just to be clear, when I run the command `curl -XGET http://10.0.1.4:9200` from my **local machine** , I see this:

`curl: (7) Failed to connect to 10.0.1.4 port 9200: Timed out`

When I run the command `curl -XGET http://10.0.1.4:9200` on my **remote ES machine** itself, I see this:

```auto
{
  "name" : "8F-Edn5",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "x7V8Sr8KTRu8_pNixpjOkQ",
  "version" : {
    "number" : "6.6.2",
    "build_flavor" : "default",
    "build_type" : "zip",
    "build_hash" : "3bd3e59",
    "build_date" : "2019-03-06T15:16:26.864148Z",
    "build_snapshot" : false,
    "lucene_version" : "7.6.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

```

And when I run `curl -XGET http://localhost:9200` on my **remote ES machine** , I also see this:

`curl: (7) Failed to connect to 10.0.1.4 port 9200: Timed out`

This is **after** changing

```auto
network.host: 0.0.0.0

```

to

```auto
network.host: 10.0.1.4

```

---

<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, 2019, 12:43pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/29 "2019-03-25T12:43:47Z")

</div>

Can you share the `elasticsearch.log` file?

I'd like to see this part:

```auto
[2019-03-25T11:21:15,774][INFO][o.e.n.Node] [8F-Edn5] starting ...
[2019-03-25T11:21:16,056][INFO][o.e.t.TransportService] [8F-Edn5] publish_address {10.0.1.4:9300}, bound_addresses {10.0.1.4:9300}
[2019-03-25T11:21:16,103][INFO][o.e.b.BootstrapChecks] [8F-Edn5] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-03-25T11:21:19,239][INFO][o.e.c.s.MasterService] [8F-Edn5] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{Yjxxs4IuQt2X3q-bnydgMA}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
[2019-03-25T11:21:19,255][INFO][o.e.c.s.ClusterApplierService] [8F-Edn5] new_master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{Yjxxs4IuQt2X3q-bnydgMA}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{Yjxxs4IuQt2X3q-bnydgMA}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2019-03-25T11:21:19,427][INFO][o.e.h.n.Netty4HttpServerTransport] [8F-Edn5] publish_address {10.0.1.4:9200}, bound_addresses {[::]:9200}
[2019-03-25T11:21:19,458][INFO][o.e.n.Node] [8F-Edn5] started

```

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 25, 2019, 12:45pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/30 "2019-03-25T12:45:01Z")

</div>

```
[2019-03-25T10:30:08,799][INFO][o.e.t.TransportService] [8F-Edn5] publish_address {10.0.1.4:9300}, bound_addresses {10.0.1.4:9300}
[2019-03-25T10:30:08,827][INFO][o.e.b.BootstrapChecks] [8F-Edn5] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-03-25T10:30:11,962][INFO][o.e.c.s.MasterService] [8F-Edn5] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{3kJvlHqBTPqhQDIeMrRDng}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
[2019-03-25T10:30:11,969][INFO][o.e.c.s.ClusterApplierService] [8F-Edn5] new_master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{3kJvlHqBTPqhQDIeMrRDng}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{3kJvlHqBTPqhQDIeMrRDng}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2019-03-25T10:30:12,211][INFO][o.e.h.n.Netty4HttpServerTransport] [8F-Edn5] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}
[2019-03-25T10:30:12,213][INFO][o.e.n.Node] [8F-Edn5] started
```

---

<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, 2019, 12:46pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/31 "2019-03-25T12:46:58Z")

</div>

The logs you just pasted are happening at `10:30`.  
The previous logs were at `11:21`.

I'm unsure you are sharing the right information.

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 25, 2019, 12:49pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/32 "2019-03-25T12:49:34Z")

</div>

I have re-started ES. Here is the new log file:

```
[2019-03-25T11:49:49,803][INFO][o.e.t.TransportService] [8F-Edn5] publish_address {10.0.1.4:9300}, bound_addresses {10.0.1.4:9300}
[2019-03-25T11:49:49,850][INFO][o.e.b.BootstrapChecks] [8F-Edn5] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2019-03-25T11:49:52,986][INFO][o.e.c.s.MasterService] [8F-Edn5] zen-disco-elected-as-master ([0] nodes joined), reason: new_master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{tnNEd8H_SI-cEyCEC2DLyg}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}
[2019-03-25T11:49:53,002][INFO][o.e.c.s.ClusterApplierService] [8F-Edn5] new_master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{tnNEd8H_SI-cEyCEC2DLyg}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true}, reason: apply cluster state (from master [master {8F-Edn5}{8F-Edn5jQ9mNO7UNtOtMwQ}{tnNEd8H_SI-cEyCEC2DLyg}{10.0.1.4}{10.0.1.4:9300}{ml.machine_memory=8589463552, xpack.installed=true, ml.max_open_jobs=20, ml.enabled=true} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[2019-03-25T11:49:53,357][INFO][o.e.h.n.Netty4HttpServerTransport] [8F-Edn5] publish_address {10.0.1.4:9200}, bound_addresses {[::]:9200}
[2019-03-25T11:49:53,359][INFO][o.e.n.Node] [8F-Edn5] started
```

---

<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, 2019, 1:01pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/33 "2019-03-25T13:01:27Z")

</div>

Are you sure you changed `elasticsearch.yml`?

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 25, 2019, 1:02pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/34 "2019-03-25T13:02:53Z")

</div>

This is how it currently looks:

```
transport.host: 10.0.1.4
transport.tcp.port: 9300 
http.port: 9200
network.host: 10.0.1.4

```

The file is located within `C:\Users\Miao\Downloads\elasticsearch-6.6.2\config`.

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 25, 2019, 1:19pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/35 "2019-03-25T13:19:48Z")

</div>

Out of curiosity I ran `curl XGET` on my local machine with my remote ES server's WAN IP address. I also received `curl: (7) Failed to connect to [WAN IP address] port 9200: Timed out`.

---

<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:** [March 25, 2019, 1:46pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/36 "2019-03-25T13:46:12Z")

</div>

> [@Miao](#):
>
> ```plaintext
> [2019-03-25T11:49:53,357][INFO][o.e.h.n.Netty4HttpServerTransport] [8F-Edn5] publish_address {10.0.1.4:9200}, bound_addresses {[::]:9200}
> 
> ```

I am suspicious of that `bound_addresses {[::]:9200}` message. On Linux I think this means it's listening on every interface for both IPv4 and IPv6 traffic, but I'm not sure that's the case on Windows. Could you set `http.bind_host: 10.0.1.4` to override this too?

I also don't see any evidence yet that there's _any_ connectivity between your local and remote machines on this address. Can you provide some evidence of this?

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 25, 2019, 2:03pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/37 "2019-03-25T14:03:18Z")

</div>

> [@DavidTurner](#):
>
> I also don't see any evidence yet that there's _any_ connectivity between your local and remote machines on this address.

That is correct -- I cannot access Port 9200 on that address from my local machine.

---

<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:** [March 25, 2019, 3:13pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/38 "2019-03-25T15:13:11Z")

</div>

> [@Miao](#):
>
> That is correct -- I cannot access Port 9200 on that address from my local machine.

Sure, but can you access anything at all on that machine from your local machine using the address `10.0.1.4`? This is not a public IP address: addresses of the form `10.x.x.x` [are not routable across the internet](https://en.wikipedia.org/wiki/Private_network). I am interested in narrowing the problem down to either Elasticsearch or to your network config.

---

<div class="post-metadata">

**Author:** ![thn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thn/32/8061_2.png) [@thn](https://discuss.elastic.co/u/thn)\
**Post date:** [March 25, 2019, 6:15pm UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/39 "2019-03-25T18:15:57Z")

</div>

Miao: is this "remote server" you have been trying to get to from your local machine is a VM (virtual machine) running in your local machine or other machine? if not, are your machine and the remote server on the same network? so far, we can tell that elasticsearch was started properly... the problem is from your local machine to this remote server.

---

<div class="post-metadata">

**Author:** ![Miao](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@Miao](https://discuss.elastic.co/u/Miao)\
**Post date:** [March 26, 2019, 8:15am UTC](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308/40 "2019-03-26T08:15:50Z")

</div>

Hello @DavidTurner and @thn, thanks for your replies! To answer your questions:

> [@thn](#):
>
> is this "remote server" you have been trying to get to from your local machine is a VM (virtual machine) running in your local machine or other machine?

The remote server is a VM running on another machine.

> [@thn](#):
>
> if not, are your machine and the remote server on the same network?

They do not belong on the same network.

> [@DavidTurner](#):
>
> can you access anything at all on that machine from your local machine using the address `10.0.1.4` ?

No.

[Previous page](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308.md?page=1)

[Next page](https://discuss.elastic.co/t/cannot-connect-to-remote-elasticsearch-server/173308.md?page=3)
