This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Troubleshooting
Alexey Lesovsky edited this page May 5, 2021
·
2 revisions
- Check pgSCV is running by systemd - service should be in active (running) state:
# systemctl status pgscv
● pgscv.service - pgSCV is the Weaponry platform agent for PostgreSQL ecosystem
Loaded: loaded (/etc/systemd/system/pgscv.service; disabled; vendor preset: enabled)
Active: active (running) since Mon 2021-02-15 21:58:25 +05; 12h ago
Main PID: 2469573 (pgscv)
Tasks: 17 (limit: 38375)
Memory: 36.0M
CGroup: /system.slice/pgscv.service
└─2469573 /usr/bin/pgscv --config-file=/etc/pgscv.yaml
- Check pgSCV exists in process list
# ps auxf |grep pgscv |grep -v grep
postgres 2469573 1.3 0.1 721044 41524 ? Ssl feb15 10:26 /usr/bin/pgscv --config-file=/etc/pgscv.yaml
- Check port is opened by pgSCV - port specified in YAML configuration should be opened (or default one)
# ss -luntp|grep pgscv
tcp LISTEN 0 4096 127.0.0.1:9890 0.0.0.0:* users:(("pgscv",pid=2469573,fd=7))
- Try to request
/metrics
HTTP endpoint - 200 OK should be returned.
# curl -I http://127.0.0.1:9890/metrics
HTTP/1.1 200 OK
Content-Type: text/plain; version=0.0.4; charset=utf-8
Date: Tue, 16 Feb 2021 05:45:22 GMT
- Try to request particular metrics, count or filter using
grep
.
# curl -s http://127.0.0.1:9890/metrics |grep -c '^postgres_'
7386
- Check log messages using
journalctl
# journalctl -fu pgscv
-- Logs begin at Wed 2020-10-28 08:30:51 +05. --
feb 15 21:58:25 matanuii pgscv[2469573]: {"level":"info","service":"pgscv","time":"2021-02-15T21:58:25+05:00","message":"auto-discovery [pgbouncer]: service added [pgbouncer:6432]"}
feb 15 21:58:25 matanuii pgscv[2469573]: {"level":"info","service":"pgscv","time":"2021-02-15T21:58:25+05:00","message":"auto-discovery [postgres]: service added [postgres:5432]"}
feb 15 21:58:26 matanuii pgscv[2469573]: {"level":"info","service":"pgscv","time":"2021-02-15T21:58:26+05:00","message":"starting tail of /var/log/postgresql/postgresql-replica-Mon.log from the end"}
feb 15 21:58:26 matanuii pgscv[2469573]: {"level":"info","service":"pgscv","time":"2021-02-15T21:58:26+05:00","message":"starting tail of /var/log/postgresql/postgresql-Mon.log from the end"}
feb 16 00:00:01 matanuii pgscv[2469573]: 2021/02/16 00:00:01 Re-opening truncated file /var/log/postgresql/postgresql-Mon.log ...
feb 16 00:00:01 matanuii pgscv[2469573]: 2021/02/16 00:00:01 Successfully reopened truncated /var/log/postgresql/postgresql-Mon.log
feb 16 00:00:26 matanuii pgscv[2469573]: {"level":"info","service":"pgscv","time":"2021-02-16T00:00:26+05:00","message":"logfile changed, stopping current tailing"}
feb 16 00:00:26 matanuii pgscv[2469573]: {"level":"info","service":"pgscv","time":"2021-02-16T00:00:26+05:00","message":"starting tail of /var/log/postgresql/postgresql-replica-Tue.log from the beginning"}
feb 16 00:00:26 matanuii pgscv[2469573]: {"level":"info","service":"pgscv","time":"2021-02-16T00:00:26+05:00","message":"logfile changed, stopping current tailing"}
feb 16 00:00:26 matanuii pgscv[2469573]: {"level":"info","service":"pgscv","time":"2021-02-16T00:00:26+05:00","message":"starting tail of /var/log/postgresql/postgresql-Tue.log from the beginning"}
- pgSCV has
--log-level
option, supported values are: debug, info, warn, error. Default value: info.