Postgresql 中文操作指南
31.8. Monitoring #
因为逻辑复制基于类似于 physical streaming replication的架构,所以发布节点上的监控与物理复制主机的监控类似(参见 Section 27.2.5.2)。
Because logical replication is based on a similar architecture as physical streaming replication, the monitoring on a publication node is similar to monitoring of a physical replication primary (see Section 27.2.5.2).
订阅的监控信息在 pg_stat_subscription 中可见。此视图包含每一订阅工人的一个行。一个订阅可以有零个或多个活动订阅工人,具体取决于其状态。
The monitoring information about subscription is visible in pg_stat_subscription. This view contains one row for every subscription worker. A subscription can have zero or more active subscription workers depending on its state.
通常,对于一个启用的订阅,会运行一个应用进程。一个禁用的订阅或一个崩溃的订阅在这个视图中将有零行。如果某个表中的初始数据同步正在进行,那么用于正在同步的表将有额外的工人。此外,如果 streaming 事务以并行方式应用,那么可能会有额外的并行应用工人。
Normally, there is a single apply process running for an enabled subscription. A disabled subscription or a crashed subscription will have zero rows in this view. If the initial data synchronization of any table is in progress, there will be additional workers for the tables being synchronized. Moreover, if the streaming transaction is applied in parallel, there may be additional parallel apply workers.