How to install and Configure Grafana CMS on CentOS 8.1

To Install and Configure Grafana on CentOS 8.1

Introduction:

Grafana is open-source visualization and analytic software. In that we can question, visualize, alert on, and examine our metric with Grafana quickly that also helps us to create graphs and visualizers out of your time-series database (TSDB). In this tutorial we explain about installing Grafana on CentOS 8.1

Installation Procedure: First check the se-linux status by the following command

[root@linuxhelp ~]# sestatus
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          disabled
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Memory protection checking:     actual (secure)
Max kernel policy version:      31

Create a repo file for grafana

[root@linuxhelp ~]# vim /etc/yum.repos.d/grafana.repo
Now install grafana 
 [root@linuxhelp ~]# yum install grafana -y
CentOS-8 - AppStream                                             6.0 kB/s | 4.3 kB     00:00    
CentOS-8 - Base                                                  6.1 kB/s | 3.9 kB     00:00    
CentOS-8 - Extras                                                1.4 kB/s | 1.5 kB     00:01    
CentOS-8 - Extras                                                 12 kB/s | 8.6 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           5.6 kB/s | 8.3 kB     00:01    
Extra Packages for Enterprise Linux Modular 8 - x86_64            15 kB/s |  98 kB     00:06    
Extra Packages for Enterprise Linux 8 - x86_64                   7.9 kB/s | 7.3 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   645 kB/s | 8.4 MB     00:13    
grafana                                                          264  B/s | 488  B     00:01    
grafana                                                          2.1 kB/s | 1.7 kB     00:00    
Importing GPG key 0x24098CB6:
Install  1 Package
Total download size: 51 M
Installed size: 170 M
Downloading Packages:
grafana-7.3.4-1.x86_64.rpm                                       1.0 MB/s |  51 MB     00:51    
-------------------------------------------------------------------------------------------------
Total                                                            1.0 MB/s |  51 MB     00:51     
From       : https://packages.grafana.com/gpg.key
Key imported successfully
Running transaction check
Transaction check succeeded.
  Preparing        :                                                                         1/1 
  Installing       : grafana-7.3.4-1.x86_64                                                  1/1 
  Running scriptlet: grafana-7.3.4-1.x86_64                                                  1/1 
sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server.service
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server.service
POSTTRANS: Running script
Verifying        : grafana-7.3.4-1.x86_64                                                  1/1 
Installed:
  grafana-7.3.4-1.x86_64                                                                         
Complete!

Now install font type for grafana

[root@linuxhelp ~]# yum install fontconfig freetype* urw-fonts -y
Last metadata expiration check: 0:01:53 ago on Friday 04 December 2020 01:22:53 PM IST.
Package fontconfig-2.13.1-3.el8.x86_64 is already installed.
Package freetype-2.9.1-4.el8.x86_64 is already installed.
Installing dependencies:
 bzip2-devel               x86_64            1.0.6-26.el8                BaseOS            224 k
 libpng-devel              x86_64            2:1.6.34-5.el8              BaseOS            327 k
 zlib-devel                x86_64            1.2.11-16.el8_2             BaseOS             57 k
Upgrade  1 Package
Total download size: 1.1 M
Downloading Packages:
[MIRROR] freetype-devel-2.9.1-4.el8.x86_64.rpm: Curl error (7): Couldn't connect to server for http://centos.hbcse.tifr.res.in/centos/8.2.2004/BaseOS/x86_64/os/Packages/freetype-devel-2.9.1-
[MIRROR] libpng-devel-1.6.34-5.el8.x86_64.rpm: Curl error (7): Couldn't connect to server for http://centos.hbcse.tifr.res.in/centos/8.2.2004/BaseOS/x86_64/os/Packages/libpng-devel-1.6.34-5.el8.x86_64.rpm [Failed to connect to centos.hbcse.tifr.res.in port 80: Connection refused]
(1/5): bzip2-devel-1.0.6-26.el8.x86_64.rpm                       140 kB/s | 224 kB     00:01    
(2/5): freetype-devel-2.9.1-4.el8.x86_64.rpm                     248 kB/s | 464 kB     00:01    
 (5/5): zlib-1.2.11-16.el8_2.x86_64.rpm                           107 kB/s | 102 kB     00:00    
-------------------------------------------------------------------------------------------------
Total                                                            348 kB/s | 1.1 MB     00:03     
  Preparing        :                                                                         1/1 
  Upgrading        : zlib-1.2.11-16.el8_2.x86_64                                             1/6 
  Installing       : zlib-devel-1.2.11-16.el8_2.x86_64                                       2/6 
  Verifying        : zlib-devel-1.2.11-16.el8_2.x86_64                                       4/6 
  Verifying        : zlib-1.2.11-16.el8_2.x86_64                                             5/6 
  Verifying        : zlib-1.2.11-10.el8.x86_64                                               6/6 
Upgraded:
  zlib-1.2.11-16.el8_2.x86_64                                                                    
Installed:
  bzip2-devel-1.0.6-26.el8.x86_64                 freetype-devel-2.9.1-4.el8.x86_64             
  libpng-devel-2:1.6.34-5.el8.x86_64              zlib-devel-1.2.11-16.el8_2.x86_64             
Complete!

Now reload rhe service using the following command

[root@linuxhelp ~]# systemctl daemon-reload
Start the grafana service 

Start the service using following command

 [root@linuxhelp ~]# systemctl start grafana-server.service
Check the status for grafana
[root@linuxhelp ~]# systemctl status grafana-server.service
● grafana-server.service - Grafana instance
   Loaded: loaded (/usr/lib/systemd/system/grafana-server.service; disabled; vendor preset: disa>
   Active: active (running) since Fri 2020-12-04 13:26:00 IST; 24s ago
     Docs: http://docs.grafana.org
 Main PID: 20573 (grafana-server)
    Tasks: 8 (limit: 11340)
   Memory: 69.6M
   CGroup: /system.slice/grafana-server.service
           └─20573 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/var/run>

Dec 04 13:26:00 linuxhelp grafana-server[20573]: t=2020-12-04T13:26:00+0530 lvl=info msg="Execut>
msg="Regist>
Dec 04 13:26:00 linuxhelp grafana-server[20573]: t=2020-12-04T13:26:00+0530 lvl=info msg="Extern>
Dec 04 13:26:00 linuxhelp systemd[1]: Started Grafana instance.
Dec 04 13:26:00 linuxhelp grafana-server[20573]: t=2020-12-04T13:26:00+0530 lvl=info msg="HTTP S>

Now move to browser and type domain address along with default port no. 3000. Now login with default login credentials Now create new credentials and login in on dashboard From here you can add new password This is the dashboard for the Grafana CMS

Tag : Grafana CentOS
FAQ
Q
What Theme does grafana uses?
A
Grafana is an open-source data visualization and tracking suite. It supports databases such as Graphite, Elasticsearch, Included, Prometheus, etc.
Q
How do I exit graph edit mode on grafana?
A
Hit the escape key or click the graph title and select edit again.
Q
How do I delete a dashboard?
A
Click that dashboard page's jag, then the bottom will have an item "delete dashboard"
Q
What are the platforms it can support?
A
It can support Windows, Mac, and almost every Linux distribution.
Q
What is Grafana on CentOS?
A
Grafana is an open-source data visualization and tracking suite. It supports databases such as Graphite, Elasticsearch, Included, Prometheus, etc. The application has metric analytics, with the capability to control and create your own dashboard for your own apps or infrastructure performance monitoring.