Installing InfluxDB on a Raspberry Pi

Today I am writing a quick describing how you can install InfluxDB on a Raspberry Pi

What is InfluxDB?

InfluxDB is a relatively popular time series database that allows storing metrics and data. It is specifically designed to store and operate on data that is bound by a time component.

One of the areas it excels is high volume data entry and retrieval of that data. This makes it well suited to be used by the Raspberry Pi Cluster for storing metric data about the cluster.

By default it is not included in the Raspberry Pi’s repositories to you need to perform a few steps to install it.

Installing InfluxDB on the Raspberry Pi

First you will want to run all the updates on the Raspberry Pi. This can be done by running the following commands.

sudo apt update
sudo apt upgrade

Once done you may want to reboot to ensure all files are cleanly loaded.

Adding the InfluxDb repository

When all updates are done you will want to install the Debian repository and public key.

First run the following command to install the public key. This will ensure that the packages downloaded are properly signed and have not been corrupted or interfered with.

wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -

Once done you will then be able to add the repository file to the Raspberry Pi. The following command will work if you are running Raspberry Pi OS 10 codenamed “buster”.

However if you are on an older version you will need to replace buster with the appropriate version name, one of: wheezy, jessie, or stretch.

echo "deb https://repos.influxdata.com/debian buster stable" | sudo tee /etc/apt/sources.list.d/influxdb.list

Installing InfluxDB

Once the repository is added you can run the following commands to update and install InfluxDB.

sudo apt update
sudo apt install influxdb

At this point InfluxDB is ready to be used.

Starting InfluxDB and enabling it to run on start up

To allow InfluxDB to run on start up you should run the following commands.

sudo systemctl unmask influxdb
sudo systemctl enable influxdb

Once these are ran InfluxDB will start on next boot. However if you want to run InfluxDB now you will want to run one final command.

sudo systemctl start influxdb

Once ran the InfluxDB service will be running and you will be able to start using it.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.