Why HAProxy?

Part of improving our stack is to understand its weaknesses. We can see in Figure 8-1 that pgpool will promote one of the replicas to be the new primary, but we don't know which! That makes moving the shared IP resource rather difficult.

Some readers may be aware that pgpool can migrate virtual IP resources through its watchdog feature. However, for this functionality to operate properly, pgpool must run as the root user. We find this requirement far too risky to recommend. In fact, we strongly suggest never using this feature unless there is no viable alternative.

HAProxy doesn't have that limitation because every IP address acts as if it were the primary node. So long as we connect through the proxy port we choose during configuration, ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.