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

@martingwb_99 Use the last reply on this thread. Sorry about the double post there. I needed to edit the one, but couldn't, so I deleted it, but it takes 24 hours to withdraw, hence the double post.

Anyway, if you haven't already found your answer, this should work.

I found this post that solved it by installing Elastic 7.3.2 instead 7.4. Also for a Raspberry 4 with Raspbian Buster. Good enough to me.

@sadoht That's great. Keep in mind though his procedure won't work for 7.4. If you ever need to install the latest, it's worth copying the setup at the end of my post there and putting it somewhere.

@glassman Yes, I saw your posts for both Elasticsearch and Kibana. I recommend the reading to @anyone reaching this answer.

I actually decided for 7.3.2 after reading your post about Elasticsearch 7.4 hahaha It looks way too complex. 7.4 is quite recent. I have hope that it will get some official support in the near future, at least to solve the most hacky parts of your solution.

Also, I just managed to install Kibana 7.3.2 thanks to your post about 7.4. Thanks a lot for it. I can now confirm it works on a Raspberry 4 with Raspbian Buster.

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