2017-03-10 54 views
0

我目前使用postgresql和日誌傳送複製。我使用起搏器的主/從資源來處理postgresql故障切換。是否可以在不使用「repmgr standby clone」的情況下降級主節點?pg_rewind

我在問是否有降級主服務器的方法,將其設置爲備用服務器並保持同步,而不使用「repmgr備用克隆」既不pg_rewind。

實際上,我希望舊的主服務器能夠快速恢復到主狀態,「repmgr待機克隆」需要幾分鐘才能恢復,這太長了。

我發現可以使用pg_rewind進行更快的同步,但這意味着要啓用wal_log_hints,並且我擔心這個選項會降低主控的性能。主人已經太忙了。

我嘗試只是寫在數據目錄中的recovery.conf,主井已轉向從模式,但它不具備上游:

[[email protected] httpd]# su - postgres -c "/usr/pgsql-9.5/bin/repmgr -f /var/lib/pgsql/repmgr/repmgr.conf cluster show" Role | Name | Upstream | Connection String ----------+--------|----------|-------------------------------------- * master | node-02 | | host=node-02 user=repmgr dbname=repmgr standby | node-01 | | host=node-01 user=repmgr dbname=repmgr

我想這是非常明顯的,我其實是數據庫複製的新手。任何幫助,將不勝感激。

回答

0

我自己找到了解決方案。事實上,前主人只需在被降級後註冊。如果節點先前已註冊,則應使用--force。

[[email protected] ] su - postgres -c "/usr/pgsql-9.5/bin/repmgr -f /var/lib/pgsql/repmgr/repmgr.conf standby register --force" 
相關問題