Tuan Anh Tran
Tuan Anh Tran

Reputation: 7267

Elasticsearch cannot start when bind to public ip address

if i leave the network.host commented out in /etc/elasticsearch/elasticsearch.yml, it will start like normal (curl localhost:9200 returns result as expected).

However, if I set network.host = <public-ip> then sudo service elasticsearch restart it will says OK but then the status of elasticsearch is not running.

what did I do wrong in this case?

System: Ubuntu 14.04 LTS

Update: Fixed by binding it to 0.0.0.0.

Upvotes: 6

Views: 4364

Answers (2)

Stuart Cardall
Stuart Cardall

Reputation: 2457

The proper way to fix this is to pass the bootstrap tests in elasticsearch:

add to /etc/security/limits.conf something like:

# elasticsearch
*               hard    nofile          65536
*               hard    nproc           2048

Be careful with the network configuration!
Never expose an unprotected node to the public internet. (elasticsearch docs)

A secure solution would be to bind to a loopback interface & create an ssh tunnel from the host that needs access => elasticsearch

Upvotes: 1

Tuan Anh Tran
Tuan Anh Tran

Reputation: 7267

Update: Fixed by binding it to 0.0.0.0.

Upvotes: 5

Related Questions