Installation & configuration d'InfluxDB
Installation
Via le dépôt de l'éditeur
Solution qui permet d'être tout le temps à jour.
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/os-release
echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
Installation
apt update && apt install influxdb
Lancer le service
service influxdb start
Via un packet
wget https://dl.influxdata.com/influxdb/releases/influxdb_1.8.0_amd64.deb
dpkg -i influxdb_1.8.0_amd64.deb
Le service n'est pas lancé, on le lance.
systemctl start influxdb.service
root@grafana:~# systemctl status influxdb.service
● influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2020-06-14 15:23:26 CEST; 4s ago
Docs: https://docs.influxdata.com/influxdb/
Main PID: 961 (influxd)
Tasks: 10 (limit: 2330)
Memory: 12.2M
CGroup: /system.slice/influxdb.service
└─961 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
juin 14 15:23:27 grafana influxd[961]: ts=2020-06-14T13:23:27.127794Z lvl=info msg="Starting precreation service" log_id
juin 14 15:23:27 grafana influxd[961]: ts=2020-06-14T13:23:27.127799Z lvl=info msg="Starting snapshot service" log_id=0N
juin 14 15:23:27 grafana influxd[961]: ts=2020-06-14T13:23:27.127803Z lvl=info msg="Starting continuous query service" l
juin 14 15:23:27 grafana influxd[961]: ts=2020-06-14T13:23:27.127808Z lvl=info msg="Starting HTTP service" log_id=0NOkph
juin 14 15:23:27 grafana influxd[961]: ts=2020-06-14T13:23:27.127811Z lvl=info msg="opened HTTP access log" log_id=0NOkp
juin 14 15:23:27 grafana influxd[961]: ts=2020-06-14T13:23:27.128230Z lvl=info msg="Listening on HTTP" log_id=0NOkpheG00
juin 14 15:23:27 grafana influxd[961]: ts=2020-06-14T13:23:27.128352Z lvl=info msg="Starting retention policy enforcemen
juin 14 15:23:27 grafana influxd[961]: ts=2020-06-14T13:23:27.128759Z lvl=info msg="Storing statistics" log_id=0NOkpheG0
juin 14 15:23:27 grafana influxd[961]: ts=2020-06-14T13:23:27.128852Z lvl=info msg="Sending usage statistics to usage.in
juin 14 15:23:27 grafana influxd[961]: ts=2020-06-14T13:23:27.129630Z lvl=info msg="Listening for signals" log_id=0NOkph
Configuration
Création d'une base pour Telegraf
influx -execute "CREATE DATABASE influx_db_telegraf"
Création d'un utilisateur
influx -execute "CREATE USER telegraf_user WITH PASSWORD 'telegraf_password'"
influx -execute "GRANT ALL ON influx_db_telegraf TO telegraf_user"
Configuration de la rétention
influx -execute "CREATE RETENTION POLICY "a_year" ON "influx_db_telegraf" DURATION 52w REPLICATION 1 DEFAULT"