Difference between revisions of "InfluxDB"
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | Originally written by Grant Reed | ||
+ | |||
+ | (you will need '''curl''' & '''gnupg''') | ||
+ | |||
==Installing InfluxDB on Mint 19.3 and 20== | ==Installing InfluxDB on Mint 19.3 and 20== | ||
===Start by adding it to the repository=== | ===Start by adding it to the repository=== | ||
− | * <code>echo "deb <nowiki>https://repos.influxdata.com/debian</nowiki> stretch stable" | sudo tee /etc/apt/sources.list.d/influxdb.list</code> | + | |
+ | *<code>echo "deb <nowiki>https://repos.influxdata.com/debian</nowiki> stretch stable" | sudo tee /etc/apt/sources.list.d/influxdb.list</code> | ||
===Install GPG Key=== | ===Install GPG Key=== | ||
− | * <code>sudo curl -sL <nowiki>https://repos.influxdata.com/influxdb.key</nowiki> | sudo apt-key add -</code> | + | |
+ | *<code>sudo curl -sL <nowiki>https://repos.influxdata.com/influxdb.key</nowiki> | sudo apt-key add -</code> | ||
===Update the index and INSTALL=== | ===Update the index and INSTALL=== | ||
− | * <code>sudo apt-get update</code> | + | |
− | * <code>sudo apt-get install -y influxdb</code> | + | *<code>sudo apt-get update</code> |
+ | *<code>sudo apt-get install -y influxdb</code> | ||
===Start, Enable and Verify it is running=== | ===Start, Enable and Verify it is running=== | ||
− | * <code>sudo systemctl start influxdb</code> | + | |
− | * <code>sudo systemctl enable influxdb</code> | + | *<code>sudo systemctl start influxdb</code> |
− | * <code>systemctl status influxdb</code> | + | *<code>sudo systemctl enable influxdb</code> |
+ | *<code>systemctl status influxdb</code> | ||
+ | |||
+ | ==Installing InfluxDB on Debian== | ||
+ | |||
+ | *<code>sudo apt install influxdb</code> | ||
+ | *<code>sudo apt install influxdb-client</code> | ||
==Setting up a Database== | ==Setting up a Database== | ||
Line 20: | Line 33: | ||
You need to access InfluxDB so open a terminal on the machine it is hosted on (or SSH into it if that is your thing)... type in the terminal | You need to access InfluxDB so open a terminal on the machine it is hosted on (or SSH into it if that is your thing)... type in the terminal | ||
− | * <code>influx</code> | + | |
+ | *<code>influx</code> | ||
+ | |||
You should see a message like this: | You should see a message like this: | ||
Line 29: | Line 44: | ||
A fresh install of if InfluxDB has no useable databases outside of the default internal one. So type this at the prompt, replacing <db-name> with the name you want | A fresh install of if InfluxDB has no useable databases outside of the default internal one. So type this at the prompt, replacing <db-name> with the name you want | ||
− | * <code>CREATE DATABASE <db-name></code> | + | *<code>CREATE DATABASE <db-name></code> |
If all went properly, you won't see any additional info, just the prompt again. Now let's make sure that the database is good just for giggles | If all went properly, you won't see any additional info, just the prompt again. Now let's make sure that the database is good just for giggles | ||
− | * <code>SHOW DATABASES</code> | + | *<code>SHOW DATABASES</code> |
You should see your database listed. If not, something borked and I can't help you with that. | You should see your database listed. If not, something borked and I can't help you with that. | ||
Are you planning to use this with Grafana? You will need to set up a datasource in Grafana then. | Are you planning to use this with Grafana? You will need to set up a datasource in Grafana then. | ||
+ | |||
+ | ==Using this with Node Red== | ||
+ | A [[Node-RED - with InfluxDB|minimum example]] | ||
==Using this with Grafana== | ==Using this with Grafana== | ||
Set up your database in Grafana by going here... [[Grafana#Connecting with InfluxDB|Connecting with InfluxDB]] | Set up your database in Grafana by going here... [[Grafana#Connecting with InfluxDB|Connecting with InfluxDB]] | ||
+ | |||
+ | <br /> |
Latest revision as of 13:19, 9 April 2023
Originally written by Grant Reed
(you will need curl & gnupg)
Contents
Installing InfluxDB on Mint 19.3 and 20
Start by adding it to the repository
echo "deb https://repos.influxdata.com/debian stretch stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
Install GPG Key
sudo curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
Update the index and INSTALL
sudo apt-get update
sudo apt-get install -y influxdb
Start, Enable and Verify it is running
sudo systemctl start influxdb
sudo systemctl enable influxdb
systemctl status influxdb
Installing InfluxDB on Debian
sudo apt install influxdb
sudo apt install influxdb-client
Setting up a Database
This will set up an initial database to start with. This gets really deep, really fast if you are not familiar with databases or the coding behind the system. The guide for this can be found at https://docs.influxdata.com/influxdb/v1.8/introduction/get-started/ Good luck with that.
You need to access InfluxDB so open a terminal on the machine it is hosted on (or SSH into it if that is your thing)... type in the terminal
influx
You should see a message like this:
$ influx -precision rfc3339 Connected to http://localhost:8086 version 1.8.x InfluxDB shell 1.8.x >
A fresh install of if InfluxDB has no useable databases outside of the default internal one. So type this at the prompt, replacing <db-name> with the name you want
CREATE DATABASE <db-name>
If all went properly, you won't see any additional info, just the prompt again. Now let's make sure that the database is good just for giggles
SHOW DATABASES
You should see your database listed. If not, something borked and I can't help you with that.
Are you planning to use this with Grafana? You will need to set up a datasource in Grafana then.
Using this with Node Red
Using this with Grafana
Set up your database in Grafana by going here... Connecting with InfluxDB