Kibana 服务无法启动

Kibana 服务无法启动

我正在使用 Manjaro 并安装了 elasticsearch 和 kibana

yay -S elasticsearch kibana

启动elasticsearch服务效果很好

sudo systemctl start elasticsearch

我已经使用 /etc/kibana/kibana.yml 中的基本设置配置了 kibana:

server.port: 5601
server.host: "localhost"
elasticsearch.hosts: ["http://localhost:9200"]

但运行 kibana 总是失败:

❯❯❯ systemctl status kibana                                                                                                                                                              ✘ 7 
● kibana.service - Kibana - dashboard for Elasticsearch
     Loaded: loaded (/usr/lib/systemd/system/kibana.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Fri 2020-11-13 12:10:13 CET; 5min ago
    Process: 1609 ExecStart=/usr/bin/node --max-old-space-size=512 /usr/share/kibana/src/cli --config=/etc/kibana/kibana.yml (code=exited, status=1/FAILURE)
   Main PID: 1609 (code=exited, status=1/FAILURE)

Nov 13 12:10:13 Trinity systemd[1]: kibana.service: Scheduled restart job, restart counter is at 5.
Nov 13 12:10:13 Trinity systemd[1]: Stopped Kibana - dashboard for Elasticsearch.
Nov 13 12:10:13 Trinity systemd[1]: kibana.service: Start request repeated too quickly.
Nov 13 12:10:13 Trinity systemd[1]: kibana.service: Failed with result 'exit-code'.
Nov 13 12:10:13 Trinity systemd[1]: Failed to start Kibana - dashboard for Elasticsearch.

也许我正在监督某些事情。我应该怎么做才能正确启动它?

journal -u kibana

Nov 13 12:10:10 Trinity systemd[1]: Started Kibana - dashboard for Elasticsearch.
Nov 13 12:10:10 Trinity node[1419]: Kibana does not support the current Node.js version v15.0.1. Please use Node.js v10.22.1.
Nov 13 12:10:10 Trinity systemd[1]: kibana.service: Main process exited, code=exited, status=1/FAILURE
Nov 13 12:10:10 Trinity systemd[1]: kibana.service: Failed with result 'exit-code'.
Nov 13 12:10:11 Trinity systemd[1]: kibana.service: Scheduled restart job, restart counter is at 1.
Nov 13 12:10:11 Trinity systemd[1]: Stopped Kibana - dashboard for Elasticsearch.
Nov 13 12:10:11 Trinity systemd[1]: Stopped Kibana - dashboard for Elasticsearch.
Nov 13 12:10:11 Trinity systemd[1]: Started Kibana - dashboard for Elasticsearch.
Nov 13 12:10:11 Trinity node[1579]: Kibana does not support the current Node.js version v15.0.1. Please use Node.js v10.22.1.
Nov 13 12:10:11 Trinity systemd[1]: kibana.service: Main process exited, code=exited, status=1/FAILURE
Nov 13 12:10:11 Trinity systemd[1]: kibana.service: Failed with result 'exit-code'.
Nov 13 12:10:11 Trinity systemd[1]: kibana.service: Scheduled restart job, restart counter is at 2.
Nov 13 12:10:11 Trinity systemd[1]: Stopped Kibana - dashboard for Elasticsearch.
Nov 13 12:10:11 Trinity systemd[1]: Started Kibana - dashboard for Elasticsearch.
Nov 13 12:10:11 Trinity node[1589]: Kibana does not support the current Node.js version v15.0.1. Please use Node.js v10.22.1.
Nov 13 12:10:11 Trinity systemd[1]: kibana.service: Main process exited, code=exited, status=1/FAILURE
Nov 13 12:10:11 Trinity systemd[1]: kibana.service: Failed with result 'exit-code'.
Nov 13 12:10:12 Trinity systemd[1]: kibana.service: Scheduled restart job, restart counter is at 3.
Nov 13 12:10:12 Trinity systemd[1]: Stopped Kibana - dashboard for Elasticsearch.
Nov 13 12:10:12 Trinity systemd[1]: Started Kibana - dashboard for Elasticsearch.
Nov 13 12:10:12 Trinity node[1599]: Kibana does not support the current Node.js version v15.0.1. Please use Node.js v10.22.1.
Nov 13 12:10:12 Trinity systemd[1]: kibana.service: Main process exited, code=exited, status=1/FAILURE
Nov 13 12:10:12 Trinity systemd[1]: kibana.service: Failed with result 'exit-code'.
Nov 13 12:10:12 Trinity systemd[1]: kibana.service: Scheduled restart job, restart counter is at 4.
Nov 13 12:10:12 Trinity systemd[1]: Stopped Kibana - dashboard for Elasticsearch.
Nov 13 12:10:12 Trinity systemd[1]: Started Kibana - dashboard for Elasticsearch.
Nov 13 12:10:12 Trinity node[1609]: Kibana does not support the current Node.js version v15.0.1. Please use Node.js v10.22.1.
Nov 13 12:10:12 Trinity systemd[1]: kibana.service: Main process exited, code=exited, status=1/FAILURE
Nov 13 12:10:12 Trinity systemd[1]: kibana.service: Failed with result 'exit-code'.
Nov 13 12:10:13 Trinity systemd[1]: kibana.service: Scheduled restart job, restart counter is at 5.
Nov 13 12:10:13 Trinity systemd[1]: Stopped Kibana - dashboard for Elasticsearch.
Nov 13 12:10:13 Trinity systemd[1]: kibana.service: Start request repeated too quickly.
Nov 13 12:10:13 Trinity systemd[1]: kibana.service: Failed with result 'exit-code'.
Nov 13 12:10:13 Trinity systemd[1]: Failed to start Kibana - dashboard for Elasticsearch.

答案1

我花了无数时间试图让 Kibana 在 Arch 和 Manjaro 上工作。我终于成功了。

以下是我自己的笔记,以防其他人遇到同样的问题。

请注意,我是新手,坦率地说,我不知道自己在做什么,所以请谨慎行事。

  1. 安装完成后安装Kibanaelasticsearch

在 Arch 中,使用这个命令:

$sudo pacman -S kibana

在 Manjaro 中,我使用了添加/删除软件 GUI。搜索kibana,点击安装,然后应用

  1. 安装 Kibana 后,我更改了这些设置/etc/kibana/kibana.yml(取消注释以下行):
$ sudo nano /etc/kibana/kibana.yml

#server.port: 5601
#server.host: "localhost"
#elasticsearch.hosts: ["http://localhost:9200"]
  1. Kibana 需要node,但 Kibana 7.9.2-1 不适用于最新node版本。因此,您需要旧版本的 Node 才能工作,特别是 Node 10.22.1。为了安装这个旧版本的 Node,我使用了 NVM(Node Version Manager)。

我运行了这些命令:

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash
$ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
$ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
  1. 使用 NVM 安装节点 10.22.1。
$ nvm install v10.22.1

这将在此位置安装名为“node”的二进制文件:(/home/manjaro1/.nvm/versions/node/v10.22.1/bin 请注意,.nvm 目录是隐藏的)

  1. 安装后,我将现有节点文件 ( /usr/bin/node) 重命名为 ( /usr/bin/node) 我使用以下命令来实现:
$ cd /usr/bin
$ sudo mv -- node node_backup

注意:我不知道重命名此文件对于其他程序是否是一个好主意。

  1. 然后,我使用以下命令将新节点文件复制到 中/usr/bin(确保我从该/usr/bin目录运行该命令):
$ cd /usr/bin
$ sudo cp -- /home/manjaro1/.nvm/version/node/v10.22.1/bin/node node
  1. 我启用 Kibana 在启动时运行:
$ systemctl enable kibana
  1. 然后我启动了 Kibana
$ systemctl start kibana
  1. 并检查了状态:
$ systemctl status kibana
  1. 一切看起来都不错。然后我确保 Elasticsearch 正在运行 ( systemctl status elasticsearch) 并打开浏览器,然后转到 localhost:5601

几秒钟后,Kibana 控制面板出现。


有用的注释

  1. 在上面的步骤 5 和 6 中,您可以将现有节点文件保留在 中/usr/bin,并将版本 10.22.1 节点文件复制到/usr/bin新名称,例如node10221。在这种情况下,您需要对此文件进行更改:/usr/lib/systemd/system/kibana.service使用:
$ sudo nano /usr/lib/systemd/system/kibana.service

在以更改文件名开头的行中将ExecStart=/usr/bin/node文件名更改为新节点名称,如下所示:

ExecStart=/usr/bin/node10221

保存文件并启动或重新启动 Kibana:

$ systemctl start kibana 

或者

$ systemctl restart kibana
  1. 确保您使用的是eleasticsearch7.9.2-1 和Kibana7.9.2-1 并在安装elasticsearch之前安装Kibana

  2. 如果运行时出现问题:

$ systemctl status kibana

您可以使用以下方法排除故障:

$ journalctl -fu kibana.service
  1. 如果 Kibana 由于权限问题而无法启动,请使用以下命令检查权限:
$ ls -l
  1. 我的安装仅在本地运行,因此localhost在 kibana.yml 中使用对我来说效果很好。据我了解,如果您想允许远程访问,则需要更改此设置。

我希望这可以帮助别人。

相关内容