Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXcxI-0006KL-A2 for pgsql-admin@arkaria.postgresql.org; Sat, 06 Jan 2018 01:07:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXcxH-0002vX-EE for pgsql-admin@arkaria.postgresql.org; Sat, 06 Jan 2018 01:07:23 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eXcxH-0002vI-1V; Sat, 06 Jan 2018 01:07:23 +0000 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eXcxC-0007pa-PR; Sat, 06 Jan 2018 01:07:21 +0000 Received: by mail-qt0-x243.google.com with SMTP id e2so7799479qti.0; Fri, 05 Jan 2018 17:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JTmhcxvg8PcgNsEkAgjfPXFlf665rzBJ5WHd2Qp2VM0=; b=OisldApgl+Mld4JDoQSroQ/Lsz0kAYQpa4aWD9pSfOi4llRKwKn/qqp4p5MmJ6S/Kv oZzRH7toessAQjs+1aVkntMRHBSJNklbfy/zTtP+b7X+JyGf9CB/qstvNdsJt2Ze/8nf 19wUmpoEVBdc06FKmCCgu8Y9VvR2/TWM63q9V7jdh7gmaXalw2siv/n5sqYNRiE1PUdj vCipsMGK3wEVqjwT0OkAkuSsO6jTM3TdezKbHkDqvq75x+jqK+stlhJBg5gEv1W5IY2W 0x182yLoeiCpWQ7KwSqMal653EzBxN9LyKBXYFSoirqzO5H5/gL7RYOaZg45+7kO9zWp M9Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JTmhcxvg8PcgNsEkAgjfPXFlf665rzBJ5WHd2Qp2VM0=; b=cEQXSqDILXwbfvH41PiXExk6BtpAczA0ecUmwGbiwNCcHWO3AVxg9cp32AyBySnY8/ TlZuT0Zw53z2+6SJctIwdAlow6z07+L4/V9dzQLWC6MJUTnIU2XIAjkm+/g1ntTgNonf q0rbfvBfRu3hdrac7hDrTNhpYpU4UkwRKZktOAA0PI6bLwakSMk+TrsEcUE0socI+YHf 8/U/akJpxLipAEvXFMLZAppxv9moQkXsAUCd3Q1ICc25VoFG2rkkAUWH2Qwf0vyeqfK+ l4j/JxR3L9QxfNx8bkt/ub44aLJyJafNwxmVm/O09xR3VRIWDVLcJaydhzNiYMpa79nT xvxQ== X-Gm-Message-State: AKwxytfrhjlJT9xlJQnOwk212njyFYCmB8cHj4fotVfqcdhHVpKOZ0XA ioeNnnH92OuVDPYn/tFJBFOjbVB6 X-Google-Smtp-Source: ACJfBosm+2o4uaA2+MF+q7tWtlsVUDj0CZ7K3qfQjKCWVouZNzboIkjUjBhPQP8Iooju5HHlJ/nmEQ== X-Received: by 10.200.15.35 with SMTP id e32mr6772865qtk.23.1515200837090; Fri, 05 Jan 2018 17:07:17 -0800 (PST) Received: from [192.168.1.152] (pool-71-179-177-60.bltmmd.fios.verizon.net. [71.179.177.60]) by smtp.gmail.com with ESMTPSA id k141sm4482184qke.4.2018.01.05.17.07.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jan 2018 17:07:16 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: Postgres HA From: John Scalia X-Mailer: iPad Mail (15C153) In-Reply-To: <20180105220042.0978d4c1@firost> Date: Fri, 5 Jan 2018 20:07:16 -0500 Cc: Azimuddin Mohammed , pgsql-admin@postgresql.org, pgsql-general@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20180105220042.0978d4c1@firost> To: "Jehan-Guillaume (ioguix) de Rorthais" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk What he said, and you also may want to look at pgpool-II. I=E2=80=99ve had f= airly good luck with that and Tatsuo (the author) hangs out here occasionall= y too. =E2=80=94 Jay Sent from my iPad > On Jan 5, 2018, at 4:00 PM, Jehan-Guillaume (ioguix) de Rorthais wrote: >=20 > On Fri, 5 Jan 2018 13:07:10 -0600 > Azimuddin Mohammed wrote: >=20 >> Hello, >> I am little confused with how HA works in postgres. Reading the article >> which state as below "*If the primary server fails and the standby server= >> becomes the new primary, and then the old primary restarts, you must have= a >> mechanism for informing the old primary that it is no longer the primary.= >> This is sometimes known as STONITH (Shoot The Other Node In The Head), >> which is necessary to avoid situations where both systems think they are >> the primary, which will lead to confusion and ultimately data loss.* >>=20 >> *Many failover systems use just two systems, the primary and the standby,= >> connected by some kind of heartbeat mechanism to continually verify the >> connectivity between the two and the viability of the primary. It is also= >> possible to use a third system (called a witness server) to prevent some >> cases of inappropriate failover, but the additional complexity might not b= e >> worthwhile unless it is set up with sufficient care and rigorous testing.= * >> *PostgreSQL does not provide the system software required to identify a >> failure on the primary and notify the standby database server. Many such >> tools exist and are well integrated with the operating system facilities >> required for successful failover, such as IP address migration."* >>=20 >> Can someone explain how the HA failback will take place >=20 > The failback need either to rebuild the old master as a standby (rsync, > pg_basebackup, restore PITR, ...) or to use pg_rewind to rewind the old ma= ster > to a point where it can catch up with the new master. >=20 > Some tools tries to automate failback using pg_rewind (patroni, repmgr), b= ut I > have no experience with them. >=20 >> and what open source tools we can use to make sure once the primary serve= r >> which failed over to slave will mark itself as slave. >=20 > There's a lot of open source tools to build some HA around PgSQL: Repmgr, > Patroni (based on etcd or zookeeper), PAF (based on Pacemaker), etc. You w= ill > have to spend a lot of time to make extensive tests, understand them, pick= one > and document your cluster. >=20 > Regards, >=20