×


Grafana is an open-source and one of the most commonly used monitoring dashboards of 2019 that is used by PayPal, eBay, and Red Hat. Grafana is a good choice for all engineers who want to use a scalable and robust dashboard-monitoring tool. This monitoring tool monitors various data sources. Using Grafana, you can bind time-series databases like Prometheus or Influx DB and relational databases like PostgreSQL or MySQL.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related MySQL queries.

In this context, we shall look into how to Grafana monitoring dashboard on CentOS 8.


Steps to install  and configure Grafana on CentOS 8 Linux system

1. Perform System Update

To begin, ensure that the system is up-to-date by running the below commands:

$ sudo dnf update
$ sudo dnf install epel-release


2. Add Grafana Yum repository

To install Grafana using the yum package manager, add the Grafana repository to the local yum repository. For this purpose, open the terminal using the 'Activities' sections and click on the terminal icon from the left sidebar of the CentOS 8 desktop. 

Now, create a new file 'grafana.repo' in the Yum repository and execute the following commands with administrative privileges on the terminal application:

$ cat <<EOF | sudo tee /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
EOF


3. Update yum repository

You can Update the available system packages by using the below command:

$ sudo dnf makecache


4. Install Grafana using Yum

Once the grafana repository is added and configured on your system, install the grafana by executing the below command:

$ sudo dnf -y install grafana

The above command will import the GPG key and installs all required grafana packages on CentOS 8.

Once the installation of grafana is completed, use the below command to verify the installation and see the details of grafana package:

$ rpm -qi grafana


5. Check the status of the Grafana systemd service

The systemd manages the grafana service on your system. Therefore, enable it by running the below 'systemctl' command:

$ sudo systemctl enable --now grafana-server.service


6. Start Grafana systemd service

Now, grafana systemd service is enabled. Start service and then check 'running or Active' status of grafana service by running the below commands:

$ systemctl start grafana-server.service
$ systemctl status grafana-server.service


7. Enable firewall rules

By default, the grafana service runs on port 3000. So, if firewalld service is running on your system then, run the following command to allow access to port 3000 for grafana service:

$ sudo firewall-cmd --add-port=3000/tcp --permanent
$ sudo firewall-cmd –reload

To make sure everything is working correctly, use the below command:

$ sudo firewall-cmd --list-all | grep ports


8. Grafana Configurations Location

All grafana configurations related to port and path are stored in the '/etc/grafana/grafana.ini' configuration file.

You can modify 'http_port = 3000' according to your system requirements.

The grafana log is by default written in the '/var/log/grafana' directory.

The grafana SQLite database can be found under '/var/lib/grafana/grafana.db'.


How to Launch Grafana on CentOS 8 through Web UI ?

Launch the Grafana web user interface on CentOS 8. Open the browser and type the following URL in the address bar:

http://localhost:3000

Or

http://server-ip:3000

The Grafana web UI will be displayed on your Web browser.

Enter the username=admin and password= admin to access the Grafana dashboard. After that, the Grafana dashboard will be displayed in the browser.


How to Uninstall Grafana monitoring tool from CentOS 8 ?

After using Grafana on your system, you can uninstall this monitoring tool dashboard from CentOS 8 by using the below command:

$ sudo yum –y remove grafana


[Need help in fixing Apache configuration issues ? We can help you. ]


Conclusion

This article covers how to install and configure the Grafana monitoring tool on CentOS 8 system via the command line. In fact, Grafana is a popular open-source visualization and analytics monitoring software which renders graphs, charts, and alerts when connected to supported data sources. Now, you can use the grafana monitoring dashboard on CentOS 8 system.


More Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on IbmiMedia.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com