Skip to content
Snippets Groups Projects
Commit f146228f authored by mgy20's avatar mgy20
Browse files

Edit Prometheus.md

parent ae1ec42e
No related branches found
No related tags found
No related merge requests found
...@@ -110,15 +110,11 @@ chown prometheus:prometheus /var/lib/prometheus ...@@ -110,15 +110,11 @@ chown prometheus:prometheus /var/lib/prometheus
# Download source # Download source
cd /opt cd /opt
wget https://github.com/prometheus/prometheus/releases/download/v2.48.1/prometheus-2.48.1.linux-amd64.tar.gz wget https://github.com/prometheus/prometheus/releases/download/v3.2.1/prometheus-3.2.1.linux-amd64.tar.gz
tar -xzf prometheus-2.48.1.linux-amd64.tar.gz tar -xzf prometheus-3.2.1.linux-amd64.tar.gz
mv prometheus-2.48.1.linux-amd64 prometheus mv prometheus-3.2.1.linux-amd64/ prometheus
rm prometheus-3.2.1.linux-amd64.tar.gz
cd prometheus cd prometheus
# Copy binaries
cp prometheus promtool /usr/local/bin
# Change permissions
chown prometheus:prometheus /usr/local/bin/prometheus
chown prometheus:prometheus /usr/local/bin/promtool
``` ```
Crie o arquivo `/opt/prometheus/prometheus.yml` Crie o arquivo `/opt/prometheus/prometheus.yml`
...@@ -153,8 +149,9 @@ scrape_configs: ...@@ -153,8 +149,9 @@ scrape_configs:
static_configs: static_configs:
- targets: ["localhost:9090"] - targets: ["localhost:9090"]
- job_name: "postgres_exporter" # === Add connections here
- job_name: "postgres_exporter"
static_configs: static_configs:
- targets: ["localhost:9187"] - targets: ["localhost:9187"]
``` ```
...@@ -171,7 +168,7 @@ After=network-online.target ...@@ -171,7 +168,7 @@ After=network-online.target
User=prometheus User=prometheus
Group=prometheus Group=prometheus
Type=simple Type=simple
ExecStart=/usr/local/bin/prometheus --config.file /opt/prometheus/prometheus.yml --storage.tsdb.path /var/lib/prometheus/ --web.console.templates=/etc/prometheus/consoles --web.console.libraries=/etc/prometheus/console_libraries ExecStart=/opt/prometheus/prometheus --config.file /opt/prometheus/prometheus.yml --storage.tsdb.path /var/lib/prometheus/ --web.console.templates=/etc/prometheus/consoles --web.console.libraries=/etc/prometheus/console_libraries
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment