Easily Install Netdata on Rocky Linux 9 – OrcaCore

Posted on

Easily Install Netdata on Rocky Linux 9 - OrcaCore

Easily Install Netdata on Rocky Linux 9 – OrcaCore

In this tutorial, we will guide you on How To Install Netdata on Rocky Linux 9. Netdata is a distributed, real-time, performance and health monitoring tool for systems and applications. It functions as a highly optimized monitoring agent that you install on all your systems and containers.

Netdata offers unparalleled insights, in real-time, into everything happening on the systems it monitors (including web servers, databases, and applications), presenting this information through highly interactive web dashboards. It can operate autonomously, without relying on any third-party components, or it can be seamlessly integrated into existing monitoring toolchains.

Netdata is designed for speed and efficiency, allowing it to run continuously on all systems (physical & virtual servers, containers, IoT devices) without disrupting their core functionality.

Netdata is free, open-source software, and it currently supports Linux, FreeBSD, and macOS.

Now, let’s follow the steps below, as provided by Orcacore, to Install Netdata on Rocky Linux 9.

Steps To Install and Configure Netdata on Rocky Linux 9

Before we begin, ensure you are logged into your server as a non-root user with sudo privileges and have set up a basic firewall. You can refer to our guide on Initial Server Setup with Rocky Linux 9 for assistance with this.

Install Netdata on Rocky Linux 9

First, update your local package index using the following command:

sudo dnf update -y

Install Epel Repository

Next, install the EPEL (Extra Packages for Enterprise Linux) repository on Rocky Linux 9 using the command below:

sudo dnf install epel-release -y

Install Required Packages and Dependencies

The Netdata installation on Rocky Linux 9 requires several packages. Install them using the following command:

sudo dnf install git libuuid-devel autoconf automake pkgconfig zlib-devel curl findutils libmnl gcc make -y

We will now install Netdata from GitHub.

Clone Netdata from GitHub

First, clone the Netdata repository onto your Rocky Linux system with the following command:

sudo git clone https://github.com/netdata/netdata.git --depth=100

Then, navigate into the newly created Netdata directory:

cd netdata

Enable PowerTools (crb) on Rocky Linux 9

Enable the PowerTools repository with the following command:

sudo dnf config-manager --set-enabled crb

Then, execute the commands below to install the required packages:

# sudo dnf install autoconf-archive libuv-devel
# sudo ./packaging/installer/install-required-packages.sh --non-interactive --dont-wait netdata

Build and Install Netdata on Rocky Linux 9

Now, execute the script below to build and install Netdata on your Rocky Linux system:

sudo ./netdata-installer.sh

Upon successful installation, you should see output similar to the following:

build netdata rocky linux 9

Start and Enable Netdata Service

Now, you need to start and enable the Netdata service on Rocky Linux 9. Use the following commands:

# sudo systemctl start netdata
# sudo systemctl enable netdata

Verify that Netdata is active and running:

sudo systemctl status netdata
netdata status rocky linux 9

Configure Firewall For Netdata on Rocky Linux 9

By default, Netdata listens on port 19999. We assume you have firewalld enabled.

Allow Netdata traffic through the Rocky Linux 9 firewall:

sudo firewall-cmd --permanent --add-port=19999/tcp

Then, reload the firewall for the changes to take effect:

sudo firewall-cmd --reload

Access Netdata Dashboard From Web Interface

You have successfully installed Netdata on Rocky Linux 9. Access the Netdata dashboard by entering your server’s IP address followed by :19999 in your web browser:

http://<server-ip-address>:19999/

You should see your system overview on the Netdata dashboard:

system overview on the Netdata dashboard

For more detailed information, refer to the Netdata Documentation.

Conclusion

You have now learned how to Install Netdata on Rocky Linux 9. Netdata can be used for robust performance and health monitoring of your systems and applications. We hope you enjoy using it.

You might also find these articles interesting:

Upgrade Rocky Linux 9 Kernel To The Latest Version

Install Bitwarden on AlmaLinux 9 / Rocky Linux 9

Install LEMP Stack on Rocky Linux 9

Install LAMP Stack on Rocky Linux 9

FAQs

How do I start and enable the Netdata service on Rocky Linux 9?

You can start and enable the Netdata service with the following commands:
sudo systemctl start netdata
sudo systemctl enable netdata

How can I access the Netdata web interface after installation on Rocky Linux 9?

You can access the Netdata dashboard on Rocky Linux by typing your server’s IP address in your web browser followed by `19999`.

What ports need to be opened for Netdata on Rocky Linux 9?

By default, Netdata listens on port `19999`. You need to open port 19999 through your firewall settings as detailed in the guide for installing Netdata on Rocky Linux 9.

Alternative Installation Methods for Netdata on Rocky Linux 9

While the previous method details installing Netdata from the GitHub repository, here are two alternative approaches you can use to achieve the same result on Rocky Linux 9.

1. Using the Netdata Static Binary Installer

This method uses a pre-compiled binary installer, simplifying the installation process. It’s a faster method than compiling from source.

Explanation:

Netdata provides a script that automatically downloads and installs the latest stable version of Netdata using a pre-built binary. This eliminates the need to clone the repository, install dependencies, and compile the source code. This method is suitable for users who prefer a simpler and faster installation process.

Steps:

  1. Download and Run the Installer:

    curl -Ss 'https://install-netdata.sh' | sudo bash

    This command downloads the install-netdata.sh script and executes it with root privileges using sudo bash. The script will handle downloading the binary, installing Netdata, and configuring the systemd service.

  2. Follow the Prompts:

    The script will prompt you for confirmation before proceeding. Answer ‘yes’ to the prompts to continue the installation.

  3. Verify Installation:

    After the installation is complete, verify that Netdata is running:

    sudo systemctl status netdata
  4. Configure the Firewall:

    As with the original method, you’ll need to open port 19999 in your firewall:

    sudo firewall-cmd --permanent --add-port=19999/tcp
    sudo firewall-cmd --reload
  5. Access the Dashboard:

    Access the Netdata dashboard in your web browser using your server’s IP address and port 19999.

Pros:

  • Simpler and faster than compiling from source.
  • No need to install dependencies manually.
  • Automatic updates (if configured).

Cons:

  • Less control over the build process.
  • Relies on the availability of the binary on Netdata’s servers.

2. Using a Container (Docker/Podman)

This method involves running Netdata within a container. It’s a good option for isolating Netdata from the host system and simplifying deployment.

Explanation:

Containers provide an isolated environment for running applications. Running Netdata in a container ensures that its dependencies do not conflict with other software installed on the host system. This method also simplifies deployment and management, as you can easily deploy and update Netdata using container orchestration tools.

Steps (using Docker – the process is similar for Podman):

  1. Install Docker:

    If you don’t have Docker installed, install it using the following command:

    sudo dnf install docker -y
    sudo systemctl start docker
    sudo systemctl enable docker
  2. Pull the Netdata Image:

    Download the official Netdata Docker image from Docker Hub:

    sudo docker pull netdata/netdata
  3. Run the Netdata Container:

    Run the Netdata container with the necessary volumes and ports:

    sudo docker run -d --name=netdata 
        --cap-add SYS_PTRACE 
        --security-opt apparmor=unconfined 
        -v netdataconfig:/etc/netdata 
        -v netdatalib:/var/lib/netdata 
        -v netdatacache:/var/cache/netdata 
        -v /:/host:ro,rslave 
        -p 19999:19999 
        --restart unless-stopped 
        netdata/netdata

    Explanation of the parameters:

    • -d: Runs the container in detached mode (background).
    • --name=netdata: Assigns the name "netdata" to the container.
    • --cap-add SYS_PTRACE: Grants the container the SYS_PTRACE capability, which is required for some Netdata collectors.
    • --security-opt apparmor=unconfined: Disables AppArmor confinement for the container, which may be necessary for some systems.
    • -v netdataconfig:/etc/netdata: Mounts a Docker volume named netdataconfig to the container’s /etc/netdata directory for persistent configuration.
    • -v netdatalib:/var/lib/netdata: Mounts a Docker volume named netdatalib to the container’s /var/lib/netdata directory for persistent data.
    • -v netdatacache:/var/cache/netdata: Mounts a Docker volume named netdatacache to the container’s /var/cache/netdata directory for persistent cache.
    • -v /:/host:ro,rslave: Mounts the host’s root filesystem to the container’s /host directory in read-only mode. This allows Netdata to collect metrics from the host system. rslave ensures propagation of mount and unmount events.
    • -p 19999:19999: Maps port 19999 on the host to port 19999 in the container.
    • --restart unless-stopped: Restarts the container automatically unless it is explicitly stopped.
    • netdata/netdata: Specifies the Docker image to use.
  4. Verify Container is Running:

    sudo docker ps

    This command will list running Docker containers. You should see the netdata/netdata container in the list.

  5. Configure the Firewall:

    As with the original method, you’ll need to open port 19999 in your firewall:

    sudo firewall-cmd --permanent --add-port=19999/tcp
    sudo firewall-cmd --reload
  6. Access the Dashboard:

    Access the Netdata dashboard in your web browser using your server’s IP address and port 19999.

Pros:

  • Isolation from the host system.
  • Simplified deployment and management.
  • Consistent environment across different systems.

Cons:

  • Requires Docker or Podman to be installed.
  • Slightly more complex configuration than the binary installer.
  • Increased resource usage compared to running Netdata directly on the host.

These alternative methods offer different approaches to Install Netdata on Rocky Linux 9, allowing you to choose the method that best suits your needs and environment. Regardless of the chosen method, Netdata provides invaluable real-time insights into your system’s performance and health.

Leave a Reply

Your email address will not be published. Required fields are marked *