#tar xvfz prometheus-2.33.1.linux-amd64.tar.gz
#sudo mv prometheus-2.33.1.linux-amd64 /opt/prometheus
#sudo useradd -rs /bin/false prometheus
#sudo chown -R prometheus:prometheus /opt/prometheus
#cat /opt/prometheus/prometheus.yml
Create a systemd service file for Prometheus;
#sudo nano /etc/systemd/system/prometheus.service
Add the following content:
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path=/opt/prometheus/data
[Install]
WantedBy=multi-user.target
#sudo systemctl daemon-reload
#sudo systemctl start prometheus
#sudo systemctl enable prometheus
http://localhost:9090

Leave a comment