summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-09-16 13:04:09 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-09-16 13:04:09 +0200
commite56ebd0e995e9c3ce98d951adf1a3052aa6127b2 (patch)
tree59a3615900ece13a6d4fb98821144bd7a77047bc
parentd545b2f1a7b578ad054bf11163120ba05e249ca8 (diff)
downloadblog-e56ebd0e995e9c3ce98d951adf1a3052aa6127b2.tar.gz
blog-e56ebd0e995e9c3ce98d951adf1a3052aa6127b2.zip
elasticsearch on a raspberry pi
-rw-r--r--content/tech/elasticsearch-raspberrypi.md23
1 files changed, 23 insertions, 0 deletions
diff --git a/content/tech/elasticsearch-raspberrypi.md b/content/tech/elasticsearch-raspberrypi.md
new file mode 100644
index 0000000..98c7111
--- /dev/null
+++ b/content/tech/elasticsearch-raspberrypi.md
@@ -0,0 +1,23 @@
+---
+categories:
+- software
+date: 2017-09-16
+title: Deploying Elasticsearch on a Raspberry Pi
+---
+
+The Raspberry Pi is capable of running the NoSQL database Elasticsearch.<!--more-->
+
+Either use [Arch Linux ARM]({{< ref "raspberrypi-bootstrapping.md" >}}) 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 `arch=amd64`:
+
+```
+deb [arch=amd64] http://packages.elasticsearch.org/elasticsearch/5.x/debian stable main
+```
+
+ * Mount a btrfs formatted USB stick to `/var/lib/elasticsearch` using `nodatacow,noatime,nobarrier`. COW should always be disabled for directories with database files.
+ * Install `elasticsearch kibana` and NodeJS (on ArchLinux with Kibana 5.5, you need `nodejs-lts-boron`).
+ * 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: false` because 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. `discovery.zen.ping_timeout: 60`
+ * Set up clustering: specify a cluster name, add a few `discovery.zen.ping.unicast.hosts` and most importantly increase `discovery.zen.minimum_master_nodes` to 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]({{< ref "scaling-elasticsearch.md" >}}) was a pain.