# Elastic Search Killed on start up!

**URL:** <https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737>\
**Category:** Elasticsearch\
**Created:** [October 1, 2020, 8:23pm UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737 "2020-10-01T20:23:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![aatif26](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@aatif26](https://discuss.elastic.co/u/aatif26)\
**Post date:** [October 1, 2020, 8:23pm UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/1 "2020-10-01T20:23:09Z")

</div>

I just installed elasticsearch 7.9.2 in my centos 7.8.2003. Whenever I run `./bin/elasticsearch` it just returns "killed" along with a bunch of warnings. I have referred [this](https://www.elastic.co/guide/en/elasticsearch/reference/current/targz.html) for installation.

I have 2GB installed memory and anytime I get \>700mb free  
In my jvm options i have set  
`-Xms512m`  
`-Xmx512m`

Following is the output when I try to launch  
` ./bin/elasticsearch`  
`future versions of Elasticsearch will require Java 11; your Java version from [/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre] does not meet this requirement`  
`future versions of Elasticsearch will require Java 11; your Java version from [/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre] does not meet this requirement`  
`Killed`

No logs are generated. Any idea where else can I check for logs and what is wrong here?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 1, 2020, 9:06pm UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/2 "2020-10-01T21:06:50Z")

</div>

Welcome to our community! 😃

Is that the entirety of the output after startup?

---

<div class="post-metadata">

**Author:** ![aatif26](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@aatif26](https://discuss.elastic.co/u/aatif26)\
**Post date:** [October 2, 2020, 10:49am UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/3 "2020-10-02T10:49:38Z")

</div>

Yes warkolm. PFA screenshot.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/0/105edc9a4b11042bf62572b0053c8a74ff0c147e.png)

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 2, 2020, 11:18am UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/4 "2020-10-02T11:18:52Z")

</div>

Hey!

Do you see by chance any output in `dmesg`. Also can you increase the heap to `1g` to test if that is the culprit. And lastly, try not setting `JAVA_HOME` and use the built-in JDK that ships with Elasticsearch (that will also remove that message).

Also how did you install Elasticsearch?

--Alex

---

<div class="post-metadata">

**Author:** ![aatif26](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@aatif26](https://discuss.elastic.co/u/aatif26)\
**Post date:** [October 2, 2020, 11:31am UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/5 "2020-10-02T11:31:02Z")

</div>

Hi Alexander,

I have to use `JAVA_HOME` because other applications are using it. If there is any way I can force elastic to use its own JDK which comes with itself then please guide me to do that.  
I have referred [this](https://www.elastic.co/guide/en/elasticsearch/reference/current/targz.html) for installation.  
I did try 1g heap but I get the same output as before.  
Nothing on `dmesg` either

Also I was wondering what is the minimum heap size required for elasticsearch to run?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [October 2, 2020, 11:50am UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/6 "2020-10-02T11:50:41Z")

</div>

Try running `JAVA_HOME="" ./bin/elasticsearch`

---

<div class="post-metadata">

**Author:** ![aatif26](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@aatif26](https://discuss.elastic.co/u/aatif26)\
**Post date:** [October 2, 2020, 12:55pm UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/7 "2020-10-02T12:55:47Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/8/9/891a218e6cea48b8f33091e559b6c85dae0d2d17.png)

---

<div class="post-metadata">

**Author:** ![aatif26](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@aatif26](https://discuss.elastic.co/u/aatif26)\
**Post date:** [October 2, 2020, 8:05pm UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/8 "2020-10-02T20:05:06Z")

</div>

Turns out you cannot run elasticsearch as root. I'm surprised nobody noticed these from my screenshots. Either people take it for granted that you are not running as root, or do not know about it.

I had to create a new VM with identical configuration and then install elasticsearch. Thereafter I got the error stack trace saying you cant run as root.  
Now all I needed to do was to follow [this](https://stackoverflow.com/questions/40766301/run-elastic-search-as-root-user) to make it run.

Why this error did not show in the previous VM is still a mystery to me. Maybe someone can explain here.

I also need one more information. What is the min heap size required by elasticsearch? Is it always 50% of main memory?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 2, 2020, 11:49pm UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/9 "2020-10-02T23:49:37Z")

</div>

> [@aatif26](#):
>
> I'm surprised nobody noticed these from my screenshots

Please don't post pictures of text, they are difficult to read, impossible to search and replicate (if it's code), and some people may not be even able to see them 🙂

---

<div class="post-metadata">

**Author:** ![aatif26](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@aatif26](https://discuss.elastic.co/u/aatif26)\
**Post date:** [October 5, 2020, 6:14pm UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/10 "2020-10-05T18:14:55Z")

</div>

Turns out you can run it as root.  
As I have done here.  
The issue is something else.

`[root@elastic-instance-1 ~]# sudo systemctl start elasticsearch.service`  
`[root@elastic-instance-1 ~]# sudo systemctl status elasticsearch.service`  
`● elasticsearch.service - Elasticsearch Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2020-10-05 18:12:37 UTC; 1min 17s ago Docs: https://www.elastic.co Main PID: 1939 (java) CGroup: /system.slice/elasticsearch.service ├─1939 /usr/share/elasticsearch/jdk/bin/java -Xshare:auto -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding... └─2146 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controller`

`Oct 05 18:12:11 elastic-instance-1 systemd[1]: Starting Elasticsearch...`  
`Oct 05 18:12:37 elastic-instance-1 systemd[1]: Started Elasticsearch.`

Readers please ignore my previous comment.

---

<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:** [November 2, 2020, 6:15pm UTC](https://discuss.elastic.co/t/elastic-search-killed-on-start-up/250737/11 "2020-11-02T18:15:02Z")

</div>

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