7

'Error Could not contact Elasticsearch at http://localhost:9200. Please ensure that Elasticsearch is reachable from your system.'

Currently I am following http://packetbeat.com/getstarted

I installed

  1. elastic search - running on localhost:9200 - returns the json, 2.packetbeat - running,
  2. Kibana on port 8000

Now, I change my kibana/config.js file - enter ,

elasticsearch: "http://"localhost":9200",

under elasticsearch. I get a plain white page with {{dashboard.current.title}} on top.

If I comment out elasticsearch: "http://"localhost":9200",

I get Error Could not contact Elasticsearch at http://localhost:9200. Please ensure that Elasticsearch is reachable from your system.

If I also enter it as elasticsearch: "http://localhost:9200",, I get the same error that it could not contact elasticsearch.

So, I am assuming elasticsearch: "http://"localhost":9200", is right, but it should render something. perhaps a UI

2
  • What happens when you access localhost:9200 directly in your browser? Does it connect?
    – tsg
    Feb 4 '15 at 11:21
  • Can you add the output of curl http://127.0.0.1:9200, also the correct format for the elasticsearch setting is: elasticsearch: "http://localhost:9200" the way you have it is printing {{dashboard.current.title}} because the setting elasticsearch: "http://"localhost":9200" breaks the js. Finally, what does host localhost resolve to on your system?
    – Zypher
    Apr 16 '15 at 20:12
2

You need to make sure the elaticsearch_url is set in your kibana config.

vim /opt/kibana/config/kibana.yml

elasticsearch_url: "http://localhost:9200"

then restart:

sudo service kibana restart

Source: Logz

0

Check your elasticsearch listen in /etc/elasticsearch/elasticsearch.yml

Check if elasticsearch is up :) (ps -ef |grep elasticsearch)

If not restart it.

And check if you don't firewall your 9200 port . because kibana need to connect to elasticsearch .

All kibana job is done with request on elasticsearch database on port 9200 .

2
  • To add some info , kibana is just a library running on your browser :)
    – YuKYuK
    Jan 22 '15 at 13:39
  • But firewall won't be an issue...localhost
    – stephen
    Aug 27 '16 at 12:32
0

In my case the problem was caused by the HTTP_PROXY environment variable being set and the proxy server being down.

It's not the most obvious cause, and there is no obvious way from the error message that you would think to look at that.

0

For local development, you may want to enable CORS by editing your Elasticsearch YAML file:

For instance:

http.cors.enabled: true
http.cors.allow-origin: "*"

(For production workloads, you should tighten it up).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.