Thursday, December 31, 2015

InfluxDB, Telegraf and Grafana on Raspberry Pi 2

Grafana is a great data visualization application. I use it all the time for all kinds of purposes, most notably to chart information from my weather station. Recently there have been some serious changes in Telegraf that will make it play nicely with InfluxDB 0.9+

Since we're at the awesome I have recently bought a Raspberry Pi 2 Model B. It's a great little machine with 4 cores and 1GB of RAM. That got me thinking: how about installing influxDB, Telegraf and Grafana on it?

Unfortunately it is not so simple. There are no official packages of the latest version for Raspbian, not to mention the 0.3.0-beta2 version of Telegraf. So to use it I have had to compile it myself. Compiling Go programs is actually quite easy with GVM and RVM but one needs to learn how to use it first. There are some resources on the Internet to help out with the process but the biggest problem of all is high CPU usage over long period of time during compilation which leads to high CPU temperatures (up to 70°C). There are 3 methods to overcome that problem

  • Buy radiators (already on the way)
  • Cool it down with a fan
  • Find pre-compiled packages

I went with the second option which kept the CPU at a steady 34°C but let me tell you with the Go compiler compilation it took forever (5h+) on the little machine. To not have to do it again I have prepared all 3 packages so that I, and everyone else willing to try it out can grab them and skip the boring part.


Now all that is left is to download those packages and to install them using dpkg -i <package-name>.

There are 2 things to note: one, there will be no telegraf database by default (need to create one yourself using the WUI - web user interface - CREATE DATABASE "telegraf") and there is no defaults file for telegraf which will make it impossible for it to start right out of the box. To fix it create one like so:

sudo touch /etc/default/telegraf

Also grafana-server service isn't enabled by default. This is mentioned at the end of the installation but for convenience here are the enchantments to make it work

sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server
sudo /bin/systemctl start grafana-server

Edit on January 11th 2016
As oriste pointed out the grafana package is a lot smaller than the one for Linux x64 found on grafana site. I have looked at it and the reason for it is that my package does not include the phantomjs binary in /usr/share/grafana/vendor/phantomjs/ folder that is used to prepare snapshots for sharing. If you'd like to use it you can always get the binary from

Edit on January 11th 2016
I have verified the packages and added some installation procedures that will help out put a monitoring solution using the three tools.

Edit on October 6th, 2016
There are ready-made packages for the armhf for Telegraf and InfluxDB now. Use those instead!
. You might be puzzled as to how to download the deb packages for armhf. What you do is you take the URL of the amd64 package, change the architecture in the URL to armhf and presto - you get a link to the RPi package, for example:
change amd64 to armhf and you get

Similar with InfluxDB:
change amd64 to armhf and you get

It seems those packages are available for every build but not directly listed on the page - hence the URL magic you need to do to get them

Have fun!


Anonymous said...

Hi! I appreciate very much what you've done. I've been trying to compile and install these packages myself with some success, but I keep stumbling over the correct locations where to put the whole damn thing in an orderly fashion. I'm a bit surprised about your compile times and cpu temperatures. On my Raspberry Pi 2 the backend compile went very smoothly and finished in half an hour or less. No extremely high temperatures either. The fronted (npm dependency hell) was a whole other matter :-(.
But eventually everything went well and I got statsd-influxdb-grafana all up and talking to each other. Problem arose when I wanted to run them as daemon process at startup and put them nicely into their proper places as well-behaving packages should. I messed up so completely that I still haven't rebounded from the havoc I created after a full day :-( I'm pretty new and unfamiliar with anything Linux, having only vague Unix memories from the eighties, last century, thats right!
So I was hoping I might do a regular dpkg install and clean everything up in the process. One question: your Grafana package seems mighty slim at 8.6MB. My grafana-server executable alone is 16.4MB. I noticed the regular Debian (x86) package on the Grafana site is about 23MB which seems more appropriate. Can you explain why your's is so thin?
Thanks again for the packages!

Frans van Bree said...

Yo man, thanks a million! Saved me all the hassle of compiling it myself and I already have your v2.6 package running while I type this and enjoying the new Table panel on RPi2...

I hope the entire internet will find this gem!

Matthias Hryniszak said...

The grafana-server executable in my package is 16343k. I'm guessing that the packaging took it down to 8MB and change. I have not tried it yet on a fresh system (gonna try when my new SD card class 10 will arrive) but looking at the content of the package (and obviously having tried it out on the system I built it on before) all worked as expected.

At the end of the Grafana installation there are instructions on how to run it as system daemon. I followed them to the letter and all was good. But that as I mentioned on a system having all the build dependencies installed.

I have build all parts of it myself, including go and all dependencies. I used go 1.5.2.

The difference from what I can tell right away is that my package does not include the phantomjs binary in /usr/share/grafana/vendor/ folder. I don't know why that is the case or if it even is necessary but my guess is that if it is available on the path then it should be possible to use that one instead.

Matthias Hryniszak said...

A brief search for "grafana phantomjs" revealed that the latter binary is used to do snapshots (as per So if ones does not use it it is not necessary. Otherwide download one from

Unknown said...

Hi, thank you so much for your instructions, I successfully installed grafana with your package!
However, I can't seem to be able to do the same with influxdb, I get an error when I run the daemon:
run: open server: open meta store: raft: new bolt store: madvise: function not implemented

Full output:

Would you have any advise to fix this issue?

Unknown said...

Hi, thank you so much for your instructions, I successfully installed grafana with your package!
However, I can't seem to be able to do the same with influxdb, I get an error when I run the daemon:
run: open server: open meta store: raft: new bolt store: madvise: function not implemented

Full output:

Would you have any advise to fix this issue?

Matthias Hryniszak said...

@Forcie It's completely new to me. Did you find what caused it?

Unknown said...

Hi, first of all let me say thank you for the compiled packages. Now, I'm using a Raspberry Pi in which I've installed Elastichsearch, then I moved on installing the grafana_2.6.0_armhf.deb, everything seems smooth until I tried to start/restart the grafana-server service. It seems to be a problem with the grafana-server in init.d. Do you have any clues what could be happening here? Please let me know if I need to post any other data so you can help me troubleshoot this. Thank you in advance for your time. Ezequiel

Julian said...

Minor error at the end:

sudo touch /etc/defaults/telegraf

should actually be:

sudo touch /etc/default/telegraf

e.g. default singular not defaults plural.

Thanks for this though, saved me lots of pain!!

Matthias Hryniszak said...

Fixed - thank you!

Felix Mann said...

Hi! First off, thanks for taking the time to compile this AND document it on your blog! Much appreciated!

I've installed your package for Grafana on my raspbian jessie running on a Pi Compute Module. Unfortunately when running /usr/sbin/grafana-server I get the following message:

Illegal instruction

Could you point me in the right direction for fixing this problem? Or is the binary not at all compatible with the Pi 1? I can't imagine that something that is compiled for the Pi2 won't work on the Pi1 :S.


Felix Mann said...

I just learned something today :'). So the Pi (1) actually DOES differ from the Pi 2 (ARMv6 vs. ARMv7). Too bad I'm using a board with a slot for the Compute Module. As far as I know there aren't any modern Pi boards for this form factor :(.

Matthias Hryniszak said...

@Felix Mann I have to tell you this is the first time I hear about this form factor of a RPi. I wonder what the might be, if it is the CPU that is incompatible or the memory requirement is actually bigger (that'd mean the regular RPi 1 would also not work!). Quite frankly I have neither so I am unable to verify that. Sorry..

aNdY said...

Hi, Matthias,
Many thanks for your packages. It really saves me a lot of compiling time. now I can forget the sleepless days.
Thanks a lot.

Unknown said...

Hi Matthias,
i instaled grafana package from your build and when I start with sudo /bin/systemctl start grafana-server it seems ok. But if i check status i get:
grafana-server.service - Starts and stops a single grafana instance on this system
Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; enabled)
Active: failed (Result: signal) since Thu 2016-11-10 09:09:54 UTC; 25s ago
Process: 19402 ExecStart=/usr/sbin/grafana-server --config=${CONF_FILE} --pidfile=${PID_FILE} cfg:default.paths.logs=${LOG_DIR}${DATA_DIR} (code=killed, signal=ILL)
Main PID: 19402 (code=killed, signal=ILL)

Nov 10 09:09:53 raspberrypi systemd[1]: Started Starts and stops a single grafana instance on this system.
Nov 10 09:09:54 raspberrypi systemd[1]: grafana-server.service: main process exited, code=killed, status=4/ILL
Nov 10 09:09:54 raspberrypi systemd[1]: Unit grafana-server.service entered failed state.

and Grafana doesn't work.
have you any idea?

Thanks, Petr

Matthias Hryniszak said...

@PetrFory Not really. But you might want to try the other builds, for example and see if this is a problem with my build or your environment.

Unknown said...
This comment has been removed by the author.
Unknown said...

Matthias -

Thanks for the write-up! Would you mind linking to the ready made armhf packages for Influxdb? I think I found the right ones on Debian's site, but they seem older than the current Influxdb release.


Matthias Hryniszak said...

@Roddie Hasan Done! Enjoy!

Unknown said...

Hi, @ Petr Fory, looks like I have the same issue ...
You found any work-around ? said...

Hi, @ Petr Fory,
also I have same problem.
I installed Grafana on Raspberry pi b+.
Is it a problem ?
Have you solved ?

Felix Mann said...

The build does not work on Raspberry B+ due to the different processor instruction set. You should try a build that is compatible with the B+ instead.

Check out my build for B+ here: