Aleski
Aleski

Reputation: 1442

Elasticsearch Won't Start when binding to anything but localhost (node validation exception when binding to eth0)

I am VERY new to the elasticsearch game. I am even quite new to running JAVA things on my Ubuntu 14.04 install. My background is almost entirely JS stack based.

With that out of the way, I have ran through a tutorial for installing elasticsearch. I have managed to get it running on my cheapo digitalocean droplet by modifying how much memory it is assigned on start. Great!

I can access it fine if I am in the terminal on the actual host, using http://localhost:9200/ for example.

However, I want to expose this as an endpoint. So according to documentation all over the net, I simply bing netowrk.bind to 0.0.0.0.

However when I save the config file and sudo service elasticsearch restart it tells me it has started up. Shortly after it crashes and closes.

Upon closer inspection of the logs, it seems that because I am binding to a non-loopback network (aka eth0) it runs some bootstrap checks which then FAIL because I haven't got the minimum memory assigned to it.

Why will it let me bind it to local or localhost, and run the application but not allow me to bind to an outward facing network?

[2016-12-21T10:18:59,888][INFO ][o.e.b.BootstrapCheck     ] [honey-pot-1] 
bound or publishing to a non-loopback or non-link-local address,
enforcing bootstrap checks
[2016-12-21T10:18:59,903][ERROR][o.e.b.Bootstrap          ] [honey-pot-1]
node validation exception
bootstrap checks failed
max number of threads [1822] for user [elasticsearch] is too low, 
increase to at least [2048]
max virtual memory areas vm.max_map_count [100000] is too low,
increase to at least [262144]
[2016-12-21T10:18:59,928][INFO ][o.e.n.Node               ] [honey-pot-1] 
stopping ...

Upvotes: 3

Views: 12483

Answers (3)

madhu
madhu

Reputation: 1103

increase the max virtual memory areas vm.max_map_count..use below command

$ sudo sysctl -w vm.max_map_count=262144

Upvotes: 2

rajdeepbs29
rajdeepbs29

Reputation: 1329

add the below config to /etc/elasticsearch/elasticsearch.yml for rpm based installation or $ES_HOME/elasticsearch.yml for tarball installation

network.host: 127.0.0.1 http.host: 0.0.0.0

and restart elasticsearch. It should work.

Also, You can try setting setting - sudo systemctl edit elasticsearch and adding [Service] LimitMEMLOCK=infinity

and saving and sudo systemctl daemon-reload suggested above.

Upvotes: 1

Ryadh Khsib
Ryadh Khsib

Reputation: 94

Elastic won't start unless you increase the max number of threads and max virtual memory. You can follow this doc: configuring Elastic system settings

Upvotes: 3

Related Questions