0

I have an Elasticsearch installed on my host.

Request from localhost works fine

 curl -X GET http://localhost:9200/

But how can I configure elasticsearch.yml in order to connect from one outer ip?

Alex Zhulin
  • 1,239
  • 2
  • 22
  • 42
  • 1
    This answer might help: http://stackoverflow.com/questions/33412549/how-to-bind-elasticsearch-2-0-on-both-loopback-and-non-loopback-interfaces – Val Aug 09 '16 at 09:13
  • Thank you @Val It works for me – Alex Zhulin Aug 09 '16 at 09:43
  • One more question: If I use option like in mentioned question (network.bind_host: 0) ES listen requests from any host. How can I specify host list? – Alex Zhulin Aug 09 '16 at 10:00
  • [from the official doc](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html): "Accepts an IP address, hostname, a special value, or an array of any combination of these." – Val Aug 09 '16 at 11:10
  • Maybe something wrong with syntax, but this `network.bind_host: 0` works fine. But neither `network.bind_host: ["192.168.56.1", "127.0.0.1"]` nor `network.bind_host: [192.168.56.1, 127.0.0.1]` doesn't. `[FAIL] elasticsearch is not running ... failed!` Where am I wrong? – Alex Zhulin Aug 09 '16 at 13:37

1 Answers1

0

On the elasticsearch.yml file, locate the line #network.host:, uncoment it (remove the "#") and change to network.host: 0.0.0.0

Then add the exception to the firewall and reload it (In my case I use UFW, so I ran sudo ufw allow 9200 and sudo ufw reload)

Obs: Tested on version: 2.3

Anderson Ivan Witzke
  • 1,537
  • 1
  • 15
  • 24