Last active
April 23, 2025 13:39
-
-
Save gir-yay/916768117c111594da0643a30742b96f to your computer and use it in GitHub Desktop.
Prometheus service
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
wget https://github.com/prometheus/prometheus/releases/download/v2.53.4/prometheus-2.53.4.linux-amd64.tar.gz | |
tar xvf prometheus-2.53.4.linux-amd64.tar.gz | |
cd prometheus-2.53.4.linux-amd64/ | |
sudo useradd --no-create-home --shell /bin/false prometheus | |
sudo mkdir /etc/prometheus | |
sudo mkdir /var/lib/prometheus | |
sudo chown prometheus:prometheus /var/lib/prometheus | |
sudo chown prometheus:prometheus /etc/prometheus | |
sudo cp prometheus /usr/local/bin/ | |
sudo cp promtool /usr/local/bin/ | |
sudo chown prometheus:prometheus /usr/local/bin/prometheus | |
sudo chown prometheus:prometheus /usr/local/bin/promtool | |
sudo cp -r console/ /etc/prometheus/ | |
sudo cp -r consoles/ /etc/prometheus/ | |
sudo cp -r console_libraries/ /etc/prometheus/ | |
sudo chown -R prometheus:prometheus /etc/prometheus/consoles/ | |
sudo chown -R prometheus:prometheus /etc/prometheus/console_libraries/ | |
sudo cp prometheus.yml /etc/prometheus/ | |
sudo chown prometheus:prometheus /etc/prometheus/prometheus.yml | |
sudo nano /etc/systemd/system/prometheus.service |
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
wget https://github.com/prometheus/node_exporter/releases/download/v1.9.1/node_exporter-1.9.1.linux-amd64.tar.gz | |
tar xvf node_exporter-1.9.1.linux-amd64.tar.gz | |
cd node_exporter-1.9.1.linux-amd64/ | |
sudo cp node_exporter /usr/local/bin/ | |
sudo useradd --no-create-home --shell /bin/false node_exporter | |
sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter | |
cd | |
sudo nano /etc/systemd/system/node_exporter.service |
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=Node Exporter | |
Wants=network-online.target | |
After=network-online.target | |
[Service] | |
User=node_exporter | |
Group=node_exporter | |
Type=simple | |
ExecStart=/usr/local/bin/node_exporter | |
[Install] | |
WantedBy=multi-user.target |
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 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment