-
Notifications
You must be signed in to change notification settings - Fork 221
02.1. Start Prometheus as a Service
Deekshith SN edited this page Mar 4, 2022
·
1 revision
Stop the running Prometheus process that we left running in the previous lecture, and copy the new files to bin folder.
cp -r . /usr/local/bin/prometheus
Create a file called prometheus.service
sudo nano /etc/systemd/system/prometheus.service
Add the script and save
[Unit]
Description=Prometheus Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/prometheus/prometheus --config.file=/usr/local/bin/prometheus/prometheus.yml
[Install]
WantedBy=multi-user.target
Now start and check the service is running.
sudo service prometheus start
sudo service prometheus status
We can now leave the new Prometheus service running. If you ever need to stop the new Prometheus service, then type
sudo service prometheus stop
sudo service prometheus status
Watch the full video series on YouTube https://www.youtube.com/playlist?list=PLLYW3zEOaqlKhRCWqFE7iLRSh3XEFP5gj