Being able to quickly rebuild from scratch when it comes to testing configuration options for enterprise architectures like elasticsearch clusters is particularly powerful.
Elasticsearch runs surprisingly well on Raspberry Pis. Obviously you don't get lightning performance (at least not from B/B+s, I haven't yet tried with Pi 2s) but for testing index mappings, with small amounts of data the lack of speed doesn't matter.
Here is my method for setting up an elasticsearch node on a Pi. To make a cluster, just add more Pis.
1. Download the latest Minibian image and burn it to an SD card. You'll need a big card, ideally 32GB.
2. Boot the Pi, login and modify the disk partitioning.
fdisk /dev/mmcblk0delete partition 2, then make a new one approx 2GB (4000000 sectors). Reboot.
3. Resize the new partition:
rsize2fs /dev/mmcblk0p24. Now create a partition using the remianing free space on the SD card for the elasticsearch data:
fdisk /dev/mmcblk05. Reboot so that new partition is available, then create an exxt4 filesystem
mkfs.ext4 /dev/mmcblk0p36. Create a directory to use as a mount point, and then add working directories inside it:
mkdir /elasticsearch7. Edit the /etc/fstab file so that the new partition is mounted automatically. Reboot again and check that the disk layout is what you'd expect.
mkdir /elasticsearch/work
mkdir /elasticsearch/data
mkdir /elasticsearch/plugins
mkdir /elasticsearc/logs
df -h8. Now do a software and firmware update:
apt-get update9. One final reboot!
apt-get install rpi-update
rpi-update
apt-get upgrade
10. Download and install the latest version of elasticsearch
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.deb11. Now edit the elasticsearch config (/etc/elasticsearch.yml) file to add a node name and make sure the paths for the work, data, plugins and logs reflect the /elasticsearch directories your cerated in step 6.
dpkg -i elasticsearch-1.4.4.deb
12. Now start elasticsearch
/usr/share/elasticsearch/bin/elasticsearch --config=/etc/elasticsearch.yml
What about RAM usage?
ReplyDeleteweeeeeeeeeeell, you have to edit the VM size.
ReplyDeleteThat's in /etc/elasticsearch/jvm.options. I have it 512m
Is it possible to run elastic with
ReplyDelete512mb RAM on Raspbean Jessie???