Monitoring Replication on Master/Slave Postgres(9.1)

From: Shams Khan <shams(dot)khan22(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Monitoring Replication on Master/Slave Postgres(9.1)
Date: 2012-11-26 10:05:09
Message-ID: CAM42boou8pj2qsGkBqpDY0X3pCkyUnujqMGuiC-L-zwW3Qjuwg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

HI All,

I want to know the ways to monitor the replication, whether the master and
slave server are sync.
The way I am checking it is:

*On Master:*

[root(at)livedb1 ~]# ps -ef | grep sender
postgres 2152 7045 0 Nov05 ? 01:05:33 postgres: wal sender
process postgres 10.0.0.2(45862) streaming 17A/35B62638
root 26030 10506 0 15:26 pts/2 00:00:00 grep sender

radius=# SELECT pg_current_xlog_location();
pg_current_xlog_location
--------------------------
17A/342A6F78
(1 row)

*On slave database:*

[root(at)liveDB2 ~]# ps -ef | grep receiver
root 11725 4286 0 15:28 pts/0 00:00:00 grep receiver
postgres 27250 3432 0 Nov05 ? 00:35:33 postgres: wal receiver
process streaming 17A/363EE668

radius=# select pg_last_xlog_receive_location();
pg_last_xlog_receive_location
-------------------------------
17A/34366C30
(1 row)

*If I go to pg_xlog folder:* I checked on slave WAL files are generated.
However I could not find the same result whenever I run
pg_current_xlog_location(); on master and on the other side I get the
different number (on slave)

My question is how do we read these numbers(17A/342A6F78 and 17A/34366C30)
I never got the same results on both servers. Is that mean slave is not
synced with master?
If yes, then how do we ensure my replication is working fine?

Please share you knowledge and through some light.

thanx

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Shams Khan 2012-11-27 07:37:09 Fwd: Monitoring Replication on Master/Slave Postgres(9.1)
Previous Message Magnus Hagander 2012-11-25 17:07:19 Re: PostgreSQL server: received invalid response to SSL negotiation