ElasticSearch 2 stack on Odroid / Ubuntu 15

This post covers setting up ELK 2.0 stack on Odroid XU3-Lite Ubuntu 15 (ARM)


  • using official Java from Oracle (8, armv6_vfp_hflt)
  • ElasticSearch: 2.0, Kibana 4.2.0, Logstash 2.0
  • Kibana libjffi-1.2.so still doesn’t work for Odroid / Open JDK 7,8

Java had to be installed from Oracle in order to work with Kibana. Open JDK 7 failed with segfault. Open JDK 8 didn’t start Kibana

  • #export JAVA_HOME=.../jre

ElasticSearch installation was fairly straightforward

Kibana was bit complex, due to lack of binaries for ARM arch and Node.js requirement

  • download 4.2.x, https://www.elastic.co/downloads/kibana
  • as there are no binaries on the homepage, so I went for git master branch (4.3.0 at time of writing)
    • git clone https://github.com/elastic/kibana
  • latest master doesn’t work with ElasticSearch < 2.1, so I had to roll back sources manually to v4.2.0 (as this one is compatible with ES 2.0 being installed above)
    • cd kibana; git checkout v4.2.0
  • Kibana requires node.js. That somehow is not communicated in README

Logstash was a pain to install on previous Odroid Ubuntu, and same problem appear again


Delete all data from Elastic Search

curl -XDELETE 'http://localhost:9200/_all'

Make Logstash parse stdin

#cat logstash-cpu_temp-to-es.conf
input {
 stdin { }

filter {
 grok {
   match => { message => "created_at:%{NUMBER:created_at:int},sensor:%{WORD:sensor},temperature:%{NUMBER:temperature:int}" }
  date { match => ["created_at", "UNIX"] }
output {
 stdout { codec => dots }
 elasticsearch { hosts => ["localhost:9200"] }
sudo ~/bin/my.ls.odroid.cpu_temp.sh | ./bin/logstash -f logstash-monitocpu_temp-to-es.conf

Shared directory over network of few Raspberry PIs, Odroid and a laptop


  • how to have a directory of files transparently synced between many servers
  • How to setup GlusterFS on 2 Raspberry PIs, Odroid and Linux PC
  • Had to use same version (3.6.x) everywhere; compiled from sources
  • have a backup as a side effect :-)


When working with multiple servers I had a need to have 1 directory available on each machine that could be shared among all servers. It should be automatically synchronized when server boots up. Each file modification/creation should be pushed to other servers too.

The storage itself should be redundant – backup for “free”. When all-but-one server dies: I still can access and modify files.


I will use distributed filesystem: GlusterFS. Meant for high volume traffic.
I will use it to share 10MB of ~/etc and ~/bin/ only ;-)


Raspberry PI 1 hostname: rpi-0, OS: Raspbian
Raspberry PI 2 hostname: rpi-2, OS: Raspbian
Odroid XU3 Lite, hostname: odroid, OS: Ubuntu 14
Laptop PC, OS: Debian Jessie

APT vs ./configure && make && make install

Unfortunately GlusterFS packages that come with Raspbian (R PI OS) and Ubuntu 14 (Odroid) and Debian Jessie are completely different in versions (3.2.x, 3.4.x). They’re all 3.x and install & run fine. However Odroid version wasn’t able to mount remote filesystem. I had to abandon using system packages in order not to waste any more time.

GlusterFS 3.7.x source code on Raspberry didn’t work with one dependency (liburcu), so I’ve used 3.6.x release with success.


Install the latest 3.6.x release


Install dependencies

sudo apt-get install libacl1-dev flex bison libreadline6-dev libxml2-dev libxml2 liburcu-dev liburcu1 python-dev make gcc flex bison libssl-dev liblvm2-dev libglib2.0-dev libxml2-dev python2.7 python2.7-dev autoconf libtool attr


./configure --prefix=/site/apps/glusterfs-3.6/ && make && sudo make install
ln -s /site/apps/glusterfs-3.6/ /site/apps/glusterfs/

Compilation took:

  • 75 min on Raspberry PI 1
  • 26 min on Raspberry PI 2
  • 4 min on Odroid XU3
  • 2 min on Intel i7

Setup GlusterFS

mkdir -p /site/apps/glustervol #glusterfs server storage, not meant for direct access
mkdir /mnt/glusterfs/          #mount point of gluster filesystem, you put your files here
sudo export PATH=$PATH:/site/apps/glusterfs/bin/:/site/apps/glusterfs/sbin/                       #you might put it in /etc/profile or visudo (secure_path)
sudo update-rc.d glusterd defaults

sudo /etc/init.d/glusterd start #on every machine, or simply reboot

Setup pool of GlusterFS servers

In order to distribute data (files) accross multiple GlusterFS severs and support failover (in case some servers are down, files are still accessible):

sudo gluster peer probe rpi-2
sudo gluster peer probe odroid
sudo gluster peer probe rpi-0
sudo gluster peer info  #you should see all machines except host

 Create distributed volume

sudo gluster volume create glustervol replica 3 transport tcp rpi-0:/site/apps/glustervol/ rpi-2:/site/apps/glustervol/ odroid:/site/apps/glustervol/ force
sudo gluster volume start glustervol
sudo gluster volume info

Mount on remote machines

sudo mount.glusterfs rpi-0,rpi-2,odroid:/glustervol /mnt/glusterfs/

Mount on startup in /etc/fstab:

rpi-0,rpi-2,odroid:/glustervol /mnt/glusterfs/ glusterfs defaults,nofail,_netdev 0 0

The way it’s mounted (several hostnames provided) will prevail situations when some of nodes are down. Mounted files will be transparently remounted to other available node. Wow!

Odroid XU3 Lite arrived – setup tips

These are the most useful tips distilled of my Odroid XU3 Lite experience. Nice, little alternative to Raspberry PI that is a LOT more powerful.

I was installing Ubuntu 14 LTS.
It might not work on Ubuntu 15.*

  • Loud fan software silencer
  • get current temperature (Ubuntu 14 only)
    watch sudo cat /sys/devices/10060000.tmu/temp
    cat /sys/devices/odroid_fan.14/fan_mode /sys/devices/odroid_fan.14/pwm_duty /sys/devices/odroid_fan.14/pwm_enable
  • Sabnzbd – setup usenet client
    sudo add-apt-repository ppa:jcfp/ppa
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install sabnzbdplus par2
    sudo vim /etc/default/sabnzbdplus
    sudo service sabnzbdplus restart
    sudo vim .sabnzbd/sabnzbd.ini #host = your-host-ip
  • minidlna – setup DLNA server, that is not in default repos. Missing from Ubuntu 14.04.1
    sudo add-apt-repository ppa:djart/minidlna
    sudo apt-get update
    sudo apt-get install minidlna
  • unrar – missing from Ubuntu 14.04.1
  • configure timezone
    sudo dpkg-reconfigure tzdata
  • powering off SATA HDD (this is a reminder in case of need to power off HDD remotely)
    echo 1 > /sys/block/(whatever)/device/delete
  • Image viewer
    sudo apt-get install geeqie
  • ffmpeg
    sudo apt-get install lame flac x264
    * download latest from: http://ffmpeg.org/releases/
    ./configure --enable-nonfree --enable-thumb --enable-neon --prefix=/usr/local/ffmpeg
    make -j5
    make install #convert flac to mp3
    file=foo.flac; flac -cd "$file" | lame -b 320 - "${file%.*}".mp3
  • useful packages
    sudo apt-get install dosfstools nocache
  • cleanup
    sudo apt-get remove --purge brltty
  • to get rid of “perl: warning: Setting locale failed
    sudo vi /etc/profile
    export LANGUAGE=en_GB.UTF-8
    export LANG=en_GB.UTF-8
    export LC_ALL=en_GB.UTF-8
    sudo locale-gen en_GB.UTF-8
    sudo dpkg-reconfigure locales