Async replication: how to get an alert on failure
I have few PostgreSQL servers established with replication.
Now, is there any way to receive an e-mail in case of error during
synchronization?
I mean, is there an script I can run (maybe every 5 minutes) that will
check if replication is stolen, and send an e-mail in case of failure?
Thanks,
--
*Edson Carlos Ericksson Richter*
/SimKorp Informática Ltda/
Fone: (51) 3366-7964
Celular: (51)9318-9766/(51) 8585-0796
Embedded Image
Attachments:
I have few PostgreSQL servers established with replication.
Now, is there any way to receive an e-mail in case of error during
synchronization?
I mean, is there an script (cron?) I can run (maybe every 5 minutes)
that will check if replication is stolen, and send an e-mail in case of
failure?
Thanks,
Edson Richter
On 02/08/12 10:04, Edson Richter wrote:
I have few PostgreSQL servers established with replication.
Now, is there any way to receive an e-mail in case of error during
synchronization?
I mean, is there an script (cron?) I can run (maybe every 5 minutes)
that will check if replication is stolen, and send an e-mail in case of
failure?
I created a little Perl script that just connects to the master and
queries the pg_stat_replication statistics.
It notes if (a) the client has disconnected entirely, or (b) if the
client's replay position has still not reached the position that the
master was in last time we checked. (So if you run the check every five
minutes, you'll get a warning if the client is more than five minutes
lagged behind the master)
On 8/1/2012 5:29 PM, Edson Richter wrote:
I have few PostgreSQL servers established with replication.
Now, is there any way to receive an e-mail in case of error during
synchronization?
I mean, is there an script I can run (maybe every 5 minutes) that will
check if replication is stolen, and send an e-mail in case of failure?Thanks,
--
I wrote a small program that goes to each of the servers in the
replication group and checks its status on the log, computes the
difference, and if off by more than "X" bytes prints a notification.
If this is run from the cron it will remain silent unless the offset is
breached at which point it will emit an email to the submitting owner of
the job.
--
-- Karl Denninger
/The Market Ticker ®/ <http://market-ticker.org>
Cuda Systems LLC
Em 02/08/2012 00:22, Karl Denninger escreveu:
On 8/1/2012 5:29 PM, Edson Richter wrote:
I have few PostgreSQL servers established with replication.
Now, is there any way to receive an e-mail in case of error during
synchronization?
I mean, is there an script I can run (maybe every 5 minutes) that
will check if replication is stolen, and send an e-mail in case of
failure?Thanks,
--I wrote a small program that goes to each of the servers in the
replication group and checks its status on the log, computes the
difference, and if off by more than "X" bytes prints a notification.If this is run from the cron it will remain silent unless the offset
is breached at which point it will emit an email to the submitting
owner of the job.--
-- Karl Denninger
/The Market Ticker �/ <http://market-ticker.org>
Cuda Systems LLC
Can you please share the query are you using so I can have a start point?
Thanks,
Edson
Hi Karl,
Hope my mail finds you in good time.
I wrote a small program that goes to each of the servers in the replication
group and checks its status on the log, computes the difference, and if off
by more than "X" bytes prints a notification.
Did you configure ssh ??
If this is run from the cron it will remain silent unless the offset is
breached at which point it will emit an email to the submitting owner of the
job.
Could you please share your views on how to achieve it? Thanks in Advance.
Regards,
Pavan
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html