Grafana is a widespread platform for data visualization and monitoring, supporting various data sources such as databases, cloud services, and custom APIs. This enables users to create interactive dashboards and graphs for visualizing their data.
In short, Grafana facilitates the extraction of data from multiple sources and the sharing of insights through graphical dashboards.
In this post, you will explore the following sections in detail;
- Install and Configure Grafana on CentOS 8.
- Remove Grafana from CentOS 8.
How to Install and Configure Grafana on CentOS 8?
Grafana can be installed through the following steps.
Step 1: Update the CentOS Repository
Run the command from the CLI to update your CentOS 8 system repository:
sudo dnf update -y |
---|
Ensure that all installed packages on your CentOS system are up to date.
Step 2: Download Grafana GPG Key
To install Grafana from the RPM repository, you will need to run the following command to download the GPG key for Grafana:
wget -q -O gpg.key https://rpm.grafana.com/gpg.key |
---|
If nothing is returned in your output, indicating that the GPG key for the package has been downloaded successfully.
Step 3: Import Grafana GPG Key
After downloading the GPG key, use the “rpm” with the “–import” option followed by the “gpg.key” to import the key:
sudo rpm --import gpg.key |
---|
This command enables your CentOS system to authenticate the Grafana packages you will install from the repository.
Step 4: Configure Grafana Repository
Now, let’s create a configuration file for Grafana using the following command:
sudo nano /etc/yum.repos.d/grafana.repo |
---|
In the “grafana.repo” file, copy the provided below content and save it:
[grafana] name=grafana baseurl=https://rpm.grafana.com repo_gpgcheck=1 enabled=1 gpgcheck=1 gpgkey=https://rpm.grafana.com/gpg.key sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt exclude=*beta* |
---|
You can prevent beta versions from being installed by adding the “exclude=*beta*” line at the end of your configuration file.
Step 5: Install Grafana
Once the Grafana configuration file is created, now utilize the “dnf” to install the Grafana package on your CentOS 8:
sudo dnf install grafana |
---|
When this command executes, you will notice that it will install the Grafana package along with dependencies on your CentOS 8.
Step 6: Enable Grafana Service using “systemctl”
You can use the “systemctl” in the following manner to enable the Grafana service on your system:
sudo systemctl enable grafana-server |
---|
The Grafana server is now enabled, as shown in the screenshot above.
Step 7: Start Grafana Service
Utilized the provided command to initiate the Grafana server:
sudo systemctl start grafana-server |
---|
Step 8: Check the Grafana Status
To confirm that the Grafana is active and running correctly, operate the command in your CentOS 8 terminal:
sudo systemctl status grafana-server |
---|
As shown in the screenshot above, the Grafana services are now actively running on your CentOS 8 system.
This message indicates that you have successfully downloaded, installed, and configured the Grafana on your CentOS 8.
How to Remove Grafana from CentOS 8?
To uninstall the Grafana from your CentOS 8, just follow these instructions.
Step 1: Stop Grafana Service
Before removing the Grafana package from your CentOS 8, run the command to stop the Grafana services:
sudo systemctl stop grafana-server |
---|
After stopping the Grafana services, proceed with the next step to remove it from your system.
Step 2: Uninstall Grafana
Next, utilize the “dnf” package manager to uninstall the Grafana package from your CentOS 8 system:
sudo dnf remove grafana |
---|
When you run this command in the CentOS 8 terminal, it will uninstall the Grafana package from your system, including associated files and dependencies.
Conclusion
On the CentOS 8 system, you can install Grafana using the RPM repository. To install it securely, you need to import the GPG key for the Grafana and then use the command “sudo dnf install grafana” to install the completed package on your CentOS 8 system.
In this learning-based post, you learned how to install Grafana on the CentOS 8 system from the RPM repository.
Leave feedback about this