繁体   English   中英

如何在 Elastic 中远程访问 Kibana

[英]How to remotely access Kibana in Elastic

我目前正在尝试通过浏览器远程访问我的 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"

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

服务器端口:5601

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

server.host: "0.0.0.0"

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

elasticsearch.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

我按照这些步骤将 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 超过 9200 sudo 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 elasticsearch.hosts: ["http://34.103.134.135:9200"]

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM