2

When I start elastic search, I see "Killed" on the console and the process ends. I am unable to get the elastic search process to start. What am I missing?

:~/elasticsearch-5.5.2/bin$ ./elasticsearch
Killed

If it is relevant, I am installing this on a VPS. I don't see any other error message - making it hard to debug.

Darth.Vader
  • 5,079
  • 7
  • 50
  • 90
  • Maybe check the memory settings? – Mena Sep 05 '17 at 13:18
  • @Mena - where can I check that? Also, what am I looking for? I just got started using elastic - hence the questions.. thanks. – Darth.Vader Sep 05 '17 at 13:19
  • Not particularly knowledgeable myself, but try and look at the heap settings somewhere around `/etc/sysconfig/elasticsearch`? – Mena Sep 05 '17 at 13:20
  • You can check `dmesg` after it's killed, to confirm that it was killed for memory use (this is very, very likely the case). If that's the issue try updating jvm.options (probably `elasticsearch-5.5.2/config/jvm.options`?) to limit to about half the memory your VPS has (update both the `Xms` and `Xmx` to the same number -- err on the lower side, not the higher side). – dshockley Sep 05 '17 at 13:37
  • Yes, it is running out of memory: Out of memory in UB 5315: OOM killed process 25169 (nginx) score 0 vm:86176kB, rss:880kB, swap:724kB Out of memory in UB 5315: OOM killed process 25169 (nginx) score 0 vm:86176kB, rss:880kB, swap:724kB [18842961.861257] Out of memory in UB 5315: OOM killed process 25227 (java) score 0 vm:2925476kB, rss:847800kB, swap:0kB – Darth.Vader Sep 05 '17 at 14:06

1 Answers1

8

As of configuring RAM usage by Elasticsearch

By default, elasticsearch tries to occupy 1Gb of RAM at start, so if your VPS has less than 1Gb of RAM you need to configure elasticsearch to use less RAM accordingly

As an alternative to above file configuration you can try export of corresponding environment variable

export ES_JAVA_OPTS="-Xms256m -Xmx256m"

and then check if it helps

./elasticsearch

Regarding the exit state

Killed

It most frequently indicates the OoM Killer process activity which is aimed on emergent RAM freeing to let Linux survive the lack of available RAM event. OoM Killer, as per his name, sends kill signal to some most memory-consuming user process.

As of VPS and it's virtualization model, there are some custom container-based OoM settings in effect (check out example for OpenVZ), so if you're 100% sure you're configured ealsticsearch correctly, and there is enough RAM to start its instance - contact your VPS provider to clarify possible limits (like 10% of RAM must always be free or OoM Killer is triggered otherwise)

Some debug approach to OoM Killer events is described in this answer

Kostiantyn
  • 1,856
  • 11
  • 13