# Elasticsearch isn't working with host IP

**URL:** https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969
**Category:** Elasticsearch
**Created:** [June 16, 2019, 5:11pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969 "2019-06-16T17:11:21Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![CMonty](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@CMonty](https://discuss.elastic.co/u/CMonty)
#### Post date: [June 16, 2019, 5:11pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/1 "2019-06-16T17:11:21Z")

</div>

I am setting up Elasticsearch but it only seems to work with local host. When I go into elasticsearch.yml I uncomment out only network.host & http.port as the tutorial states. It works when I leave network.host as "localhost" & http.port with 9200. However when I change network.host to 192.168.1.15 (Which is the host machines IP address) it doesn't work... Has anyone else had this problem?

---

<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: [June 16, 2019, 6:39pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/2 "2019-06-16T18:39:31Z")

</div>

> [@CMonty](#):
>
> it doesn't work

Could you be more specific? What does not work ?

Additionally what are the logs?

---

<div class="post-metadata">

### Author: ![CMonty](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@CMonty](https://discuss.elastic.co/u/CMonty)
#### Post date: [June 17, 2019, 3:52pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/3 "2019-06-17T15:52:05Z")

</div>

Haha, I guess I could have been more descriptive. When I run the commands :  
service elasticsearch start & service elasticsearch status it says elasticsearch is running and there are no issues for atleast 30 seconds... After that the service stops and this is the output from the logs from when the service starts & ends :

[https://pastebin.com/pvKBBk9Q](https://pastebin.com/pvKBBk9Q)

However, when I go to 192.168.1.15:9200 in the browser I am getting a Unable to connect response.

The only edits I have made in /etc/elasticsearch/elasticsearch.yml is uncommenting out network.host to enter the IP of the host & uncommenting http.port.

I don't receive the unable to connect error message if I leave network.host as "localhost"

---

<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: [June 17, 2019, 4:14pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/4 "2019-06-17T16:14:15Z")

</div>

There is a message here:

```auto
org.elasticsearch.transport.BindTransportException: Failed to bind to [9300-9400]

```

So it can not bind `192.168.1.15` to your node. Is this ip really the right one that you can see on the machine where elasticsearch is running?  
I mean that it seems you are running under VirtualBox (judging by the name). Is `192.168.1.15` the external IP address or the internal one?

---

<div class="post-metadata">

### Author: ![CMonty](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@CMonty](https://discuss.elastic.co/u/CMonty)
#### Post date: [June 17, 2019, 6:02pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/5 "2019-06-17T18:02:50Z")

</div>

192.168.1.15 is the IP address of the VirtualBox machine I have installed elasticsearch on.

Is there any way around this error so elasticsearch connects to the VM?

---

<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: [June 17, 2019, 8:15pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/6 "2019-06-17T20:15:47Z")

</div>

What is the IP address of the network card inside the vm?

---

<div class="post-metadata">

### Author: ![CMonty](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@CMonty](https://discuss.elastic.co/u/CMonty)
#### Post date: [June 17, 2019, 8:20pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/7 "2019-06-17T20:20:14Z")

</div>

my laptop IP is 192.168.1.2 my VM ip is 192.168.1.15

---

<div class="post-metadata">

### Author: ![kartikcr](https://avatars.discourse-cdn.com/v4/letter/k/c89c15/32.png) [@kartikcr](https://discuss.elastic.co/u/kartikcr)
#### Post date: [June 17, 2019, 9:46pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/8 "2019-06-17T21:46:46Z")

</div>

You can bind your ip by simply setting  
**network.host: 0.0.0.0**  
It binds everything for HTTP and transport.  
in **ElasticSearch.yml**

---

<div class="post-metadata">

### Author: ![CMonty](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@CMonty](https://discuss.elastic.co/u/CMonty)
#### Post date: [June 17, 2019, 10:59pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/9 "2019-06-17T22:59:12Z")

</div>

Would I connect to 0.0.0.0:9200 on the browser then? I am still receiving the same error in logs.

---

<div class="post-metadata">

### Author: ![kartikcr](https://avatars.discourse-cdn.com/v4/letter/k/c89c15/32.png) [@kartikcr](https://discuss.elastic.co/u/kartikcr)
#### Post date: [June 17, 2019, 11:20pm UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/10 "2019-06-17T23:20:31Z")

</div>

No, then you can use your machine ip address.  
Type ipconfig on the command line and copy your ipv4 address.  
http://[your\_ipv4\_address]:9200

---

<div class="post-metadata">

### Author: ![CMonty](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@CMonty](https://discuss.elastic.co/u/CMonty)
#### Post date: [June 18, 2019, 12:14am UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/11 "2019-06-18T00:14:18Z")

</div>

I am still receiving the same error message in logs, & when I run the command service elasticsearch status it shows the service failed.

elasticsearch.service : Main process exited, code=exited, status=78/n/a

elasticsearch.service : Failed with result 'exit-code'

---

<div class="post-metadata">

### Author: ![CMonty](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@CMonty](https://discuss.elastic.co/u/CMonty)
#### Post date: [June 18, 2019, 12:37am UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/12 "2019-06-18T00:37:06Z")

</div>

I was able to connect to it through localhost 127.0.0.1 however I am not able to connect to elasticsearch on my host machine (not the VM)

---

<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: [July 16, 2019, 12:37am UTC](https://discuss.elastic.co/t/elasticsearch-isnt-working-with-host-ip/185969/13 "2019-07-16T00:37:11Z")

</div>

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