# Elasticsearch on raspberry pi 4 with raspbian

**URL:** <https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535>\
**Category:** Elasticsearch\
**Created:** [September 21, 2019, 3:51pm UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535 "2019-09-21T15:51:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![martingwb\_99](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@martingwb\_99](https://discuss.elastic.co/u/martingwb_99)\
**Post date:** [September 21, 2019, 3:51pm UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535/1 "2019-09-21T15:51:56Z")

</div>

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](https://discuss.elastic.co/t/elasticsearch-7-x-support-for-arm64-raspberry-pi-4-b/187976/11) 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](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!

---

<div class="post-metadata">

**Author:** ![Todd\_Sayers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/todd_sayers/32/45838_2.png) [@Todd\_Sayers](https://discuss.elastic.co/u/Todd_Sayers)\
**Post date:** [September 28, 2019, 2:08am UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535/2 "2019-09-28T02:08:30Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![Todd\_Sayers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/todd_sayers/32/45838_2.png) [@Todd\_Sayers](https://discuss.elastic.co/u/Todd_Sayers)\
**Post date:** [September 28, 2019, 2:10am UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535/3 "2019-09-28T02:10:19Z")

</div>

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`)

---

<div class="post-metadata">

**Author:** ![Todd\_Sayers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/todd_sayers/32/45838_2.png) [@Todd\_Sayers](https://discuss.elastic.co/u/Todd_Sayers)\
**Post date:** [September 28, 2019, 2:38am UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535/4 "2019-09-28T02:38:51Z")

</div>

And here's another approach:

> [@Elasticsearch 7.x support for ARM64 (Raspberry Pi 4 B)](https://discuss.elastic.co/t/elasticsearch-7-x-support-for-arm64-raspberry-pi-4-b/187976/9):
>
> You will need to open the file /var/lib/dpkg/status and do a search for elasticsearch. This should bring you to a section that looks like this: Package: elasticsearch Status: install ok half-configured Priority: optional Section: web Installed-Size: 196305 Maintainer: Elasticsearch Team \<info@elastic.co\> Architecture: amd64 Source: elasticsearch Version: 7.2.0 Depends: bash (\>= 4.1), lsb-base (\>= 4), adduser, coreutils (\>= 8.4) What you want to do here is remove the dependency from the "Depen…

---

<div class="post-metadata">

**Author:** ![martingwb\_99](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@martingwb\_99](https://discuss.elastic.co/u/martingwb_99)\
**Post date:** [September 28, 2019, 11:21am UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535/5 "2019-09-28T11:21:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![glassman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glassman/32/55504_2.png) [@glassman](https://discuss.elastic.co/u/glassman)\
**Post date:** [October 23, 2019, 2:55am UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535/6 "2019-10-23T02:55:57Z")

</div>

@martingwb_99 Use [the last reply on this thread](https://discuss.elastic.co/t/installing-elasticsearch-7-4-on-a-raspberry-pi-4-raspbian-buster/202599). 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.

---

<div class="post-metadata">

**Author:** ![sadoht](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sadoht/32/49309_2.png) [@sadoht](https://discuss.elastic.co/u/sadoht)\
**Post date:** [October 26, 2019, 6:21pm UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535/7 "2019-10-26T18:21:09Z")

</div>

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.

> **[Setup Elasticsearch 7.x Cluster on Raspberry Pi / ASUS Tinker Board](https://medium.com/hepsiburadatech/setup-elasticsearch-7-x-cluster-on-raspberry-pi-asus-tinker-board-6a307851c801)**
>
> Hardware

---

<div class="post-metadata">

**Author:** ![glassman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glassman/32/55504_2.png) [@glassman](https://discuss.elastic.co/u/glassman)\
**Post date:** [October 27, 2019, 6:50pm UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535/8 "2019-10-27T18:50:20Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![sadoht](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sadoht/32/49309_2.png) [@sadoht](https://discuss.elastic.co/u/sadoht)\
**Post date:** [October 27, 2019, 7:36pm UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535/9 "2019-10-27T19:36:36Z")

</div>

@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.

---

<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 24, 2019, 7:36pm UTC](https://discuss.elastic.co/t/elasticsearch-on-raspberry-pi-4-with-raspbian/200535/10 "2019-11-24T19:36:38Z")

</div>

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