filmov
tv
How to install Prometheus Server on Centos Linux and Integrate it with Grafana Server #prometheus
Показать описание
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:
# 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.
# 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
global:
scrape_interval: 10s
scrape_configs:
- job_name: 'prometheus_master'
scrape_interval: 5s
static_configs:
- targets: ['SERVER_IP:9090']
# Change the ownership
[Unit]
Description=Prometheus
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
[Install]
#start service
systemctl daemon-reload
systemctl start prometheus
systemctl status prometheus
Install Node Exporter
useradd -rs /bin/false nodeusr
[Unit]
Description=Node Exporter
[Service]
User=nodeusr
Group=nodeusr
Type=simple
ExecStart=/usr/local/bin/node_exporter
[Install]
systemctl daemon-reload
systemctl start node_exporter
systemctl enable node_exporter
Login on Prometheus server again
- job_name: 'node_exporter_centos'
scrape_interval: 5s
static_configs:
- targets: ['CLIENT_IP:9100']
systemctl restart prometheus
Select
Node_memory_MemFree_bytes
The following commands has been used under this Tutorial:
# 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.
# 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
global:
scrape_interval: 10s
scrape_configs:
- job_name: 'prometheus_master'
scrape_interval: 5s
static_configs:
- targets: ['SERVER_IP:9090']
# Change the ownership
[Unit]
Description=Prometheus
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
[Install]
#start service
systemctl daemon-reload
systemctl start prometheus
systemctl status prometheus
Install Node Exporter
useradd -rs /bin/false nodeusr
[Unit]
Description=Node Exporter
[Service]
User=nodeusr
Group=nodeusr
Type=simple
ExecStart=/usr/local/bin/node_exporter
[Install]
systemctl daemon-reload
systemctl start node_exporter
systemctl enable node_exporter
Login on Prometheus server again
- job_name: 'node_exporter_centos'
scrape_interval: 5s
static_configs:
- targets: ['CLIENT_IP:9100']
systemctl restart prometheus
Select
Node_memory_MemFree_bytes
Комментарии