暂无图片
repmgr switchover切换是无法执行checkpoint
我来答
分享
暂无图片 匿名用户
repmgr switchover切换是无法执行checkpoint

主要是参数--force-rewind影响,加上这个参数之后出现如下信息:

[postgres@pgdb01:/postgresql/log]$repmgr -f /postgresql/pg12/repmgr.conf standby switchover --siblings-follow --force-rewind
NOTICE: executing switchover on node "pgdb01" (ID: 1)
NOTICE: attempting to pause repmgrd on 3 nodes
NOTICE: local node "pgdb01" (ID: 1) will be promoted to primary; current primary "pgdb02" (ID: 2) will be demoted to standby
NOTICE: stopping current primary node "pgdb02" (ID: 2)
NOTICE: issuing CHECKPOINT on node "pgdb02" (ID: 2)
DETAIL: executing server command "/postgresql/pg12/bin/pg_ctl -D '/postgresql/data' -W -m fast stop"
INFO: checking for primary shutdown; 1 of 60 attempts ("shutdown_check_timeout")
INFO: checking for primary shutdown; 2 of 60 attempts ("shutdown_check_timeout")
NOTICE: current primary has been cleanly shut down at location 0/52000028
NOTICE: promoting standby to primary
DETAIL: promoting server "pgdb01" (ID: 1) using pg_promote()
NOTICE: waiting up to 60 seconds (parameter "promote_check_timeout") for promotion to complete
NOTICE: STANDBY PROMOTE successful
DETAIL: server "pgdb01" (ID: 1) was successfully promoted to primary
NOTICE: issuing CHECKPOINT on node "pgdb01" (ID: 1)
ERROR: unable to execute CHECKPOINT
NOTICE: node "pgdb01" (ID: 1) promoted to primary, node "pgdb02" (ID: 2) demoted to standby
NOTICE: executing STANDBY FOLLOW on 1 of 1 siblings
INFO: STANDBY FOLLOW successfully executed on all reachable sibling nodes
NOTICE: switchover was successful
DETAIL: node "pgdb01" is now primary and node "pgdb02" is attached as standby
NOTICE: STANDBY SWITCHOVER has completed successfully


报错ERROR: unable to execute CHECKPOINT

但是不加--force-rewind这个参数,就没有这个错误;

PG版本12.12

repmgr版本5.3.2

repmgr切换的用户是有superuser权限


我来答
添加附件
收藏
分享
问题补充
2条回答
默认
最新
seagull

手工切换一般不会用--force-rewind

在发生failover的时候自动产生了新主库,原来的主库需要重新注册会用到--force-rewind


比如:

手工切换命令

repmgr -f repmgr.conf  standby switchover  --siblings-follow

发生failover后原主库重新注册

repmgr -f repmgr.conf  node rejoin -h pg3 -p 5432 -U repmgr --force-rewind




暂无图片 评论
暂无图片 有用 1
愤怒的蜗牛
2022-10-09
严少安
2022-10-09
👍‍
彭冲

switchover操作也是有–force-rewind这个选项,repmgr官方也有这段描述:
image.png

检查确认下repmgr用户是否有superuser权限,或者手工加 -S/–superuser验证下

暂无图片 评论
暂无图片 有用 0
李宏达
2022-10-09
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏