Created
January 3, 2024 11:32
-
-
Save tarasowski/5095a24c936b3c3f5af533e0ab5b722d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Prometheus Server | |
Documentation=https://prometheus.io/docs/introduction/overview/ | |
After=network-online.target | |
[Service] | |
User=ec2-user | |
#Group=ec2-user | |
WorkingDirectory=/opt/prometheus | |
Restart=on-failure | |
# Change this line if Prometheus is located at a different path | |
ExecStart=/opt/prometheus/prometheus \ | |
--config.file=/opt/prometheus/prometheus.yml | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo vi /etc/systemd/system/prometheus.service
change premissions
sudo chown -R ec2-user: /opt/prometheus/data
recursively for all data inside of the folder
sudo chown -R ec2-user: /opt/prometheus
reload system manager
sudo systemctl daemon-reload
start prometheus
sudo systemctl start prometheus
enable to start on boot
sudo systemctl enable prometheus
check the status of the app
sudo systemctl status prometheus
sudo systemctl restart prometheus