Setting up Elasticsearch on a virtual machine

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

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

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

2 Likes

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

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

Please check here 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

1 Like

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

1 Like

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.

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