Database is a core in any Big enterprise Company You always need to make backup server for high availability of database. If we make database on same server where an application is installed and running it can be very dangerous for both database and application as if server failed, You do not have any way to recover it until you have some backup of that server

Check Out Step By Step Installation of Grafana On Redhat/CentOs 6/7 Version

The purpose of connecting Grafana application it to centralized database as it can improve performance of server and data always be available for users.

Our Senario Requirement

  1. Centralized database server Ip 1.11.10
  2. Grafana Testing Application Ip 1.11.11
  3. Grafana Production Application  Ip 1.11.12

Configuration Database :

Login to your database server  mysql –u root -p

Create a USER and grant Permission on database

  1. Create user

CREATE USER ‘username’@’10.1.11.10’ IDENTIFIED BY ‘password’;

  1. Grants Permission to access the database

GRANT ALL PRIVILEGES ON database_name.* TO ‘username’@’10.1.11.11’ IDENTIFIED BY ‘password’;

And

GRANT ALL PRIVILEGES ON database_name.* TO ‘username’@’10.1.11.12’ IDENTIFIED BY ‘password’;

In Case you have two Grafana Server

  1. FLUSH PRIVILEGES;

Configure grafana to use these database

Go to the grafana file location  /etc/grafana/grafana.ini

Edit the section of [database]

Put these same settings on both server

Type = mysql

host = 10.1.11.10:3306

Name = database_name

User = username

Password = password

Save the file

  1. Restart the service

 Systemctl restart grafana-server

Now last step  is to check database stored on centralized Server

 Login to your database server   mysql –u root –p

Run following command

Use database_name;

Show tables;

It will show you what are stored in database .

You’re done.

Sponsored

LEAVE A REPLY

Please enter your comment!
Please enter your name here