ElasticSearch instance not accessible from outside server - Azure Windows 2012

I installed Elastic Search 2.3.0 as a service on Azure VM with Windows Server 2012 R2. I can access an emergency search instance on the server using

http://localhost:9200 

but I can’t access from outside the server.

What have i tried?

  • Just for testing, I made the virtual machine available outside the virtual network.
  • Opened port 9200 in Windows Firewall settings as an inbound traffic rule
  • Added endpoint in Azure portal settings, opening port 9200

Tried this with VM Classic.

Also, to check the health of the virtual machine, I installed IIS on this computer, opened port 80. The IIS page is accessible from the outside by default.

The only thing I have not tried is to install ES in a Linux virtual machine.

I cannot find anything in elasticsearch logs. There are no logs in the browser (Chrome) on the network. It just spins, waits for the server, and binds to "ERR_EMPTY_RESPONSE".

Can anyone who did this shed light?

UPDATE: Here is what I see in netstat:

 TCP 127.0.0.1:9200 machine-name:0 LISTENING TCP 127.0.0.1:9300 machine-name:0 LISTENING 
+7
source share
5 answers

Starting with ES 2.0, the elasticsearch process only binds to localhost , which explains why you can query the ES internally, but not externally.

You need to change the following parameter in the elasticsearch.yml configuration file:

 network.host: 0.0.0.0 
+21
source

I had the same case. Looking at a magazine

 tail -f /var/log/elasticsearch/NODE.log 

I saw this:

  [NODE_NAME] publish_address {10.XXX.XXX.XXX:9300}, bound_addresses {10.XXX.XXX.XXX:9300} [NODE_NAME] bound or publishing to a non-loopback address, enforcing bootstrap checks [NODE_NAME] node validation exception [1] bootstrap checks failed [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured [NODE_NAME] stopping ... [NODE_NAME] stopped 

Decision:

Modify the / etc/elasticsearch/elasticsearch.yml asticsearch / asticsearch.yml archive in the response seed line as follows:

 discovery.seed_hosts: ["127.0.0.1", "[::1]"] 

Done.

+3
source

I would suggest setting special values ​​for network.host

eg.

 network.host: [_local_, _site_] 

This works for me.

+1
source

Please note that for me, success was achieved only after tuning

 http.host: 0.0.0.0 

instead

 http.host: "localhost" 
+1
source

Solved for me on Windows Server 2012 with Elasticsearch 7.1.1, adding the following configuration to C: \ ProgramData \ Elastic \ Elasticsearch \ config \ asticsearch.yml:

 http.host: 0.0.0.0 
0
source

Source: https://habr.com/ru/post/1246386/


All Articles