# Elasticsearch run error

**URL:** <https://discuss.elastic.co/t/elasticsearch-run-error/302370>\
**Category:** Elasticsearch\
**Created:** [April 13, 2022, 5:02pm UTC](https://discuss.elastic.co/t/elasticsearch-run-error/302370 "2022-04-13T17:02:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dawiddudek](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dawiddudek](https://discuss.elastic.co/u/dawiddudek)\
**Post date:** [April 13, 2022, 5:02pm UTC](https://discuss.elastic.co/t/elasticsearch-run-error/302370/1 "2022-04-13T17:02:44Z")

</div>

Hi,

i tried install and run Elasticsearch but service is still failed.  
I try to run this on Ubuntu 20.04 LTS from apk, dpkg and archive.

i found [Elasticsearch: Job for elasticsearch.service failed - Stack Overflow](https://stackoverflow.com/questions/58656747/elasticsearch-job-for-elasticsearch-service-failed) but all this sugestion still not give the chance to run service

```auto
● elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
     Active: failed (Result: signal) since Wed 2022-04-13 18:52:39 CEST; 11s ago
       Docs: https://www.elastic.co
    Process: 5940 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=killed, signal=>
   Main PID: 5940 (code=killed, signal=KILL)

Apr 13 18:52:31 ubuntu systemd[1]: Starting Elasticsearch...
Apr 13 18:52:39 ubuntu systemd[1]: elasticsearch.service: Main process exited, code=killed, status=9/KILL
Apr 13 18:52:39 ubuntu systemd[1]: elasticsearch.service: Failed with result 'signal'.
Apr 13 18:52:39 ubuntu systemd[1]: Failed to start Elasticsearch.

```

```auto
Apr 13 18:52:39 ubuntu kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.>
Apr 13 18:52:39 ubuntu kernel: Out of memory: Killed process 5940 (java) total-vm:2979024kB, anon-rss:617468kB, file-rss:0kB, shmem-rss:0>
Apr 13 18:52:39 ubuntu kernel: oom_reaper: reaped process 5940 (java), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Apr 13 18:52:39 ubuntu systemd[1]: elasticsearch.service: Main process exited, code=killed, status=9/KILL

```

i dont have any idea about this. can someone help with this?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 14, 2022, 12:58am UTC](https://discuss.elastic.co/t/elasticsearch-run-error/302370/2 "2022-04-14T00:58:07Z")

</div>

What is the RAM GB on the VM?

What version of Elasticsearch?

Looks like you are out of memory, that's what they are says.

---

<div class="post-metadata">

**Author:** ![dawiddudek](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dawiddudek](https://discuss.elastic.co/u/dawiddudek)\
**Post date:** [April 14, 2022, 4:35am UTC](https://discuss.elastic.co/t/elasticsearch-run-error/302370/3 "2022-04-14T04:35:41Z")

</div>

on first moment 1GB, now i changed to 4GB but still that same

I made change as wrote

> As a JVM application, the **Elasticsearch** main server process only utilizes memory devoted to the JVM. The required memory may depend on the JVM used (32- or 64-bit). The memory used by JVM usually consists of:
> 
> - **heap space** (configured via `-Xms` and `-Xmx` )
> - **metaspace** (limited by the amount of available native memory)
> - **internal JVM** (usually tens of Mb)
> - OS-dependent memory features like **memory-mapped files**.
> 
> Elasticsearch mostly depends on the **heap memory** , and this setting manually by passing the `-Xms` and `-Xmx` (heap space) option to the JVM running the **Elasticsearch** server.

but this not helped

this VM is only for testing environment not for big project, can I run ES on this machine?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 14, 2022, 5:17am UTC](https://discuss.elastic.co/t/elasticsearch-run-error/302370/4 "2022-04-14T05:17:57Z")

</div>

What version of Elasticsearch are you running?

Did you set / change the heap space (configured via -Xms and -Xmx )?

What else other apps is running on this VM?

Yes, you should be available to run Elasticsearch on a 4GB But it depends on what else is running. Are you running kabana and logstash and everything else on this VM?

---

<div class="post-metadata">

**Author:** ![dawiddudek](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dawiddudek](https://discuss.elastic.co/u/dawiddudek)\
**Post date:** [April 14, 2022, 6:14am UTC](https://discuss.elastic.co/t/elasticsearch-run-error/302370/5 "2022-04-14T06:14:13Z")

</div>

ES 8.1.2

I changed the heap space (configured via -Xms and -Xmx ) with few different configuration - didn't work

depends on what else is running - i have Nifi on this VM and instaled Kibana

but if I install on different machine not help me, becouse everyting is running on phisical machine with 8GB ☹

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 14, 2022, 2:24pm UTC](https://discuss.elastic.co/t/elasticsearch-run-error/302370/6 "2022-04-14T14:24:51Z")

</div>

Yes you should be able to run on 4GB Machine but normal Elasticsearch is very greedy for RAM. it will try to take 50% of the RAM for heap.

Try this...

Shutdown Elasticsearch, Kibana and Nifi.

Set jvm.options

```auto
-Xms1g
-Xmx1g

```

Then start Elasticsearch and see if you get the same error.

---

<div class="post-metadata">

**Author:** ![dawiddudek](https://avatars.discourse-cdn.com/v4/letter/d/35a633/32.png) [@dawiddudek](https://discuss.elastic.co/u/dawiddudek)\
**Post date:** [April 14, 2022, 7:54pm UTC](https://discuss.elastic.co/t/elasticsearch-run-error/302370/7 "2022-04-14T19:54:58Z")

</div>

I reinstaled all services, changed alocation of RAM.  
when i first run this machine everithing was fine. when i run NiFi, ES changed status to failed

i think the conflict is with NiFi

but now i can't restart ES

```auto
[2022-04-14T21:49:33,191][INFO][o.e.n.Node] [ubuntu] stopping ...
[2022-04-14T21:49:33,260][INFO][o.e.x.w.WatcherService] [ubuntu] stopping watch service, reason [shutdown initiated]
[2022-04-14T21:49:33,269][INFO][o.e.x.w.WatcherLifeCycleService] [ubuntu] watcher has stopped and shutdown
[2022-04-14T21:49:33,322][INFO][o.e.x.m.p.l.CppLogMessageHandler] [ubuntu] [controller/3614] [Main.cc@176] ML controller exiting
[2022-04-14T21:49:33,348][INFO][o.e.x.m.p.NativeController] [ubuntu] Native controller process has stopped - no new native processes can be started
[2022-04-14T21:49:42,201][INFO][o.e.l.LicenseService] [ubuntu] license [3742f98b-918c-407c-acb8-5cbfe3caa5a0] mode [basic] - valid
[2022-04-14T21:49:42,227][INFO][o.e.x.s.a.Realms] [ubuntu] license mode is [basic], currently licensed security realms are [reserved/reserved,file/default_file,native/default_native]
[2022-04-14T21:49:42,414][INFO][o.e.g.GatewayService] [ubuntu] recovered [9] indices into cluster_state
[2022-04-14T21:49:43,325][INFO][o.e.n.Node] [ubuntu] stopped
[2022-04-14T21:49:43,333][INFO][o.e.n.Node] [ubuntu] closing ...
[2022-04-14T21:49:43,572][INFO][o.e.n.Node] [ubuntu] closed

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 12, 2022, 7:55pm UTC](https://discuss.elastic.co/t/elasticsearch-run-error/302370/8 "2022-05-12T19:55:04Z")

</div>

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