I have posted my questions in another subject, but no one reply. So, I have to open a new one, just want to get quick answer.
We set up two adapters in two machines, and according the reference link: https://blog.timescale.com/prometheus-ha-postgresql-8de68d19b6f5/, we set advisory-lock-id to the same value of 1321, and leader timeout to 16s, while the scraping interval is 15s. Here is the command which we start up adapter, and start up two adapters in two machine using the same command:
prometheus-postgresql-adapter -log.level=info -pg.max-open-conns=200 -web.listen-address=:9201 -leader-election.pg-advisory-lock-id=1231 -leader-election.pg-advisory-lock.prometheus-timeout=16s -pg.host= -pg.port= -pg.database= -pg.user= -pg.password=* -pg.prometheus-chunk-interval=24h0m0s -pg.schema=** >> /var/log/prometheus-postgresql-adapter-9201.log 2>&1 &
The strange thing is that, we started up two prometheus and one each pointed to one of the two adapters, and, the logs showing up that the all two adapters can write metrics into PG. Here are the screenshots for log files:
As I understand it, only one adapter accepts write quests, and there other not. So, I need some help on this ?
I have posted my questions in another subject, but no one reply. So, I have to open a new one, just want to get quick answer.
We set up two adapters in two machines, and according the reference link: https://blog.timescale.com/prometheus-ha-postgresql-8de68d19b6f5/, we set advisory-lock-id to the same value of 1321, and leader timeout to 16s, while the scraping interval is 15s. Here is the command which we start up adapter, and start up two adapters in two machine using the same command: prometheus-postgresql-adapter -log.level=info -pg.max-open-conns=200 -web.listen-address=:9201 -leader-election.pg-advisory-lock-id=1231 -leader-election.pg-advisory-lock.prometheus-timeout=16s -pg.host= -pg.port= -pg.database= -pg.user= -pg.password=* -pg.prometheus-chunk-interval=24h0m0s -pg.schema=** >> /var/log/prometheus-postgresql-adapter-9201.log 2>&1 &
The strange thing is that, we started up two prometheus and one each pointed to one of the two adapters, and, the logs showing up that the all two adapters can write metrics into PG. Here are the screenshots for log files:
As I understand it, only one adapter accepts write quests, and there other not. So, I need some help on this ?