Elastic Search Killed on start up!

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 for installation.

I have 2GB installed memory and anytime I get >700mb free
In my jvm options i have set

Following is the output when I try to launch
future versions of Elasticsearch will require Java 11; your Java version from [/usr/lib/jvm/java-1.8.0-openjdk-] 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-] does not meet this requirement

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

Welcome to our community! :smiley:

Is that the entirety of the output after startup?

Yes warkolm. PFA screenshot.


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?


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 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?

Try running JAVA_HOME="" ./bin/elasticsearch

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 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?

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 :slight_smile:

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.