Elasticsearch on raspberry pi 4 with raspbian

Anyone with a good description how ES can be run on a raspberry pi 4 with raspbian?
I have tried to use the information from this thread but was not successful.
When checking syslog I can see two lines saying elasticsearch starting and started but when running

service elasticsearch status

I get "Active: active (exited) ..."

And running

curl http://127.0.0.1:9200

gives me "... Failed to connect to 127.0.0.1 port 9200: connection refused"

I also appreciate suggestions how the logfiles will be created. I have modified /etc/elasticsearch/elasticsearch.yml and logging.yml - uncommenting the lines for log patch and changing es.logger.level: DEBUG but cannot find anything.

Thanks for any help!

A good first place to look is at systemctl.

I JUST installed Elasticsearch (dpkg -i --force-all --ignore-depends=libc6 elastic)... and this is what I see:

oot@raspberrypi:~# systemctl -l status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2019-09-27 21:00:08 CDT; 3s ago
Docs: http://www.elastic.co
Process: 861 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 861 (code=exited, status=1/FAILURE)

Sep 27 21:00:08 raspberrypi systemd[1]: Started Elasticsearch.
Sep 27 21:00:08 raspberrypi elasticsearch[861]: could not find java in JAVA_HOME or bundled at /usr/share/elasticsearch/jdk/bin/java
Sep 27 21:00:08 raspberrypi systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Sep 27 21:00:08 raspberrypi systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

That's pretty obvious -- in my case, I need to set JAVA_HOME in...

root@raspberrypi:~# grep -i JAVA_HO /etc/default/elasticsearch
#JAVA_HOME=

.... ANNNNNNDDDD... now all is well (n.b., I show you what I did, too):

root@raspberrypi:~# systemctl -l status elasticsearch.service
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: active (running) since Fri 2019-09-27 21:07:24 CDT; 3s ago
Docs: http://www.elastic.co
Main PID: 1011 (elasticsearch)
Tasks: 21 (limit: 4915)
Memory: 52.4M
CGroup: /system.slice/elasticsearch.service
├─1011 /bin/bash /usr/share/elasticsearch/bin/elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet
├─1051 /usr/lib/jvm/java-1.11.0-openjdk-armhf/bin/java -cp /usr/share/elasticsearch/lib/* org.elasticsearch.tools.launchers.JvmOptionsParser /etc/elasticsearch/jvm.options
└─1068 /usr/lib/jvm/java-11-openjdk-armhf/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.cache

Sep 27 21:07:24 raspberrypi systemd[1]: Started Elasticsearch.
root@raspberrypi:~# grep -i JAVA_HO /etc/default/elasticsearch
JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-armhf

The short version:

  1. In /etc/default/elasticsearch, set JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-armhf
  2. restart/start Elasticsearch (systemctl restart elasticsearch)

And here's another approach:

Hi Todd,
Thank you for helping.
I have modified JAVA_HOME but still I get this:

pi@rpi4-cloud:~ sudo systemctl restart elasticsearch.service pi@rpi4-cloud:~ systemctl -l status elasticsearch.service
● elasticsearch.service - LSB: Starts elasticsearch
Loaded: loaded (/etc/init.d/elasticsearch; generated)
Active: active (exited) since Sat 2019-09-28 13:18:42 CEST; 5s ago
Docs: man:systemd-sysv-generator(8)
Process: 27832 ExecStart=/etc/init.d/elasticsearch start (code=exited, status=

Sep 28 13:18:42 rpi4-cloud systemd[1]: Starting LSB: Starts elasticsearch...
Sep 28 13:18:42 rpi4-cloud systemd[1]: Started LSB: Starts elasticsearch.
lines 1-8/8 (END)

How did you install elasticsearch (repository or deb)?
... and which version?

kr,
Martin