elasticsearch 服务器上的Kibana部署问题。客户端无法访问GUI,elasticsearch,logstash,kibana,elasticsearch,Logstash,Kibana" /> elasticsearch 服务器上的Kibana部署问题。客户端无法访问GUI,elasticsearch,logstash,kibana,elasticsearch,Logstash,Kibana" />

elasticsearch 服务器上的Kibana部署问题。客户端无法访问GUI

elasticsearch 服务器上的Kibana部署问题。客户端无法访问GUI,elasticsearch,logstash,kibana,elasticsearch,Logstash,Kibana,我已经在100.100.0.158虚拟机上配置了Logstash+ES+kibana,kibana在apache服务器下运行。端口8080 现在我需要的是。我只需要给客户提供URL“100.100.0.158:8080/kibana”,这样客户就可以在网上看到他的数据 当我把这个URL放在客户端浏览器上时,我得到了这个错误 “无法通过http://“127.0.0.1”:9200联系elasticsearch。请确保可以从您的系统访问elasticsearch” 我是否需要将ES配置为IP 10

我已经在100.100.0.158虚拟机上配置了Logstash+ES+kibana,kibana在apache服务器下运行。端口8080

现在我需要的是。我只需要给客户提供URL“100.100.0.158:8080/kibana”,这样客户就可以在网上看到他的数据

当我把这个URL放在客户端浏览器上时,我得到了这个错误 “无法通过http://“127.0.0.1”:9200联系elasticsearch。请确保可以从您的系统访问elasticsearch”

我是否需要将ES配置为IP 100.100.0.158:9200或127.0.0.1:9200就可以了

救命啊

谢谢
Tushar

如果您的Kibana和ES安装在同一个框中,您可以使用Kibana的config.js文件中的以下行让它自动检测ES URL/IP:

/** @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",

这是因为Kibana和ES之间的接口是通过JavaScript实现的,因此使用
127.0.0.1
localhost
实际上指向的是客户端机器(浏览器正在运行),而不是服务器。

这是关于iptables规则的。Kibana对web端口使用9292,但对elasticsearch查询使用9200。所以您必须为这些端口向iptables添加行

netstat -napt | grep -i LISTEN
您将看到这些端口:9200 9300 9301 9302 9292

iptables -I INPUT 4 -p tcp -m state --state NEW -m tcp --dport 9200 -j ACCEPT

请参阅详细信息:

修改elasticsearch配置文件elasticsearch.yml

追加或修改以下配置:

# Enable or disable cross-origin resource sharing.
http.cors.enabled: true

# Which origins to allow.
http.cors.allow-origin: /https?:\/\/<*your\.kibana\.host*>(:[0-9]+)?/
#启用或禁用跨源资源共享。
http.cors.enabled:true
#允许哪些来源。
http.cors.allow-origin:/https?:\/\/(:[0-9]+)/

这是由于kibana页面试图从elasticsearch加载jason数据造成的,出于安全原因,该数据将被阻止。

谢谢。但是我的ES+kibana正在.158服务器上成功运行。我的客户端计算机是.159,我想要的是打开客户端浏览器,键入服务器URL“100.100.0.158:8080/kibana”,然后查看日志。是的,明白了。当您的.159客户端访问.158处的服务器时,上面的配置将从您的浏览器窗口(在本例中为.158)获取主机名,并将其用作ES服务器,它将正常工作。当您使用
localhost
127.0.0.1
时,它实际上会指向您的客户端(.159)计算机。