0
votes

I tried to install Elasticsearch and run it.

When I type curl -X GET http://localhost:9200 or curl -X GET 192.1.0.0:9200, I get this error:

Failed to connect to localhost port 9200: Connection refused

How may I fix this?

I searched Stack Overflow for this issue, but none of the solutions worked for me, including this one: Elasticsearch: Failed to connect to localhost port 9200 - Connection refused

I also found this article, tried to follow it, but failed, because every time I type this in my cmd:

bin/plugin --install mobz/elasticsearch-head
bin/plugin --install lukas-vlcek/bigdesk

cmd will tell me:

plugin is not recognized as internal or external command

How do I fix this one?

1
cmd? Are you running Elasticsearch on Windows? bin/plugin won't work because directories use backslashes. And are you sure Elasticsearch is running?fisk
@Fiskie ya im running it on windows. idk its run or not, due to localhost:9200 actively refused by machine, i guess my elasticsearch is not working yet.gutasaputra

1 Answers

0
votes

Failed to connect to localhost port 9200: Connection refused usually means that ElasticSearch is not running.

  1. Try to start ElasticSearch by running elasticsearch-x.x.x/bin/elasticsearch.

  2. The start log should contain no error messages, and say something like

    [2017-11-28T23:38:39,356][INFO ][o.e.h.n.Netty4HttpServerTransport]
    [okCzlUj] publish_address {127.0.0.1:9200},
    bound_addresses {[fe80::1]:9200}, {[::1]:9200}, {127.0.0.1:9200}
    
  3. Make sure your start log also says ElasticSearch is running on port 9200 as above.