Using TimescaleDB to store Prometheus data
You can use postgres as the remote storage database used by the Prometheus backend.
While this is not the recommended behavior, it is a good opportunity to understand how the Pigsty deployment system is used.
Create a Prometheus business database with business users.
bin/createdb pg-meta prometheus
Install promscale
by executing the following command on the meta node
If not available in the default package, you can directly download it.
wget https://github.com/timescale/promscale/releases/download/0.6.1/promscale_0.6.1_Linux_x86_64.rpm
sudo rpm -ivh promscale_0.6.1_Linux_x86_64.rpm
Edit the config file /etc/sysconfig/promscale.conf
.
PROMSCALE_DB_HOST="127.0.0.1"
PROMSCALE_DB_NAME="prometheus"
PROMSCALE_DB_PASSWORD="DBUser.Prometheus"
PROMSCALE_DB_USER="dbuser_prometheus"
Prometheus can use Remote Write/ Remote Read via Promscale, using Postgres as remote storage.
Edit Prometheus config file.
vi /etc/prometheus/prometheus.yml
Add the following record.
remote_write:
- url: "http://127.0.0.1:9201/write"
- url: "http://127.0.0.1:9201/read"