1

Every guide or post about this topic says to just set network.host: 0 in the elasticsearch.yml file. However I tried that, along with applying other troubleshooting methods, and nothing seems to work. I'm starting to think maybe the configuration is right, but I am not connecting to it the right way?

This is what my yml file looks like,

discovery.seed_hosts: []

network.publish_host: xx.xxx.xxx.51

network.host: 0.0.0.0

The elastic search server is hosted on an Azure virtual machine. Then when I try to connect to it via curl on my local machine I get a Failed to Connect, Timeout Error.

curl http://xx.xxx.xxx.51:9200
Nishant
  • 7,504
  • 1
  • 21
  • 34
Eric Gumba
  • 435
  • 3
  • 16
  • 1
    is elasticsearch service is up and running, did you ssh and checked `curl localhost:9200` ? also if you are running a single node then you need to add `discovery.type:single-node` in config if service is failing to restart more info in https://stackoverflow.com/a/60426167/4039431 and if you just running a single node, then to make things simple remove `network.publish_host` and seed_host config – Amit Apr 21 '20 at 06:34
  • Hey, any luck with my comment? – Amit Apr 21 '20 at 09:24
  • @OpsterElasticsearchNinja unfortunately no luck. Also yeah, I made sure to ssh into the machine and check that the service is running. – Eric Gumba Apr 21 '20 at 16:59
  • 1
    can you check if your port 9200 is exposed to internet ? in AWS its defined in security settings where incoming open ports can be defined, also did you remove `network.publish_host: xx.xxx.xxx.51` and tried restarting your ES service – Amit Apr 21 '20 at 17:42
  • 1
    @OpsterElasticsearchNinja yup the issue was the network config on the cloud provider was blocking all inbound traffic. Thank you so much. I need to learn more about the basics of networking. Hahaha. – Eric Gumba Apr 21 '20 at 18:41

1 Answers1

1

The issue was with the network settings which was blocking all the incoming traffic and once incoming traffic on port 9200, default port of Elasticsearch allowed, the issue got resolved.

Just for the reference, you just need to have network.host: 0.0.0.0 config to make sure Elasticsearch isn't using the loopback address and this by default kicks in the production checks which can be avoided in case you are just running a single node discovery.type:single-node, this helps to troubleshoot such issues.

Amit
  • 30,756
  • 6
  • 57
  • 88