Deploying Elasticsearch on a Raspberry Pi
The Raspberry Pi is capable of running the NoSQL database Elasticsearch.
Either use Arch Linux ARM or the Raspbian Lite (Stretch) image and add the Elasticsearch apt repository. The packages are cross platform, but there are no official arm packages in the debian repository, so you need to force
deb [arch=amd64] http://packages.elasticsearch.org/elasticsearch/5.x/debian stable main
- Mount a btrfs formatted USB stick to
nodatacow,noatime,nobarrier. COW should always be disabled for directories with database files.
elasticsearch kibanaand NodeJS (on ArchLinux with Kibana 5.5, you need
- Set the Elastic jvm minimum/maximum heap size to 1/2 of your Pi’s RAM. The rest will be used by Elastic’s Lucene backend.
- Disable system call filter checks on startup with
bootstrap.system_call_filter: falsebecause the Raspberry Pi does not support JNI, which Elastic tries to import in order to run the checks.
- Increase ping timeouts. The Raspberry Pi needs several minutes to start Elasticsearch and will timeout often.
- Set up clustering: specify a cluster name, add a few
discovery.zen.ping.unicast.hostsand most importantly increase
discovery.zen.minimum_master_nodesto the minimum number of nodes / 2 + 1. The initial discovery will take a long time with timeouts from the Raspberry Pis in the cluster and increasing the minimum number of nodes will prevent the “split brain” where multiple Raspberry Pis elect themselves at masters.
Having tested an Elasticsearch cluster with a 20G index across 3 Raspberry Pi nodes and my laptop, I cannot recommend it. Performance was awful, syncing data took hours, and removing the Pis from the cluster again was a pain.