How to install Prometheus Server on Centos Linux and Integrate it with Grafana Server

  Рет қаралды 6,748

Avinashkumar - The Learning Destination

Avinashkumar - The Learning Destination

Күн бұрын

This tutorial helps you to configure Prometheus Server on Centos Linux and integrate it with Grafana as a Data Source.
The following commands has been used under this Tutorial:
wget github.com/pro...
Add Prometheus User
useradd --no-create-home --shell /bin/false prometheus
Create diectory and change ownership
mkdir /etc/prometheus
mkdir /var/lib/prometheus
chown prometheus:prometheus /etc/prometheus
chown prometheus:prometheus /var/lib/prometheus
#Extract Prmetheus file & rename it.
tar -xvzf prometheus-2.8.1.linux-amd64.tar.gz
mv prometheus-2.8.1.linux-amd64 prometheuspackage
Copy “prometheus” and “promtool” binary and change ownership
cp prometheuspackage/prometheus /usr/local/bin/
cp prometheuspackage/promtool /usr/local/bin/
chown prometheus:prometheus /usr/local/bin/prometheus
chown prometheus:prometheus /usr/local/bin/promtool
Copy “consoles” and “console_libraries”
cp -r prometheuspackage/consoles /etc/prometheus
cp -r prometheuspackage/console_libraries /etc/prometheus
chown -R prometheus:prometheus /etc/prometheus/consoles
chown -R prometheus:prometheus /etc/prometheus/console_libraries
Configure Prmetheus
vi /etc/prometheus/prometheus.yml
global:
scrape_interval: 10s
scrape_configs:
job_name: 'prometheus_master'
scrape_interval: 5s
static_configs:
targets: ['SERVER_IP:9090']
Change the ownership
chown prometheus:prometheus /etc/prometheus/prometheus.yml
vi /etc/systemd/system/prometheus.service
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
--config.file /etc/prometheus/prometheus.yml \
--storage.tsdb.path /var/lib/prometheus/ \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries
[Install]
WantedBy=multi-user.target
#start service
systemctl daemon-reload
systemctl start prometheus
systemctl status prometheus
SERVER_IP:9090/graph
Install Node Exporter
wget github.com/pro...
tar -xvzf node_exporter-0.17.0.linux-amd64.tar.gz
useradd -rs /bin/false nodeusr
mv node_exporter-0.17.0.linux-amd64/node_exporter /usr/local/bin/
vim /etc/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter
After=network.target
[Service]
User=nodeusr
Group=nodeusr
Type=simple
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start node_exporter
systemctl enable node_exporter
SERVER_IP:9100/metrics
Login on Prometheus server again
vim /etc/prometheus/prometheus.yml
job_name: 'node_exporter_centos'
scrape_interval: 5s
static_configs:
targets: ['CLIENT_IP:9100']
systemctl restart prometheus
SERVER_IP:9090/targets
Select
Node_memory_MemFree_bytes
Please subscribe my Travel Vlogging Channel as well: • Pulau Ubin: My first V...

Пікірлер: 5
How to Monitor your Jenkins server with Prometheus & Grafana ? || Integrate Jenkins With Prometheus
12:48
Avinashkumar - The Learning Destination
Рет қаралды 1,4 М.
Monitoring Linux Host Metrics with Prometheus | Node Exporter (Setup, Scrape, Query, Grafana)
10:21
Prometheus Monitoring with Julius | PromLabs
Рет қаралды 14 М.
Это было очень близко...
00:10
Аришнев
Рет қаралды 1,6 МЛН
1 сквиш тебе или 2 другому? 😌 #шортс #виола
00:36
How Prometheus Monitoring works | Prometheus Architecture explained
21:31
TechWorld with Nana
Рет қаралды 1 МЛН
Monitoring, Logging, And Alerting In Kubernetes
22:07
DevOps Toolkit
Рет қаралды 30 М.
Linux Servers: Which Distro should you use?!
21:15
Learn Linux TV
Рет қаралды 139 М.
Server Monitoring // Prometheus and Grafana Tutorial
24:36
Christian Lempa
Рет қаралды 659 М.
NGINX Linux Server | Common Configurations
17:28
Akamai Developer
Рет қаралды 180 М.
Это было очень близко...
00:10
Аришнев
Рет қаралды 1,6 МЛН