Difference between revisions of "InfluxDB"

From The TinkerNet Wiki
Jump to navigation Jump to search
(Created page with "==Installing InfluxDB on Mint 19.3 and 20== ===Start by adding it to the repository=== <code>echo "deb <nowiki>https://repos.influxdata.com/debian</nowiki> stretch stable" |...")
 
Line 2: Line 2:
  
 
===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 update</code>
 
+
* <code>sudo apt-get install -y influxdb</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 start influxdb</code>
 
+
* <code>sudo systemctl enable influxdb</code>
<code>sudo systemctl enable influxdb</code>
+
* <code>systemctl status influxdb</code>
 
 
<code>systemctl status influxdb</code>
 
  
 
==Setting up a Database==
 
==Setting up a Database==
Line 23: Line 20:
  
 
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
influx
+
* <code>influx</code>
 
You should see a message like this:
 
You should see a message like this:
  
Line 32: Line 29:
 
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.  
Line 43: Line 40:
  
 
==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 />
 

Revision as of 14:04, 1 December 2020

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

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 Grafana

Set up your database in Grafana by going here... Connecting with InfluxDB