postgrsql数据库repmgr集群的搭建部署后,查看发现集群状态有告警:
[pg12@node2 ~]$ repmgr cluster show -f /home/pg12/conf/repmgr.conf ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+-------+---------+-----------+----------+----------+----------+----------+---------------------------------------------------------------- 1 | node1 | primary | * running | | default | 100 | 1 | host=192.168.5.101 user=repmgr dbname=repmgr connect_timeout=2 2 | node2 | standby | running | ! node1 | default | 100 | 1 | host=192.168.5.102 user=repmgr dbname=repmgr connect_timeout=2 WARNING: following issues were detected - node "node2" (ID: 2) is not attached to its upstream node "node1" (ID: 1)
复制
根据集群信息可知主备节点都正在运行(running), 现在状态是未跟随(not attached to its upstream node)主节点.
这种情况,可尝试手动执行repmgr standby follow 实现跟随。
[pg12@node2 ~]$ repmgr standby follow -f /home/pg12/conf/repmgr.conf NOTICE: attempting to find and follow current primary INFO: timelines are same, this server is not ahead DETAIL: local node lsn is 0/B0007F0, follow target lsn is 0/B0007F0 NOTICE: setting node 2's upstream to node 1 NOTICE: stopping server using "/home/pg12/soft/bin/pg_ctl -D '/home/pg12/data' -w -m fast stop" NOTICE: starting server using "/home/pg12/soft/bin/pg_ctl -w -D '/home/pg12/data' start" NOTICE: STANDBY FOLLOW successful DETAIL: standby attached to upstream node "node1" (ID: 1)
复制
再次查看集群信息, 可知已经正常:
[pg12@node2 ~]$ repmgr cluster show -f /home/pg12/conf/repmgr.conf ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string ----+-------+---------+-----------+----------+----------+----------+----------+---------------------------------------------------------------- 1 | node1 | primary | * running | | default | 100 | 1 | host=192.168.5.101 user=repmgr dbname=repmgr connect_timeout=2 2 | node2 | standby | running | node1 | default | 100 | 1 | host=192.168.5.102 user=repmgr dbname=repmgr connect_timeout=2
复制
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
外国CTO也感兴趣的开源数据库项目——openHalo
小满未满、
1756次阅读
2025-04-21 16:58:09
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
377次阅读
2025-04-15 14:48:05
转发有奖 | PostgreSQL 16 PGCM高级认证课程直播班招生中!
墨天轮小教习
193次阅读
2025-04-14 15:58:34
中国PostgreSQL培训认证体系新增PGAI应用工程师方向
开源软件联盟PostgreSQL分会
186次阅读
2025-05-06 10:21:13
PG生态赢得资本市场青睐:Databricks收购Neon,Supabase融资两亿美元,微软财报点名PG
老冯云数
147次阅读
2025-05-07 10:06:22
华象新闻 | PostgreSQL 18 Beta 1、17.5、16.9、15.13、14.18、13.21 发布
严少安
145次阅读
2025-05-09 11:34:10
SQL 优化之 OR 子句改写
xiongcc
139次阅读
2025-04-21 00:08:06
告别老旧mysql_fdw,升级正当时
NickYoung
125次阅读
2025-04-29 11:15:18
PostgreSQL中文社区亮相于第八届数字中国峰会
PostgreSQL中文社区
110次阅读
2025-05-07 10:06:20
PostgreSQL的dblink扩展模块使用方法
szrsu
106次阅读
2025-04-24 17:39:30
热门文章
[postgresql] repmgr集群 ERROR: unable to retrieve record for local node %n
2023-05-29 1214浏览
[postgresql] repmgr集群维护“服务暂停”(repmgr service pause)
2023-06-05 980浏览
[postgresql] 实现psql自动登录
2023-06-05 604浏览
[postgresql] 访问pgbouncer管理界面,并查看如连接池类型等信息
2023-06-05 572浏览
openGauss每日一练第15天 openGauss逻辑结构:表管理3
2022-12-13 411浏览
最新文章
[postgresql] 实现psql自动登录
2023-06-05 604浏览
[postgresql] 访问pgbouncer管理界面,并查看如连接池类型等信息
2023-06-05 572浏览
[postgresql] repmgr集群维护“服务暂停”(repmgr service pause)
2023-06-05 980浏览
[postgresql] repmgr集群 ERROR: unable to retrieve record for local node %n
2023-05-29 1214浏览
[postgresql] repmgr集群手动切换报错 "data_directory" parameter in repmgr.conf on "XXX" is incorrectly
2023-05-26 299浏览