2

我目前正在尝试通过浏览器远程访问我的 Kibana 仪表板。因此,用户可以远程监控索引和运行脚本。作为背景,我的弹性当前在 Windows 服务器上运行,我可以通过更新elasticsearch.yml并打开端口9200成功设置远程访问的“弹性 uri 搜索”(例如 http://[IP_ADDRESS]:9200) 。出于这个原因,我采取了类似的操作来远程访问 Kibana,更新kibana.yml并打开端口5601,但是我无法从本地机器上远程访问浏览器上的 kibana。它在浏览器上抛出ERR_CONNECTION_TIMED_OUT。查看我为 kibana.yml 更新的属性:

server.port: "5601"
server.host: "0.0.0.0"
elasticsearch.url: "http://localhost:9200"
4

2 回答 2

2

您需要将文件配置/etc/kibana/kibana.yml为 root:取消注释以下行:

服务器端口:5601

# Kibana is served by a back end server. This setting specifies the port to use.
server.port: 5601

服务器主机:“0.0.0.0”

# To allow connections from remote users, set this parameter to a non-loopback address.
server.host: "0.0.0.0"

弹性搜索.hosts

更改<your-elastic-server-ip>为您的弹性搜索服务器 IP,例如192.168.1.XX

# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["http://<your-elastic-server-ip>:9200"]

并检查防火墙上的端口:

$ sudo firewall-cmd --list-all

输出:

public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens33
  sources: 
  services: cockpit dhcpv6-client ftp ssh
  ports: 10000/tcp 3306/tcp 9200/tcp 5601/tcp
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 

如果您没有看到9200/tcp 5601/tcp端口打开,请使用 sudo 执行以下命令:

$ sudo firewall-cmd --zone=public --permanent --add-port 9200/tcp
$ sudo firewall-cmd --zone=public --permanent --add-port 5601/tcp
于 2020-06-07T23:56:14.047 回答
0

我按照这些步骤将 AWS EC2 上的远程 Elasticsearch 连接到我的本地 kibana。

备份您的原始 .yml 文件

sudo cp /etc/elasticsearch/elasticsearch.yml elasticsearch.yml.bk

sudo cp /etc/kibana/kibana.yml kibana.yml.bk

  1. 编辑安全组并添加新规则 - 自定义 TCP 端口 9200 可通过您的公共 IP v4 访问。

  2. ssh 到您的服务器并调整 ufw 以允许您的 ip 超过 9200sudo ufw allow from <your public v4 IP> to any port 9200

  3. 编辑 elasticsearch.yml 以添加network.host: 0.0.0.0 discovery.type: single-node Ref

  4. 在本地机器上编辑 kibana.yml 并添加elasticsearch.hosts: ["http://34.103.134.135:9200"]

  5. 转到http://localhost:5601/您应该在“发现”>“索引管理”下看到您的远程索引。`

于 2020-07-08T21:59:05.507 回答