ITPub博客

首页 > 数据库 > PostgreSQL > PostgreSQL DBA(121) - pgAdmin(HA:PAF vs repmgr vs Patroni)

PostgreSQL DBA(121) - pgAdmin(HA:PAF vs repmgr vs Patroni)

PostgreSQL 作者:husthxd 时间:2019-11-05 14:03:34 0 删除 编辑

本节简单介绍了PostgreSQL HA三种解决方案PAF(PostgreSQL Automatic Failover)、repmgr和Patroni的Pros(优势)和Cons(劣势)。

PAF

PAF Pros
1.PAF provides the user a free hands-on configuration and setup of PostgreSQL.
2.PAF can handle node failures and trigger elections when the master goes down.
3.Quorum behavior can be enforced in PAF.
4.It will provide a complete high availability management solution for the resource, including start, stop, and monitor, and handle network isolation scenarios.
5.It’s a distributed solution, which enables the management of any node from another node.

PAF的优势是PG的安装配置相对自由、主节点宕机的情况下可触发选主、可实现强制仲裁、提供了一整套完整的HA和分布式管理方案。

PAF Cons
1.PAF doesn’t detect if a standby is misconfigured with an unknown or non-existent node in recovery configuration. Node will be shown as slave, even if standby is running without connecting to the master/cascading standby node.
2.Requires an extra port (Default 5405) to be opened for the Pacemaker and Corosync components’ communication using UDP.
3.Does not support NAT-based configuration.
4.No pg_rewind support.

RAF的劣势是不会检测备机是否被错误配置为未知或不存在的节点、需要额外的端口用于Pacemaker和Corosync组件UDP通讯、不支持基于NAT配置以及不支持pg_rewind。

repmgr

repmgr Pros
1.Repmgr provides utilities that help to setup primary and standby nodes and configure replication.
2.It doesn’t use any extra ports for communication. If you want to perform switchover, only then will it require passwordless SSH to be configured.
3.Provides notification by invoking the user scripts for the registered events.
4.Performs automatic failover in case of primary server failure.

repmgr的优势是提供了工具配置主从节点和复制、不需要额外的通讯节点、可调用用户脚本提供通知以及可执行自动的failover。

repmgr Cons
1.repmgr doesn’t detect if the standby is misconfigured with an unknown or non-existent node in recovery configuration. The node will be shown as standby even if it is running without connecting to the primary/cascading standby node.
2.Cannot retrieve the status of another node from a node where PostgreSQL service is down. Hence, it doesn’t provide a distributed control solution.
3.It doesn’t handle recovering the health of individual nodes.

repmgr的劣势是不能检测备机是否被错误配置为未知或不存在的节点、不能检测远程节点的状态(不具备分布式解决方案)以及不能处理单个节点的恢复。

Patroni

Patroni Pros
1.Patroni enables end-to-end setup up of the cluster.
2.Supports REST APIs and HAproxy integration.
3.Supports event notifications via callbacks scripts triggered by certain actions.
4.Leverages DCS for consensus.

Patroni的优势是实现了集群端对端的配置、支持REST APIs和HAProxy的集成、通过回调脚本支持事件通知、利用DCS达成共识。

Patroni Cons
1.Patroni will not detect the misconfiguration of a standby with an unknown or non-existent node in recovery configuration. The node will be shown as a slave even if the standby is running without connecting to the master/cascading standby node.
2.User needs to handle setup, management, and upgrade of the DCS software.
3.Requires multiple ports to be open for components communication:
REST API port for Patroni
Minimum 2 ports for DCS

Patroni的劣势是不能检测备机是否被错误配置为未知或不存在的节点、用户需要自行安装配置DCS、需要多个端口用于组件之间的通讯。

参考资料
Managing High Availability in PostgreSQL – Part I: PostgreSQL Automatic Failover
Managing High Availability in PostgreSQL – Part II: Replication Manager
Managing High Availability in PostgreSQL – Part III: Patroni

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/6906/viewspace-2662693/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
ITPUB数据库版块资深版主,对Oracle、PostgreSQL有深入研究。

注册时间:2007-12-28

  • 博文量
    1441
  • 访问量
    3874783