首页 > 解决方案 > Elasticsearch 不会在 ubuntu 18.04.4 LTS 中启动

问题描述

所以我尝试用这个命令启动elasticsearch:

systemctl start elasticsearch.service

我得到了这个错误:

Job for elasticsearch.service failed because a fatal signal was delivered to the control process.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.

这是“journalctl -xe”输出:

mai 10 10:18:49 ouss kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/elasticsearch.service,task=java,pid=24534,uid=122
mai 10 10:18:49 ouss kernel: Out of memory: Killed process 24534 (java) total-vm:1564676kB, anon-rss:550924kB, file-rss:0kB, shmem-rss:0kB
mai 10 10:18:49 ouss kernel: oom_reaper: reaped process 24534 (java), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
mai 10 10:18:40 ouss systemd[1]: elasticsearch.service: Main process exited, code=killed, status=9/KILL
mai 10 10:18:49 ouss /usr/lib/gdm3/gdm-x-session[1336]: (EE) client bug: timer event4 debounce: offset negative (-1094ms)
mai 10 10:18:49 ouss /usr/lib/gdm3/gdm-x-session[1336]: (EE) client bug: timer event4 debounce short: offset negative (-1249ms)
mai 10 10:18:49 ouss /usr/lib/gdm3/gdm-x-session[1336]: (II) event6  - VirtualBox mouse integration: SYN_DROPPED event - some input events have been lost.
mai 10 10:18:40 ouss systemd[1]: elasticsearch.service: Failed with result 'signal'.
mai 10 10:18:40 ouss systemd[1]: Failed to start Elasticsearch.
-- Subject: Unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- Unit elasticsearch.service has failed.
-- 
-- The result is RESULT.

我的java版本:

openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

标签: elasticsearch

解决方案


按照官方https://www.elastic.co/guide/en/elasticsearch/reference/current/targz.html安装说明使用 tarball 安装解决了该问题。

请确保您用于运行 elasticsearch 进程的用户对 elasticsearch 进程正在写入的文件系统具有写入权限。有关与此相关的更多信息和错误,请参阅问题部分中的评论。

请使用https://askubuntu.com/questions/6723/change-folder-permissions-and-ownership获取有关如何在 ubuntu 中分配所有权的说明。


推荐阅读