Monitoring Tools

Easy to Install Grafana on CentOS 8

In this tutorial, we shall show you how it is easy to install Grafana on CentOS 8. We shall install Grafana Enterprise  and Open Source CLI version 7.3.0.

Grafana is open source visualization and analytics software. It allows you to query, visualize, alert on, and explore your metrics no matter where they are stored. In plain English, it provides you with tools to turn your time-series database (TSDB) data into beautiful graphs and visualizations.

Prerequisites

By default, Grafana installs with and uses SQLite, which is an embedded database stored in the Grafana installation location.

Let’s get started with the installation process.

Install Grafana on CentOS 8

Step 1 – Keep the server up to date

# dnf update -y

Step 2 – Create repository file

# vi /etc/yum.repos.d/grafana.repo

Add following lines:

For Enterprise releases:

[grafana] name=grafana
baseurl=https://packages.grafana.com/enterprise/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

For OSS releases:

[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

Step 3 – Install Grafana

# dnf install grafana-enterprise -y

# or

# dnf install grafana -y

To start and enable the service and verify that the service has started: grafana-server.service.

# systemctl start grafana-server.service
# systemctl status grafana-server.service
# systemctl enable grafana-server.service

Add port 3000 in the firewall.

If you are using firewalld:

# firewall-cmd –add-port=3000/tcp –permanent

# firewall-cmd –reload

If you are using IPTables:

# iptables -A INPUT -p tcp –dport 3000 -j ACCEPT

# iptables-save

Package details

  • Default file (environment vars) to /etc/sysconfig/grafana-server
  • Configuration file to /etc/grafana/grafana.ini
  • systemd service (if systemd is available) name grafana-server.service
  • The default configuration uses a log file at /var/log/grafana/grafana.log
  • The default configuration specifies an sqlite3 database at /var/lib/grafana/grafana.db

Easy to Install Grafana on CentOS 8

The installation is completed successfully.

In this tutorial, you have learnt how to install Grafana on CentOS 8.

Related Articles