Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZNkG7-0000tP-BD for pgsql-admin@arkaria.postgresql.org; Fri, 07 Aug 2015 16:12:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZNkG6-0004S5-Om for pgsql-admin@arkaria.postgresql.org; Fri, 07 Aug 2015 16:12:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZNkG5-0004Ru-Qw for pgsql-admin@postgresql.org; Fri, 07 Aug 2015 16:12:38 +0000 Received: from nm30-vm6.bullet.mail.gq1.yahoo.com ([98.136.216.197]) by magus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZNkFs-0004Ur-Ed for pgsql-admin@postgresql.org; Fri, 07 Aug 2015 16:12:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1438963939; bh=7jVzF453qqkHMip6KZFYfrVO3402aFC+j3yCTFXxTOw=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=KbGl7g9J9fTDwz3+77xJ+isOXjURxnWwRJVj7DWEZrqk8Z4oIU4lGw81l6ZS089/Qzd7twYWEUfWKcBdXFVsJXhHiZKCLq97jplPEPwZp++T6nlreS/NM6iCCi6CVxni4LWVj0TKjRshcIPS0IT/ooYwOj4/OWoVpgSAVbGGlcv044JLTELLBc2S5PoHUWCZ8Jlkk+y6RmvHgFpVihfkUIOs1HmmvIIcIpuFKlvAB94gR8+1TO7rCdzX83bp0kzWSGYlahQIEs3iIVXRB3+3PezhsXWVmBGpwCMgbMV+WkC2HYX4C5Hm5ppPsPHFBX/8Nfwyiz65yK5U6bkghFZ+Cw== Received: from [216.39.60.182] by nm30.bullet.mail.gq1.yahoo.com with NNFMP; 07 Aug 2015 16:12:19 -0000 Received: from [98.137.12.213] by tm18.bullet.mail.gq1.yahoo.com with NNFMP; 07 Aug 2015 16:12:19 -0000 Received: from [127.0.0.1] by omp1021.mail.gq1.yahoo.com with NNFMP; 07 Aug 2015 16:12:19 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 799942.16277.bm@omp1021.mail.gq1.yahoo.com X-YMail-OSG: mw3.4A4VM1n7dBp2TYu6SbJJBq4D.ikzRic4fA6XypBIqT8IJoJLPoTEB3UMLED m2DFaQx1GsY9zusPnIQQDXVmbzflXCSnIVcInuR_j2JA_jbVL2k2Di3.JEB1SLkv71Nmgkw3Kh5P z_lr.sH1iPcECvRWO4iXUv8bgmB0lxJolfa3ReBdEOELlhnGms5rf5lOtzBlcgpmNW_b1anjN1FB oFZI1hcohwOQMtCBBAGytdrXAssX1PQdegyeE3Pp6Rvhv4EEwOFeHuBDaUHfB5XAlqLEmEhWSL4a TfQUXs_UQF6I08mFvCmxqd3iANu0EJr_HhHZZ2mqOJpziV7_FaqujVz5nC7L8Dg9P4Jkqd62A0rp A7VQwMGgQE3oBQemc4zGdKxyU5UVnuC1PvVT2imNLrif_7OxGdNxMop7otcxXLBd4Wc72chUQ8ZR TeoZfl4p0FOpjzwhfawigg5acCPNQ4m.Q30_HlSZW9.wkrQ1sDZGHUdU9mleUV_uuuA-- Received: by 216.39.60.157; Fri, 07 Aug 2015 16:12:19 +0000 Date: Fri, 7 Aug 2015 16:12:18 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: HEMPLEMAN Matthew , "pgsql-admin@postgresql.org" Message-ID: <638490037.514417.1438963938801.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: References: Subject: Re: Replication Cluster Monitoring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Length: 1399 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 HEMPLEMAN Matthew wrote: > I=E2=80=99m writing a Java application to monitor a streaming > replication cluster (Windows). I want to monitor the Master and > initiate failover if necessary (something like a scaled down > version of pgpool). I also want to monitor the standby and > terminate synchronous replication in the event of a failure. At > this point, my app is polling the Master every N seconds and > triggering a failover if the wait is too long or it receives a > connection error. I=E2=80=99m worried that this method of assessing > server health could lead to false-failovers. Any suggestions as > to specific health checks I could run or issues I should watch > out for? Such an approach has many race conditions that can cause problems. You may want to do web searches on the terms "split-brain syndrome", STONITH, fencing, and heartbeat (as they apply to computing). It is not trivial to get this right, and if it's not right it can easily cause more down time than it prevents. (That's not unique to PostgreSQL; it's the nature of automating fail-over.) Be sure to consider what happens for transient network failures on each machine and combination of machines, or if a machine temporarily has a load that causes it not to respond for seconds or minutes. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin