I recently upgraded an old ELK stack, moving Kibana from version 3 to version 4 and Elasticsearch from 1.3 to 1.5. After the upgrade, Kibana 4 still felt rough, so I rolled it back to Kibana 3.
After downgrading, Kibana stopped working and kept showing this message:
Error Could not contact Elasticsearch at http://elasticsearch.host:9200. Please ensure that Elasticsearch is reachable from your system.
Directly visiting port 9200 on the Elasticsearch host from the browser worked fine, which showed that Elasticsearch itself was reachable.
Opening Chrome DevTools and checking the Console revealed the real error:
XMLHttpRequest cannot load http://elasticsearch.host:9200/_nodes. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://log.host' is therefore not allowed access.
The fix is to enable CORS in elasticsearch.yml:
1 | http.cors.allow-origin: "/.*/" |
Reference: