Unable to start elasticsearch service

Unable to start elastisearch service on AWS EC2 instances.

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

systemctl status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
Active: failed (Result: signal) since Mon 2022-08-15 10:28:15 UTC; 49s ago
Docs: http://www.elastic.co
Process: 2377 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=killed, signal=KILL)
Main PID: 2377 (code=killed, signal=KILL)

Aug 15 10:28:13 ip-172-31-81-96.ec2.internal systemd[1]: Starting Elasticsearch...
Aug 15 10:28:14 ip-172-31-81-96.ec2.internal elasticsearch[2377]: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in ve...lease.
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal systemd[1]: elasticsearch.service: main process exited, code=killed, status=9/KILL
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal systemd[1]: Failed to start Elasticsearch.
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal systemd[1]: Unit elasticsearch.service entered failed state.
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal systemd[1]: elasticsearch.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

journalctl -xe
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 3259] 0 3259 27710 259 245760 0 -1000 sshd
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 3263] 0 3263 180962 1862 147456 0 0 ssm-agent-worke
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 3296] 0 3296 1068 26 53248 0 0 acpid
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 1030] 89 1030 22610 254 204800 0 0 pickup
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 1924] 0 1924 37127 330 331776 0 0 sshd
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 2326] 1000 2326 37127 329 319488 0 0 sshd
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 2327] 1000 2327 31185 247 90112 0 0 bash
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 2353] 0 2353 59951 269 311296 0 0 sudo
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 2354] 0 2354 47623 119 204800 0 0 su
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 2355] 0 2355 31184 247 86016 0 0 bash
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 2374] 0 2374 34860 49 118784 0 0 systemctl
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 2375] 0 2375 3834 30 77824 0 0 systemd-tty-ask
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: [ 2377] 995 2377 389937 213311 1884160 0 0 java
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/,ta
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal kernel: Out of memory: Killed process 2377 (java) total-vm:1559748kB, anon-rss:853240kB, file-rss:4kB, shmem-r
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal systemd[1]: elasticsearch.service: main process exited, code=killed, status=9/KILL
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal systemd[1]: Failed to start Elasticsearch.
-- Subject: Unit elasticsearch.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

-- Unit elasticsearch.service has failed.

-- The result is failed.
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal systemd[1]: Unit elasticsearch.service entered failed state.
Aug 15 10:28:15 ip-172-31-81-96.ec2.internal systemd[1]: elasticsearch.service failed.
Aug 15 10:28:47 ip-172-31-81-96.ec2.internal dhclient[2886]: XMT: Solicit on eth0, interval 125840ms.

Welcome to our community! :smiley:

You will need to check your full Elasticsearch log to see what is happening there.
Please also format your code/logs/config using the </> button, or markdown style back ticks. It helps to make things easy to read which helps us help you :slight_smile:

Hello there!
In your log we can see:

My question is:
how did you set up heap memory size?
You can check it in file:

/etc/elasticsearch/jvm.options

Lines:

## -Xms4g
## -Xmx4g

should be uncommented and values should be set for your needs.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.