1080*80 ad

Installing Grafana on Rocky Linux 8

Mastering Monitoring: Installing Grafana on Rocky Linux 8

Monitoring your systems is crucial for maintaining stability, performance, and security. Whether you’re running web servers, databases, or custom applications, having clear visibility into their health and resource usage is paramount. Grafana stands out as a leading open-source platform for data visualization and analytics, allowing you to create stunning dashboards from various data sources.

This guide will walk you through the steps to install Grafana on Rocky Linux 8, empowering you to set up a powerful monitoring solution for your environment. Rocky Linux, as a stable and robust enterprise-grade distribution, provides an excellent foundation for such critical tools.

Why Grafana?

Grafana excels at taking complex metrics and transforming them into intuitive, easy-to-understand graphs and visualizations. It supports a wide array of data sources, from Prometheus and InfluxDB to databases like PostgreSQL and MySQL, cloud services, and more. Its flexibility and rich feature set make it a favorite among system administrators and developers alike.

Prerequisites

Before you begin the installation, ensure you have:

  • A server running Rocky Linux 8.
  • sudo privileges or access to the root user.
  • An active internet connection to download packages.
  • It’s always a good practice to update your system before installing new software:
    bash
    sudo dnf update -y

Step-by-Step Grafana Installation

Follow these steps to get Grafana up and running on your Rocky Linux 8 server.

1. Add the Grafana Repository

Grafana is not included in the default Rocky Linux repositories. You’ll need to add the official Grafana repository to your system’s package manager configuration. This ensures you can install the latest stable version using dnf.

Create a new repository file for Grafana:

sudo nano /etc/yum.repos.d/grafana.repo

Add the following content to the file. This configures the repository for the Grafana stable version.

[grafana]
name=grafana
baseurl=https://rpm.grafana.com/oss/rpm/
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt

Save the file and exit the editor (Ctrl+X, Y, Enter for nano).

2. Install Grafana

Now that the repository is added, you can install the Grafana package using dnf.

sudo dnf install grafana -y

The package manager will download Grafana and its dependencies and install them on your system.

3. Start and Enable the Graf Grafana Service

After installation, the Grafana service is installed but not yet running or configured to start automatically on boot. You need to enable and start the service.

First, reload the systemd daemon to recognize the new service:

sudo systemctl daemon-reload

Next, start the Grafana server:

sudo systemctl start grafana-server

Then, enable the Grafana service to start automatically every time your server boots:

sudo systemctl enable grafana-server

You can check the status of the Grafana service to ensure it’s running correctly:

sudo systemctl status grafana-server

Look for “active (running)” in the output.

4. Configure the Firewall

By default, Grafana runs on port 3000. If you have a firewall enabled (which is recommended for security), you’ll need to open this port to access the web interface from another machine. Rocky Linux typically uses firewalld.

To open port 3000 using firewalld:

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

These commands permanently add a rule to allow TCP traffic on port 3000 and then reload the firewall configuration to apply the changes.

5. Access the Grafana Web UI

With the service running and the firewall configured, you can now access the Grafana web interface. Open your web browser and navigate to:

http://your_server_ip_or_domain:3000

Replace your_server_ip_or_domain with the actual IP address or domain name of your Rocky Linux 8 server.

You should see the Grafana login page. The default login credentials are:

  • Username: admin
  • Password: admin

Security Tip: You will be prompted to change the default password immediately after your first login. It is highly recommended to change this to a strong, unique password for security purposes.

Next Steps

Once logged in, you can begin configuring Grafana:

  • Add Data Sources: Connect Grafana to your monitoring backends (like Prometheus, InfluxDB, or your preferred database).
  • Create Dashboards: Build custom dashboards using panels that visualize the data from your sources.
  • Install Plugins: Extend Grafana’s functionality with plugins for new data sources, panels, and apps.

Conclusion

Installing Grafana on Rocky Linux 8 is a straightforward process that unlocks powerful monitoring and visualization capabilities. By following these steps, you’ve laid the groundwork for creating comprehensive dashboards that provide invaluable insights into the performance and health of your systems. Start exploring Grafana’s features and take control of your monitoring landscape today!

Source: https://kifarunix.com/install-grafana-on-rocky-linux-8/

900*80 ad

      1080*80 ad