1.repmgr 主从切换 报错
[pgsql@pg2:/home/pgsql]$repmgr -f /postgresql/app/postgresql/repmgr.conf standby switchover --siblings-follow --dry-run --force-rewindNOTICE: checking switchover on node "pg2" (ID: 2) in --dry-run mode
INFO: prerequisites for using pg_rewind are met
WARNING: unable to connect to remote host "192.168.1.10" via SSH
ERROR: unable to connect via SSH to host "192.168.1.10", user ""
无法切换成功。配置ssh;
2号节点没有配置到其他节点的免密登陆,重新配置就可以了。
2.配置免密登陆重试
需要重新在2号节点配置SSH免密登陆。
[pgsql@pg2:/home/pgsql]$repmgr -f /postgresql/app/postgresql/repmgr.conf standby switchover --siblings-follow --dry-run --force-rewindNOTICE: checking switchover on node "pg2" (ID: 2) in --dry-run mode
INFO: prerequisites for using pg_rewind are met
INFO: SSH connection to host "192.168.1.10" succeeded
INFO: able to execute "repmgr" on remote host "192.168.1.10"
INFO: all sibling nodes are reachable via SSH
INFO: 3 walsenders required, 10 available
INFO: demotion candidate is able to make replication connection to promotion candidate
WARNING: number of pending archive files on demotion candidate "pg1" exceeds the warning threshold
DETAIL: 23 pending archive files (warning threshold: 16)
HINT: PostgreSQL will not shut down until all files are archived
INFO: replication lag on this standby is 0 seconds
INFO: 3 replication slots required, 10 available
NOTICE: attempting to pause repmgrd on 4 nodes
NOTICE: local node "pg2" (ID: 2) would be promoted to primary; current primary "pg1" (ID: 1) would be demoted to standby
INFO: following shutdown command would be run on node "pg1":
"/postgresql/app/postgresql/bin/pg_ctl stop -w -D /postgresql/data"
INFO: parameter "shutdown_check_timeout" is set to 60 seconds
INFO: prerequisites for executing STANDBY SWITCHOVER are met