Re: Postgres HA

From: "" <kbrannen(at)pwhome(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Postgres HA
Date: 2017-02-24 18:03:36
Message-ID: 20170224100336.6E8CFD62@m0087795.ppops.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Julyanto Sutandang <julyanto(at)equnix(dot)id> wrote:
> Talking about High Availability, we should understand the basic concept of HA, it is avoiding SPOF (Single Point of Failure). When we use a Loadbalancer (LTM) and that load balancer is single, then you may get HA only for the PostgreSQL but there are another single point of failure, it is the LTM it self. In overall that topology is not HA.
>
> The best configuration for HA i know is using Linux-HA to watch between 2 servers and doing failover VIP (Virtual IP) when Master is down or out of service. The best configuration for HA, Servers should be on the same site and uses direct cable connection to ensure dedicated private bandwidth and there are no Single Point of Failure.
> LinuxHA or pacemaker or corosync will do the Virtual IP swing over from master host to slave host and promote the replica database in slave host become master.
>
> There is no single point of failure.

I'll agree with most of this, especially that avoiding SPOF is the goal.

However, I will point out that if you put both servers in the same site that you've created a SPOF. If you lose power at that site, or construction workers takes out the network cable to the building, or any other thing that can happen to take the whole site down, any of that will cause total failure.

If you really want to avoid that, then the 2 servers need to sit multiple miles/kilometers apart and be served by a dedicated connection or else 2 different network providers (I've heard differing opinions on the best way) that is 100Mb or higher to adequately deal with the various replication issues that must be addressed. If the load is high enough, you may need multiple lines to be bonded or else even Gb.

Of course, the OP may not need that level of HA, but it is something that should be asked and answered by him and his organization.

It's something we deal with for our larger customers. We currently solve the replication with DRBD (for the DB) and csync2 (for the application code and logs). We are slowly considering the question if we'd be better off abandoning DRBD and using Pg's builtin replication, but the jury is still out on that as we haven't had enough time to fully figure it out. We'd considered ZFS replication for a while, but found ZFS to be too slow for the DB despite it's other useful features like replication (at least for the hardware that we had).

Personally, I find HA easy to understand but hard to implement well -- especially without a large budget. :)

HTH,
Kevin

Browse pgsql-general by date

  From Date Subject
Next Message Justin Pryzby 2017-02-24 19:02:48 SELECT x'00000000F'::int leading zeros causes "integer out of range"
Previous Message Moreno Andreo 2017-02-24 15:36:48 echo