Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Connect to Elasticsearch (through Curl)

I've recently installed Elasticsearch and everything was working well for the first few days, but somehow today it stopped working

When I start the service, it claims to be fine...

sudo /etc/init.d/elasticsearch start
* Starting Elasticsearch Server
...done.

But then I get
curl -GET http://127.0.0.1:9200
curl: (7) couldn't connect to host

Looking at the elasticsearch logs:

[WARN ][bootstrap                ] jvm uses the client vm, make sure to run `java` with the server vm for best performance by adding `-server` to the command line

Looks like there is a warning regarding the Java VM; could that be the problem? What else should I try/look at?

like image 781
Phil B Avatar asked Mar 01 '14 04:03

Phil B


1 Answers

curl -GET http://127.0.0.1:9200 is the wrong command.

Try curl -XGET http://127.0.0.1:9200. It should return the short info about your running local node and status 200. If that doesn't work then something else must be wrong.

like image 189
Ashalynd Avatar answered Oct 25 '22 23:10

Ashalynd