Skip to content

Setting up influxdb for VSCP use

Åke Hedman edited this page Sep 16, 2021 · 9 revisions

Setting up influxdb for VSCP use

This is a simple step by step guide on how to setup influxdb for use with a VSCP system. It concentrate on the >2 version only. There is plenty of information available about the earlier versions.

The instructions is for a Debian based (or derived) system. Links are provided to relevant parts that can used for other setups.

Step 1 - Install

Full install instructions are here.

influxdb needs curl so install it first. You do this with

sudo apt install curl

Now get the latest version of influxdb with

wget https://dl.influxdata.com/influxdb/releases/influxdb2-2.0.8-amd64.deb

Install with

sudo sudo dpkg -i influxdb2-2.0.8-amd64.deb

After the install is finished verify that the influxdb server is running with

sudo service influxdb status

You can read more about controlling (start/stop/restart) the systemd service here

Step 2 - Configure the server

When the server is running it exports a web interface at http://localhost:8086. Setup your admin server account in this interface the first thing you do. Note your token and your organisation.

Now issue

influx config create --active -n config-name -u http://localhost:8086 -t mySuP3rS3cr3tT0keN -o example-org

where mySuP3rS3cr3tT0keN is your token and example-org is your organisation.

Note that the web interface is open at this moment. We recommend that you get a letsencrypt certificate for your server and follow the steps described here to secure your server. This is entirely optional of course.

Step 3 - Set environment variable

export INFLUX_TOKEN=mySuP3rS3cr3tT0keN

where mySuP3rS3cr3tT0keN is your personal token from above. Doing this lets you omit the token when you issue commands.

Step 4 - Create a bucket

Create a bucket vscptest we can use for some testing. You will delete it later on in this guide.

Step 5 - Add some VSCP data

Full info about adding data to influx is here

Before we can do anything useful we need to add some VSCP data to the bucket we created above.

Step 6 - Query data

Full influx query info is here

to be continure ....

Clone this wiki locally