HubbleCommand.github.io

Personal blog, project documentation, and ramblings

Setting up Elasticsearch on a Raspberry Pi 4

Posted 17 Sep 2020

NOTE! This will NOT work on anything below a Raspberry Pi 3, as 64 bit OSs are not supported. I haven’t tested this on a Raspberry Pi 3, so there might be RAM / CPU power problems there. I have encountered similar problems when trying to create a Concrete 5 website with Composer on a Pi3+ that wouldn’t work due to lack of RAM, vs on a Pi4 that had no problems.

It is actually quite easy to get Elasticsearch installed onto a Raspberry Pi (as long as you don’t mind switching to a different OS!).

You need is a 64-bit OS, which is supported by Raspberry Pi 3 & 4. A good one that is easy to install is Ubuntu Server. The Ubuntu tutorial has an optional step to install a desktop step. However, I strongly recommend against it. I encounter no problems while running the server OS with no desktop, however with a desktop installed there are (obviously) huge performance hits, as well as frequent crashes. If you need to work on the Pi itself, I suggest just using SSH, either in terminal, or if you have to work on projects on the Pi, setup VS Code to edit files / folders through SSH.

With a 64-bit OS installed, installing Elasticsearch is a breeze. You can just follow the official tutorial, and it should install no problem.

You can then execute curl -XGET 'http://localhost:9200' in the command line to check that it’s all working. If everything’s good, you should get a response like:

{
  "name" : "ubuntu",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "gEl_HSLdRBKpnlDbEtwJgw",
  "version" : {
    "number" : "7.9.2",
    "build_flavor" : "default",
    "build_type" : "deb",
    "build_hash" : "d34da0ea4a966c4e49417f2da2f244e3e97b4e6e",
    "build_date" : "2020-09-23T00:45:33.626720Z",
    "build_snapshot" : false,
    "lucene_version" : "8.6.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

Note that you will need to execute this command on the Pi itself (or while SSHed into it), or configure ES to allow connections outside of Localhost.