Hot Standby 与 Stream Replication

    本文主要针对PostgreSQL主备配置中常常提到得Hot Standby与Stream Replication两种方式的区别进行简单记录、说明。post

    首先,两者参数配置主要区别以下:spa

    

    原理说明:日志

    >> Hot Standby是基于热备生成的归档:当主库生成新的归档后,备库对归档进行转储、恢复。这也就表示,hot standby中,当发生宕机后,备库可能会有一个归档日志的数据丢失进程

    >> Stream Replication是基于WAL Record:当主库新写了一个Wal Record以后,自动对该record进行同步,备库接收后进行自动恢复同步

    两者都配置好以后,经过进程也能够发现:it

    >> Hot Standby的备端能够看到以下进程:io

postgres: startup process   waiting for 000000010000000000000005stream

postgres: startup process   recovering 000000010000000000000005原理

    >> Stream Replication的备端看到的倒是:配置

wal receiver process   streaming 0/E0001C8

startup process   recovering 00000001000000000000000E

相关文章
相关标签/搜索