InfluxDB Installation
From r00tedvw.com wiki
(Difference between revisions)
Line 19: | Line 19: | ||
_internal | _internal | ||
influxdb</nowiki> | influxdb</nowiki> | ||
− | ===Testing DB=== | + | ====Testing DB==== |
− | <nowiki>~$ | + | <nowiki>~$ influx |
> USE influxdb | > USE influxdb | ||
> INSERT cpu,host=serverA value=0.64 | > INSERT cpu,host=serverA value=0.64 | ||
Line 36: | Line 36: | ||
Date: Thu, 30 Jun 2016 20:47:14 GMT</nowiki> | Date: Thu, 30 Jun 2016 20:47:14 GMT</nowiki> | ||
Verify the data is there | Verify the data is there | ||
− | <nowiki>~$ | + | <nowiki>~$ influx |
> USE influxdb | > USE influxdb | ||
Using database influxdb | Using database influxdb | ||
Line 44: | Line 44: | ||
time host region value | time host region value | ||
1434055562000000000 server01 us-west 0.64</nowiki> | 1434055562000000000 server01 us-west 0.64</nowiki> | ||
+ | ===Adding an Administrator Account=== | ||
+ | <nowiki>~$ influx | ||
+ | > CREATE USER root WITH PASSWORD 'TuTewlyQsjhMregggQbF' WITH ALL PRIVILEGES</nowiki> | ||
+ | ===Creating User account with access to Database=== | ||
+ | <nowiki>~$ influx | ||
+ | > CREATE USER influx WITH PASSWORD 'influxdb' | ||
+ | > GRANT ALL ON influxdb TO influx</nowiki> | ||
+ | ===Verify Users and Rights=== | ||
+ | <nowiki>~$ influx | ||
+ | > SHOW USERS | ||
+ | user admin | ||
+ | root true | ||
+ | influx false | ||
+ | > SHOW GRANTS FOR influx | ||
+ | database privilege | ||
+ | influxdb ALL PRIVILEGES</nowiki> | ||
+ | ===Add Authentication for HTTP requests=== |
Revision as of 16:57, 30 June 2016
Contents |
Ubuntu 14.04 Installation
Add Repo
~$ curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add - ~$ source /etc/lsb-release ~$ echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
Install InfluxDB
~$ sudo apt-get update && sudo apt-get install influxdb -y ~$ sudo service influxdb start
Database config
Login and create a DB
~$ influx Connected to http://localhost:8086 version 0.13.0 InfluxDB shell version: 0.13.0 > CREATE DATABASE influxdb > SHOW DATABASES name: databases --------------- name _internal influxdb
Testing DB
~$ influx > USE influxdb > INSERT cpu,host=serverA value=0.64 > SELECT * from cpu name: cpu --------- time host value 1467318896821675352 serverA 0.64
Setting up an external write into the database. Open a new shell on the same host.
~$ curl -i -XPOST 'http://localhost:8086/write?db=influxdb' --data-binary 'cpu_load_short,host=server01,region=us-west value=0.64 1434055562000000000' HTTP/1.1 204 No Content Request-Id: d333c2a3-3f03-11e6-800b-000000000000 X-Influxdb-Version: 0.13.0 Date: Thu, 30 Jun 2016 20:47:14 GMT
Verify the data is there
~$ influx > USE influxdb Using database influxdb > SELECT * from cpu_load_short name: cpu_load_short -------------------- time host region value 1434055562000000000 server01 us-west 0.64
Adding an Administrator Account
~$ influx > CREATE USER root WITH PASSWORD 'TuTewlyQsjhMregggQbF' WITH ALL PRIVILEGES
Creating User account with access to Database
~$ influx > CREATE USER influx WITH PASSWORD 'influxdb' > GRANT ALL ON influxdb TO influx
Verify Users and Rights
~$ influx > SHOW USERS user admin root true influx false > SHOW GRANTS FOR influx database privilege influxdb ALL PRIVILEGES