Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 11294B5DC2C for ; Fri, 10 Jun 2011 01:02:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 53195-01-2 for ; Fri, 10 Jun 2011 04:02:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by mail.postgresql.org (Postfix) with ESMTP id DECA0B5DBF3 for ; Fri, 10 Jun 2011 01:02:39 -0300 (ADT) Received: from [192.168.1.3] (mail.highperformancepostgresql.com [71.179.240.8]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0MJU0R-1QXMhR0sbz-0036zW; Fri, 10 Jun 2011 06:02:38 +0200 Message-ID: <4DF1975C.7060303@2ndquadrant.com> Date: Fri, 10 Jun 2011 00:02:36 -0400 From: Greg Smith User-Agent: Thunderbird 2.0.0.24 (X11/20100317) MIME-Version: 1.0 To: Michael Holt CC: pgsql-admin@postgresql.org Subject: Re: Streaming replication status and fail over questions References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:+ACza50+JNK8VQZXJAR2u7rusua1+7S3Iv9dqMqRa4V Fp554YSxSZ6dR9TW5VlYbZvCg4PfypbB3WL8ojvBy0sRFEXS7I WVz4VsmIYZ6O/oc4zGenEWiXwD2lTc29X9vq0skbeMoPxJoC3c ZF6NduLfp5IatAAvz3Fu/7X1+a/i0H8AuU5npvvY9nnIAgiF9s LRvm0cx0uXfL/0BE+yaZ6e/9Hb1ZxNeEYm23Tt6Rhs= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.419 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FS_REPLICA=3.599, RCVD_IN_DNSWL_NONE=-0.0001, SARE_SPEC_REPLICA=0.72 X-Spam-Level: ** X-Archive-Number: 201106/50 X-Sequence-Number: 37676 Michael Holt wrote: > 1) I've seen things about using pg_current_xlog_location(), > pg_last_xlog_replay_location(), pg_last_xlog_receive_location() to > check replication status, but how can this tell me either the time lag > or actual query lag? Do I need to wait for 9.1 and it's replication > monitoring features? You might want to check out repmgr: http://projects.2ndquadrant.com/repmgr It can collect data in the background that it uses to compute lag in time units. > 2) If I have a master to multi-slave setup and need to fail over, is > there anyway for slaves to detect the new master? Without this it > seems like fail over could be pretty messy. repmgr also provides a view to help make this easier to figure out right now, and the next version due out any day now will go even further toward automating it completely. > 3) Finally just wanted to confirm that SR allows only for replication > of an entire server. Well, an entire database cluster on a server. I have put more than one database cluster on a server before in order to make it possible to replicate only a subset of the data. But that's difficult to pull off, you end up needing tools like dblink for anything that crosses the two databases together. -- Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books