[英]repmgr - how to make previous Primary to become a standby after failover
執行故障轉移后,我之前的主節點已關閉,而舊的備用節點成為主節點,正如預期的那樣。
$ repmgr -f /etc/repmgr.conf cluster show --compact
ID | Name | Role | Status | Upstream | Location | Prio. | TLI
----+-----------------+---------+-----------+----------+----------+-------+-----
1 | server1 | primary | - failed | | default | 100 | ?
2 | server2 | primary | * running | | default | 100 | 2
3 | PG-Node-Witness | witness | * running | server2 | default | 0 | 1
我想讓舊的主節點作為備用節點加入集群。
我收集重新加入命令應該這樣做。
但是,當我嘗試重新加入它,成為新的備用服務器時,我得到了這個(我在舊的主節點上運行它):
repmgr -f /etc/repmgr.conf -d 'host=10.9.7.97 user=repmgr dbname=repmgr' node rejoin
--其中 10.9.7.97 是我正在運行的節點的 ip。
我收到此錯誤:
$ repmgr -f /etc/repmgr.conf -d 'host=10.97.7.97 user=repmgr dbname=repmgr' node rejoin --verbose -
NOTICE: using provided configuration file "/etc/repmgr.conf"
ERROR: connection to database failed
DETAIL:
could not connect to server: Connection refused
Is the server running on host "10.97.7.97" and accepting
TCP/IP connections on port 5432?
當然 postgres 在 10.9.7.97 - 舊的主要版本上失敗了。
但是,如果我啟動它,它將作為另一個主要啟動:
$ repmgr -f /etc/repmgr.conf cluster show --compact
ID | Name | Role | Status | Upstream | Location | Prio. | TLI
----+-----------------+---------+-----------+----------+----------+-------+-----
1 | server1 | primary | ! running | | default | 100 | 1
2 | server2 | primary | * running | | default | 100 | 2
3 | PG-Node-Witness | witness | * running | server2 | default | 0 | 1
謝謝
顯然
-d 'host=
在rejoin 命令中,應該指定當前的Primary(前一個standby)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.