首页 > 解决方案 > 无法在 Ubuntu 20 上启动 Elasticsearch

问题描述

我正在尝试在安装后启动 elasticsearch。它抛出错误

elasticsearch.service 的作业失败,因为向控制进程传递了致命信号。有关详细信息,请参阅“systemctl status elasticsearch.service”和“journalctl -xe”。

运行后: systemctl status elasticsearch.service 。

● elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
     Active: failed (Result: signal) since Mon 2021-05-17 14:30:02 IST; 1min 56s ago
       Docs: https://www.elastic.co
    Process: 94558 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=killed, signal=KILL)
   Main PID: 94558 (code=killed, signal=KILL)

May 17 14:29:58 rohit-Lenovo-Legion-Y540-15IRH-PG0 systemd[1]: Starting Elasticsearch...
May 17 14:30:02 rohit-Lenovo-Legion-Y540-15IRH-PG0 systemd[1]: elasticsearch.service: Main process exited, code=killed, status=9/KILL
May 17 14:30:02 rohit-Lenovo-Legion-Y540-15IRH-PG0 systemd[1]: elasticsearch.service: Failed with result 'signal'.
May 17 14:30:02 rohit-Lenovo-Legion-Y540-15IRH-PG0 systemd[1]: Failed to start Elasticsearch.

在 journalctl -xe 中,我得到了这个

May 17 14:30:02 rohit-Lenovo-Legion-Y540-15IRH-PG0 kernel: Out of memory: Killed process 94558 (java) total-vm:9804148kB, anon-rss:5809744kB, file-rss:0kB, shmem-rss:0kB, UID:129 pgtables:11660kB oom_sc>
May 17 14:30:01 rohit-Lenovo-Legion-Y540-15IRH-PG0 CRON[94743]: pam_unix(cron:session): session opened for user root by (uid=0)
May 17 14:30:01 rohit-Lenovo-Legion-Y540-15IRH-PG0 CRON[94744]: (root) CMD ([ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi)
May 17 14:30:01 rohit-Lenovo-Legion-Y540-15IRH-PG0 CRON[94743]: pam_unix(cron:session): session closed for user root
May 17 14:30:02 rohit-Lenovo-Legion-Y540-15IRH-PG0 kernel: oom_reaper: reaped process 94558 (java), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
May 17 14:30:02 rohit-Lenovo-Legion-Y540-15IRH-PG0 systemd[1]: elasticsearch.service: Main process exited, code=killed, status=9/KILL
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- An ExecStart= process belonging to unit elasticsearch.service has exited.
-- 
-- The process' exit code is 'killed' and its exit status is 9.
May 17 14:30:02 rohit-Lenovo-Legion-Y540-15IRH-PG0 systemd[1]: elasticsearch.service: Failed with result 'signal'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit elasticsearch.service has entered the 'failed' state with result 'signal'.
May 17 14:30:02 rohit-Lenovo-Legion-Y540-15IRH-PG0 systemd[1]: Failed to start Elasticsearch.
-- Subject: A start job for unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit elasticsearch.service has finished with a failure.
-- 
-- The job identifier is 13124 and the job result is failed.
May 17 14:30:02 rohit-Lenovo-Legion-Y540-15IRH-PG0 sudo[94552]: pam_unix(sudo:session): session closed for user root
May 17 14:31:34 rohit-Lenovo-Legion-Y540-15IRH-PG0 kernel: [UFW BLOCK] IN=wlp0s20f3 OUT= MAC=90:78:41:e1:0c:67:ec:0d:e4:f9:4a:71:08:00 SRC=192.168.1.102 DST=192.168.1.108 LEN=390 TOS=0x00 PREC=0x00 TTL=>
May 17 14:31:35 rohit-Lenovo-Legion-Y540-15IRH-PG0 kernel: [UFW BLOCK] IN=wlp0s20f3 OUT= MAC=90:78:41:e1:0c:67:ec:0d:e4:f9:4a:71:08:00 SRC=192.168.1.102 DST=192.168.1.108 LEN=390 TOS=0x00 PREC=0x00 TTL=>
May 17 14:31:35 rohit-Lenovo-Legion-Y540-15IRH-PG0 kernel: [UFW BLOCK] IN=wlp0s20f3 OUT= MAC=90:78:41:e1:0c:67:ec:0d:e4:f9:4a:71:08:00 SRC=192.168.1.102 DST=192.168.1.108 LEN=390 TOS=0x00 PREC=0x00 TTL=>
May 17 14:31:37 rohit-Lenovo-Legion-Y540-15IRH-PG0 kernel: [UFW BLOCK] IN=wlp0s20f3 OUT= MAC=90:78:41:e1:0c:67:ec:0d:e4:f9:4a:71:08:00 SRC=192.168.1.102 DST=192.168.1.108 LEN=390 TOS=0x00 PREC=0x00 TTL=>
May 17 14:31:59 rohit-Lenovo-Legion-Y540-15IRH-PG0 systemd[1]: Started Run anacron jobs.
-- Subject: A start job for unit anacron.service has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit anacron.service has finished successfully.
-- 
-- The job identifier is 13197.
May 17 14:31:59 rohit-Lenovo-Legion-Y540-15IRH-PG0 anacron[94906]: Anacron 2.3 started on 2021-05-17
May 17 14:31:59 rohit-Lenovo-Legion-Y540-15IRH-PG0 anacron[94906]: Normal exit (0 jobs run)
May 17 14:31:59 rohit-Lenovo-Legion-Y540-15IRH-PG0 systemd[1]: anacron.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- The unit anacron.service has successfully entered the 'dead' state.

我的 ES 配置

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /var/lib/elasticsearch
#
# Path to log files:
#
path.logs: /var/log/elasticsearch
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
#network.host: 192.168.0.1
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

请帮我解决这个问题。

标签: elasticsearch

解决方案


推荐阅读