# Setting up Elasticsearch on a virtual machine

**URL:** <https://discuss.elastic.co/t/setting-up-elasticsearch-on-a-virtual-machine/108849>\
**Category:** Elasticsearch\
**Created:** [November 23, 2017, 9:29am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-on-a-virtual-machine/108849 "2017-11-23T09:29:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sylvain\_Attoumani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_attoumani/32/45401_2.png) [@Sylvain\_Attoumani](https://discuss.elastic.co/u/Sylvain_Attoumani)\
**Post date:** [November 23, 2017, 9:29am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-on-a-virtual-machine/108849/1 "2017-11-23T09:29:38Z")

</div>

Hello everybody.  
I'm working with a virtual machine using vagrant and try to setting up Elasticsearch on this VM. But when i run bin/elasticsearch it's using 127.0.0.1 wich is not the localhost of my virtual machine. I'm wondering how can i change that. I changed in the file elasticsearch.yml the line  
`The default list of hosts is ["127.0.0.1", "[::1]"]`  
with  
`The default list of hosts is ["localhost", "[::1]"]`

but it doesn't work. I also changed in this file the line  
`discovery.zen.ping.unicast.hosts: ["host1", "host2"]`  
with  
`discovery.zen.ping.unicast.hosts: ["localhost"]`  
but still not. I can't have any result when i go in 192.168.50.6:9200 (wich is vm ip). if anyone could help, thanks a lot

---

<div class="post-metadata">

**Author:** ![tatdat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tatdat/32/113160_2.png) [@tatdat](https://discuss.elastic.co/u/tatdat)\
**Post date:** [November 23, 2017, 9:34am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-on-a-virtual-machine/108849/2 "2017-11-23T09:34:11Z")

</div>

Change in network.host in configfile (elasticsearch,yml)

like this:

> network.host : 192.168.50.6

Or

> network.host: 0.0.0.0

Documents : [https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#network.host](https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#network.host)

If you running with 1 instances ES, dont use option `discovery.zen.ping.unicast.hosts`

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [November 23, 2017, 9:35am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-on-a-virtual-machine/108849/3 "2017-11-23T09:35:35Z")

</div>

firstly make sure your following points for running elastic search with your vm ip:  
1: mention the vm ip in /etc/host file as  
127.0.0.1 localhost  
VMIP   
2: change the parameters as:  
default list of hosts is: ["localhost"]  
discovery.zen.ping.unicast.hosts: ["VMIP:9200"]

3: also open the port 9200 and 9300 which is very important for communications  
9200 is default port for elasticsearch

---

<div class="post-metadata">

**Author:** ![Sylvain\_Attoumani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_attoumani/32/45401_2.png) [@Sylvain\_Attoumani](https://discuss.elastic.co/u/Sylvain_Attoumani)\
**Post date:** [November 23, 2017, 9:44am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-on-a-virtual-machine/108849/4 "2017-11-23T09:44:32Z")

</div>

So it's better thanks. but now I have an error while running bin/elasticsearch :

[2017-11-23T09:42:53,226][INFO][o.e.b.BootstrapChecks] [DX9fDXX] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks  
ERROR: [2] bootstrap checks failed  
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]  
[2]: max virtual memory areas vm.max\_map\_count [65530] is too low, increase to at least [262144]  
[2017-11-23T09:42:53,234][INFO][o.e.n.Node] [DX9fDXX] stopping ...  
[2017-11-23T09:42:53,255][INFO][o.e.n.Node] [DX9fDXX] stopped  
[2017-11-23T09:42:53,256][INFO][o.e.n.Node] [DX9fDXX] closing ...  
[2017-11-23T09:42:53,273][INFO][o.e.n.Node] [DX9fDXX] closed

---

<div class="post-metadata">

**Author:** ![tatdat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tatdat/32/113160_2.png) [@tatdat](https://discuss.elastic.co/u/tatdat)\
**Post date:** [November 23, 2017, 9:48am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-on-a-virtual-machine/108849/5 "2017-11-23T09:48:41Z")

</div>

Please check here [https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html)

and here

[https://www.elastic.co/guide/en/elasticsearch/reference/current/system-config.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/system-config.html)

---

<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:** [November 23, 2017, 9:56am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-on-a-virtual-machine/108849/6 "2017-11-23T09:56:56Z")

</div>

Please read [https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html)

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [November 23, 2017, 9:57am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-on-a-virtual-machine/108849/7 "2017-11-23T09:57:46Z")

</div>

As seeing your logs , it seems there is an issue to run elastic search process and it is getting failed due to low space.  
It can be the case your VM configuration is low and elasticsearch occuping high data.  
In that case you can customize your heap size configuration setting in jvm\_options file of elasticsearch.  
Change the Xms parameter with less space i.e half RAM of your 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:** [December 21, 2017, 9:57am UTC](https://discuss.elastic.co/t/setting-up-elasticsearch-on-a-virtual-machine/108849/8 "2017-12-21T09:57:52Z")

</div>

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