无法使用grafana云访问elasticsearch的数据源

时间:2017-11-27 11:37:46

标签: elasticsearch grafana

我使用grafana cloud来创建可视化但是当我尝试使用elasticsearch加载数据源时,我得到502错误。 502 Error

2 个答案:

答案 0 :(得分:0)

502通常表示网关不良(没有连接),并且该IP地址看起来像内部IP地址。 GrafanaCloud是一项云服务,因此无法访问内部IP地址。

您的选择是:

  1. 如果您不想通过互联网打开任何内容,请在本地安装Grafana。
  2. 使用直接模式而不是代理模式。这意味着请求将直接从您的浏览器发送到elasticsearch服务器,而不是通过Grafana后端服务器。但是,GrafanaCloud位于https上,因此您将收到混合内容警告,您需要通过在弹性搜索服务器前面设置代理(或通过为服务器设置https)来解决此问题。
  3. 通过互联网访问您的服务器。为elasticsearch服务器设置静态IP地址,设置防火墙规则等,以便GrafanaCloud可以查询您的服务器。

答案 1 :(得分:0)

config/elasticsearch.yml中添加以下配置:

transport.host: localhost 
transport.tcp.port: 9300 
http.port: 9200
network.host: 0.0.0.0