π Node-exporter + Prometheus + Grafana
In this guide, weβll set up a monitoring system to collect metrics from all servers and visualize them in Grafana.
We will use a dedicated server to host Prometheus, Grafana, and Node Exporter, while only Node Exporter will be installed on other servers.
Prometheus is an open-source time-series database written in Go. It pulls metrics from defined services, eliminating data queue bottlenecks and ensuring reliable monitoring.
Node Exporter exports server metrics in a format compatible with Prometheus. While Prometheus supports many exporters, Node Exporter is ideal for server monitoring.
Grafana is a web-based tool for visualizing time-series data from Prometheus and other databases. Although Prometheus has its own web interface, Grafana is recommended for advanced visualization.
The setup flow is as follows: Node Exporter collects server metrics β Prometheus stores the data β Grafana visualizes it in dashboards.
Node Exporter
Install and Set Up Node Exporter
Create and Enable the exporterd
Service
exporterd
ServiceVerify Logs
Access Node Exporter Metrics
Open a web browser and navigate to:
http://<server_IP>:9100/
Replace <server_IP>
with the actual IP address of your server running node_exporter
.
Prometheus
Update Repositories and Upgrade Packages
Install Necessary Utilities
Download and Install Prometheus
Create the Prometheus Service File
You can replace the port
9090
with a custom port if needed (e.g.,8080
).
Set Permissions
Start and Enable the Prometheus Service
Access Prometheus
Open a web browser and navigate to:
http://<server_IP>:9090/
Replace <server_IP>
with the IP address of the server running Prometheus.
Add Additional Servers to Prometheus Configuration
To monitor multiple servers, update the prometheus.yml
configuration file with the relevant settings for each server.
Open the Prometheus Configuration File
Add a New Job for Monitoring
Hereβs an example configuration for a job named celestia-consensus
that monitors the target at localhost:26660
.
You can replace localhost:26660
with the IP address and port of the server or service you want to monitor.
For example, if monitoring another server:
Restart Prometheus
Restart the Prometheus service to apply the new configuration:
Verify Prometheus is Running Properly
Check the service status to ensure Prometheus is running without issues:
Access Prometheus
Navigate to http://<server_IP>:9090/targets
in your web browser to see the list of active targets and ensure that the new job is being monitored.
Grafana
Install Required Dependencies
Add the Grafana Repository
Create a User for Grafana
Install Grafana Enterprise
Start and Enable the Grafana Server
Access Grafana
Open a web browser and navigate to:
http://<server_IP>:3000
Replace <server_IP>
with your server's IP address.
Default username:
admin
Default password:
admin
(You will be prompted to change it after the first login).
After changing the password, click "Configuration" and then "Data Sources".
Now click on Add data source and select the Prometheus data source.
Access Prometheus
To access Prometheus, enter the IP address followed by port 9090 .
If you are running Prometheus and Grafana on the same server, use:
http://localhost:9090
If Prometheus and Grafana are on separate servers, enter the IP address of the Prometheus server, for example:
http://<Prometheus_IP>:9090
Replace <Prometheus_IP>
with the actual IP address of your Prometheus server.
Save the settings.
Download Grafana Dashboard JSON Files
To set up dashboards in Grafana, you need the JSON files of the dashboards. These files can either be:
Shared by someone else.
Created by you directly in Grafana.
If youβre using Grafana's library, search for the dashboard by its ID and download the JSON file.
Once downloaded, you can import the JSON file into Grafana through the Import Dashboard option in the Grafana interface.
Now click on Import and then on Upload JSON file.
Upload the JSON file you downloaded earlier, then select the Prometheus data source you just configured and click the +Import button.
Now you have a fully functional monitoring system that can scale to include additional servers and services as needed.
Last updated