Installation sous Debian 10 Buster
MariaDB
Dépôt officiel MaraDB
apt install software-properties-common dirmngr
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
add-apt-repository 'deb [arch=amd64] http://ftp.igh.cnrs.fr/pub/mariadb/repo/10.4/debian buster main'
Installation de MariaDB
apt update
apt install -y mariadb-client mariadb-server
Configurer et sécuriser MariaDB :
mariadb-secure-installation
Création de la base et de l'utilisateur pour Grafana
mysql -u root
CREATE DATABASE grafana CHARACTER SET UTF8 COLLATE UTF8_BIN;
CREATE USER 'grafana'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON grafana.* TO 'grafana'@'%';
quit;
Grafana
Dépôt officiel Grafana
apt-key adv --fetch-keys 'https://packages.grafana.com/gpg.key'
add-apt-repository 'deb [arch=amd64,i386] https://packages.grafana.com/oss/deb stable main'
apt-get update
Installation de Grafana
apt install -y grafana
Configuration de Grafana pour communiquer avec MariaDB
vi /etc/grafana/grafana.ini
[database]
type = mysql
host = 127.0.0.1:3306
name = grafana
user = grafana
password = password
[session]
provider = mysql
provider_config = `grafana:password@tcp(127.0.0.1:3306)/grafana`
Service
systemctl enable --now grafana-server
systemctl start grafana-server
Etat du service
root@grafana:/downloads/grafana# systemctl status grafana-server
● grafana-server.service - Grafana instance
Loaded: loaded (/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-06-13 15:20:37 CEST; 15s ago
Docs: http://docs.grafana.org
Main PID: 12133 (grafana-server)
Tasks: 8 (limit: 2330)
Memory: 22.3M
CGroup: /system.slice/grafana-server.service
└─12133 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run/grafana/grafana-server.
juin 13 15:20:38 grafana grafana-server[12133]: t=2020-06-13T15:20:38+0200 lvl=info msg="Executing migration" logger=mig
juin 13 15:20:38 grafana grafana-server[12133]: t=2020-06-13T15:20:38+0200 lvl=info msg="Executing migration" logger=mig
juin 13 15:20:38 grafana grafana-server[12133]: t=2020-06-13T15:20:38+0200 lvl=info msg="Executing migration" logger=mig
juin 13 15:20:38 grafana grafana-server[12133]: t=2020-06-13T15:20:38+0200 lvl=info msg="Executing migration" logger=mig
juin 13 15:20:38 grafana grafana-server[12133]: t=2020-06-13T15:20:38+0200 lvl=info msg="Executing migration" logger=mig
juin 13 15:20:38 grafana grafana-server[12133]: t=2020-06-13T15:20:38+0200 lvl=info msg="Created default admin" logger=s
juin 13 15:20:38 grafana grafana-server[12133]: t=2020-06-13T15:20:38+0200 lvl=info msg="Starting plugin search" logger=
juin 13 15:20:39 grafana grafana-server[12133]: t=2020-06-13T15:20:39+0200 lvl=info msg="Registering plugin" logger=plug
juin 13 15:20:39 grafana grafana-server[12133]: t=2020-06-13T15:20:39+0200 lvl=info msg="External plugins directory crea
juin 13 15:20:39 grafana grafana-server[12133]: t=2020-06-13T15:20:39+0200 lvl=info msg="HTTP Server Listen" logger=http
Connexion à Grafana
http://xx.xx.xx.xx:3000