Install an InfluxDB Grafana stack on a Raspberrypi

From lechacal
Jump to: navigation, search

Guide was edited and tested using Raspbian image: 2018-11-13-raspbian-stretch-lite.img

Install Influxdb

Access a terminal on the Raspberrypi and enter the commands below to install InfluxDB.

curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
sudo apt install apt-transport-https
echo "deb https://repos.influxdata.com/debian stretch stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update
sudo apt-get install influxdb

Setup Influxdb Config

Edit the config file.

sudo nano /etc/influxdb/influxdb.conf

Change the options as shown below.

[http]
  # Determines whether HTTP endpoint is enabled.
  enabled = true

  # The bind address used by the HTTP service.
  bind-address = ":8086"

  # Determines whether user authentication is enabled over HTTP/HTTPS.
  auth-enabled = false

Restart InfluxDB service.

sudo service influxdb restart

Install Grafana

curl https://bintray.com/user/downloadSubjectPublicKey?username=bintray | sudo apt-key add -
echo "deb https://dl.bintray.com/fg2it/deb jessie main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana
sudo service grafana-server start
# sudo update-rc.d grafana-server defaults
sudo systemctl enable grafana-server

Setup Grafana

Using a computer on the same network of the Raspberrypi. Open a web browser and go to address

http://raspberrypi:3000

Grafana will show up. Login using user admin password admin.

Go to Configuration | Data Sources

Then click Add data sources.

Enter:
Name: raspberrypi
Type: InfluxDB
URL: http://localhost:8086
Database: mydb

Keep everything else by default. Name must be the raspberrypi hostname. Database can be anything you like.