Henrique Carvalho
Henrique Carvalho

Reputation: 113

Elasticsearch - '127.0.0.1:9200' and 'localhost:9200' are unable to connect on the browser

When I try curl -XGET 'http://localhost:9200' on my terminal it is working fine.enter image description here

But, When I try http://localhost:9200/ or 127.0.0.1:9200/ on my browser it showsenter image description here

How can I fix this problem ?

Upvotes: 3

Views: 9413

Answers (1)

Jyoti Ranjan Pattnaik
Jyoti Ranjan Pattnaik

Reputation: 713

I understand it is too late to answer, but "late" is relative.

As you are using curl in virtual machine, where elasticsearch is running, it is returning result in terminal. But to see it in the browser of the parent OS, You need to do this:

  • Get the ip address of the linux machine where elasticsearch is running. (ifconfig), let's say it is 10.75.108.136
  • Now open elasticsearch.yml in config directory and change below two properties a. network.host: "linux virtual machine ipaddress" b. uncomment http.port: 9200
  • start elasticsearch
  • In Parent OS go to http://10.75.108.136:9200/

:)

Upvotes: 4

Related Questions