Installing InfluxDB Ver 2 on RPi4

So my image running InfuxDB became corrupted and I was unable to recover so I decided to take the jump to InfluxDB 2.x.

The days of the TICK stack are gone and all contained now in a single Influx install.

Start with a fresh install of 64-Bit Ubuntu Server. (tutorial here)

Note: With Influx version 2.x there is a new protocol for writing data and essentially an upgrade to 2.x will mean all devices writing to Influx will need their code updated also. . . . . fun. Also Grafana should be updated to version 7.x+ if you also run this side by side, even more fun.

sudo apt-get update
sudo apt-get upgrade -y

wget -qO- https://repos.influxdata.com/influxdb.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdb.gpg > /dev/null

export DISTRIB_ID=$(lsb_release -si); export DISTRIB_CODENAME=$(lsb_release -sc)

echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list > /dev/null

sudo apt-get update && sudo apt-get install influxdb2

sudo apt-get install fail2ban -y; sudo apt-get install ntp -y; sudo apt-get install ntpstat -y

#Did not use hashed out commands yet, was required on raspbian but not sure about ubuntu
#systemctl stop systemd-timesyncd
#systemctl disable systemd-timesyncd
#/etc/init.d/ntp stop
#/etc/init.d/ntp start

sudo reboot

Confirm everything is working:

sudo service influxdb status
ntpstat

You can also head to the InfluxDB configuration page on: http://192.168.1.xxx:8086

Further work if upgrading from InfluxDB 1.x to 2.x

  • Update devices running Shell scrips / .sh code
  • Update devices running Python .py code
  • Update Arduino/ESP devices running .ino code

That’s it!

Resources I used:

  • https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview
  • https://docs.influxdata.com/influxdb/v2.1/install/?t=Linux

Leave a Reply

Your email address will not be published. Required fields are marked *