Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0Qnu-0004Z0-MU for pgsql-admin@arkaria.postgresql.org; Thu, 04 Jun 2015 08:47:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z0Qnu-0006ze-6T for pgsql-admin@arkaria.postgresql.org; Thu, 04 Jun 2015 08:47:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z0Qns-0006xb-QV for pgsql-admin@postgresql.org; Thu, 04 Jun 2015 08:47:09 +0000 Received: from mail-la0-x230.google.com ([2a00:1450:4010:c03::230]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Z0Qnp-0001zd-QG for pgsql-admin@postgresql.org; Thu, 04 Jun 2015 08:47:07 +0000 Received: by laei3 with SMTP id i3so26634728lae.3 for ; Thu, 04 Jun 2015 01:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=laCBfJZPn2WgyOodWhZ4j5lqYvLrWY+jBWpZ6NsVTkQ=; b=EfkH6ynVvz0L2BWM/FwnP5K/Ky70C7ClpgTjcmH8zxl1BwSZFe/Wn5qMUFB1YhXUUe GbIQdqDz2MhFVX5pJV0hS+gkuGz/aQri7YzFlrL8zM3fkyrVMG95Bjnr6IZEOHscuu1v 0PdXkS7cdzkyo2wrpmlcnErb3G+ioTy2mqL5fMyvN89upuBIVNe6gz44zFhHEsTeysG0 KhdozuF1Z7rPtJkJZ1uD2qZQrC37x5HuBCmV6ksDsQtDDeDoNw9u5Loeh03pqdnSXFOO YQGWmceUgCGcPtfHSRmtmcIY/NT5LkWBV9SXkNOzIhnyCCeLsJLoifPL1P67RK8bBCVd LUww== MIME-Version: 1.0 X-Received: by 10.152.115.132 with SMTP id jo4mr37056219lab.102.1433407623210; Thu, 04 Jun 2015 01:47:03 -0700 (PDT) Received: by 10.25.207.136 with HTTP; Thu, 4 Jun 2015 01:47:03 -0700 (PDT) In-Reply-To: References: Date: Thu, 4 Jun 2015 10:47:03 +0200 Message-ID: Subject: Re: replication consistency checking From: hydra To: pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=001a11c366d2332e490517ad38fd X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org --001a11c366d2332e490517ad38fd Content-Type: text/plain; charset=UTF-8 On Thu, Jun 4, 2015 at 8:27 AM, Venkata Balaji N wrote: > > > On Thu, Jun 4, 2015 at 2:49 PM, hydra wrote: > >> After setting up streaming replication, is it possible to check whether >> the slave has the same data as the master? >> >> > Yes. There are quite a few ways to check the sync status between master > and standby. Which version of PostgreSQL are you using by the way ? > > Generally, you can easily build some scripts and schedule them in cron to > check the status. You can use functions or catalog views to monitor the > status, this depends on the version of PG you are using. > > You can also use tools like "repmgr" to monitor and manage replication. I > am not 100% sure how good or efficient it is. > > Regards, > Venkata Balaji N > > Fujitsu Australia > > Thanks for the answer, however I'm looking for a data consistency check. That means, you deploy your master standby replication, you're happily running it and after 3 months you decide to do a failover. How can one be sure the data are the same? I'm running PostgreSQL 9.4. --001a11c366d2332e490517ad38fd Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Thu, Jun 4, 2015 at 8:27 AM, Venkata Balaji N <= nag1010@gmail.com> wrote:

=

= On Thu, Jun 4, 2015 at 2:49 PM, hydra <hydrapolic@gmail.com> wrote:
After setting up streaming = replication, is it possible to check whether the slave has the same data as= the master?


Yes. Ther= e are=C2=A0quite a few ways to check the sync status=C2=A0between master an= d standby. Which version of PostgreSQL are you using by the way ?=C2=A0

Generally, you can easily build some scripts and sche= dule them in cron to check the status. You can use functions or catalog vie= ws to monitor the status, this depends on the version of PG you are using.<= /div>

You can also use tools like "repmgr" to = monitor and manage replication. I am not 100% sure how good or efficient it= is.

Regards,
Venkata Balaji N

Fujitsu Australia

<= div>
Thanks for the answer, however I'm looking for a dat= a consistency check.

That means, you deploy your master s= tandby replication, you're happily running it and after 3 months you de= cide to do a failover. How can one be sure the data are the same?

I'm running PostgreSQL 9.4.

--001a11c366d2332e490517ad38fd--