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

相關文章
相關標籤/搜索