wget -q -O gpg.key https://rpm.grafana.com/gpg.key sudo rpm --import gpg.key
nano /etc/yum.repos.d/grafana.repo
and paste
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
exclude=*beta*
run sudo dnf install grafana -y
dnf install loki promtail -y
useradd --no-create-home --shell /bin/false prometheus mkdir /etc/prometheus /var/lib/prometheus chown prometheus:prometheus /etc/prometheus chown prometheus:prometheus /var/lib/prometheus
tar -xvzf prometheus-2.50.1.linux-amd64.tar.gz mv prometheus-2.50.1.linux-amd64 prometheus
cp prometheus/prometheus /usr/local/bin/ cp prometheus/promtool /usr/local/bin/
chown prometheus:prometheus /usr/local/bin/prometheus chown prometheus:prometheus /usr/local/bin/promtool
cp -r prometheus/consoles /etc/prometheus cp -r prometheus/console_libraries /etc/prometheus
chown -R prometheus:prometheus /etc/prometheus/consoles chown -R prometheus:prometheus /etc/prometheus/console_libraries
nano /etc/prometheus/prometheus.yml
` global: scrape_interval: 10s
scrape_configs:
- job_name: 'prometheus_master'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090'] `
chown prometheus:prometheus /etc/prometheus/prometheus.yml
nano /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 `
systemctl daemon-reload
systemctl enable --now prometheus systemctl start --now prometheus systemctl status prometheus