Kibana deployment issue on server . . . client not able to access GUI

elasticsearch, kibana, logstash

Solution

If your Kibana and ES are installed on the same box, you can have it auto-detect the the ES URL/IP by using this line in your Kibana's config.js file:

/** @scratch /configuration/config.js/5
 * ==== elasticsearch
 *
 * The URL to your elasticsearch server. You almost certainly don't
 * want +http://localhost:9200+ here. Even if Kibana and Elasticsearch are on
 * the same host. By default this will attempt to reach ES at the same host you have
 * elasticsearch installed on. You probably want to set it to the FQDN of your
 * elasticsearch host
 */
elasticsearch: "http://"+window.location.hostname+":9200",

This is because the interface between Kibana and ES is via JavaScript, and so using `127.0.0.1` or `localhost` actually points to the client machine (that the browser is running on) rather than the server.

Problem

I have configured Logstash + ES + kibana on 100.100.0.158 VM and Kibana is running under apache server. port 8080 Now what my need is . . I just have to give URL "100.100.0.158:8080/kibana" to client so client can see his data on web. When when I put this URL on client browser I am getting this error "can't contact elasticsearch at http://"127.0.0.1":9200 please ensure that elastic search is reachable from your system" Do I need to configure ES with IP 100.100.0.158:9200 or 127.0.0.1:9200 is ok . . ! Help . . ! Thanks Tushar

Original source