暂无图片
repmgr5.1 正常切换告警,不知道是啥问题,求各位大佬看看
我来答
分享
暂无图片 匿名用户
repmgr5.1 正常切换告警,不知道是啥问题,求各位大佬看看

备库测试执行无报错

repmgr -f /postgresql/pg12/repmgr.conf standby switchover --siblings-follow --dry-run --force-rewind  
pgsql@itpuxpg25:/postgresql/pgdata]$repmgr -f /postgresql/pg12/repmgr.conf standby switchover --siblings-follow --dry-run --force-rewind
NOTICE: checking switchover on node "itpuxpg25" (ID: 2) in --dry-run mode
INFO: prerequisites for using pg_rewind are met
INFO: SSH connection to host "192.168.101.24" succeeded
INFO: able to execute "repmgr" on remote host "192.168.101.24"
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
INFO: 0 pending archive files
INFO: replication lag on this standby is 0 seconds
NOTICE: local node "itpuxpg25" (ID: 2) would be promoted to primary; current primary "itpuxpg24" (ID: 1) would be demoted to standby
INFO: following shutdown command would be run on node "itpuxpg24":
"/postgresql/pg12/bin/pg_ctl -D '/postgresql/pgdata' -W -m fast stop"
INFO: parameter "shutdown_check_timeout" is set to 60 seconds
INFO: prerequisites for executing STANDBY SWITCHOVER are met



在备库正式执行报错

[pgsql@itpuxpg25:/postgresql/pgdata]$repmgr -f /postgresql/pg12/repmgr.conf standby switchover --siblings-follow --force-rewind

NOTICE: executing switchover on node "itpuxpg25" (ID: 2)
NOTICE: local node "itpuxpg25" (ID: 2) will be promoted to primary; current primary "itpuxpg24" (ID: 1) will be demoted to standby
NOTICE: stopping current primary node "itpuxpg24" (ID: 1)
NOTICE: issuing CHECKPOINT on node "itpuxpg24" (ID: 1)
DETAIL: executing server command "/postgresql/pg12/bin/pg_ctl -D '/postgresql/pgdata' -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/1C000028
NOTICE: promoting standby to primary
DETAIL: promoting server "itpuxpg25" (ID: 2) using pg_promote()
NOTICE: waiting up to 60 seconds (parameter "promote_check_timeout") for promotion to complete
NOTICE: STANDBY PROMOTE successful
DETAIL: server "itpuxpg25" (ID: 2) was successfully promoted to primary
NOTICE: issuing CHECKPOINT on node "itpuxpg25" (ID: 2)
ERROR: unable to execute CHECKPOINT
ERROR: connection to database failed
DETAIL:
fe_sendauth: no password supplied
ERROR: unable to establish a replication connection to the rejoin target node
INFO: waiting for node "itpuxpg24" (ID: 1) to connect to new primary; 1 of max 60 attempts (parameter "node_rejoin_timeout")
DETAIL: checking for record in node "itpuxpg25"'s "pg_stat_replication" table where "application_name" is "itpuxpg24"
INFO: waiting for node "itpuxpg24" (ID: 1) to connect to new primary; 6 of max 60 attempts (parameter "node_rejoin_timeout")
DETAIL: checking for record in node "itpuxpg25"'s "pg_stat_replication" table where "application_name" is "itpuxpg24"
......




备库状态

[pgsql@itpuxpg26:/postgresql/pgdata]$repmgr -f /postgresql/pg12/repmgr.conf cluster show
ID | Name | Role | Status | Upstream | Location | Priority | Timeline | Connection string
----+-----------+---------+-----------+-------------+----------+----------+----------+---------------------------------------------------------------------------------
1 | itpuxpg24 | primary | - failed | ? | default | 100 | | host=192.168.101.24 user=repmgr password=repmgr dbname=repmgr connect_timeout=2
2 | itpuxpg25 | standby | running | ? itpuxpg24 | default | 100 | 2 | host=192.168.101.25 user=repmgr password=repmgr dbname=repmgr connect_timeout=2
3 | itpuxpg26 | primary | * running | | default | 100 | 3 | host=192.168.101.26 user=repmgr password=repmgr dbname=repmgr connect_timeout=2
4 | itpuxpg27 | witness | * running | itpuxpg26 | default | 0 | n/a | host=192.168.101.27 user=repmgr password=repmgr dbname=repmgr connect_timeout=2


下面是自己的配置文件信息

[pgsql@itpuxpg24:/postgresql/pgdata]$more pg_hba.conf 

local replication all trust
host replication all 127.0.0.1/32 trust
host replication all ::1/128 trust
host all all 0.0.0.0/0 md5
host replication repuser 0.0.0.0/0 md5
host all nobody 0.0.0.0/0 md5

local repmgr repmgr md5
host repmgr repmgr 127.0.0.1/32 md5
host repmgr repmgr 192.168.101.0/24 md5
local replication repmgr md5
host replication repmgr 127.0.0.1/32 md5
host replication repmgr 192.168.101.0/24 md5


[pgsql@itpuxpg24:/postgresql/pgdata]$more postgresql.conf

listen_addresses = '*'
port = 5432
max_connections = 500
shared_buffers = 4096MB
wal_level = replica
archive_mode = on
archive_command = 'test ! -f /postgresql/archive/%f && cp %p /postgresql/archive/%f'
log_directory = 'pg_log'
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_truncate_on_rotation = on
log_timezone = 'PRC'
datestyle = 'iso, mdy'
lc_messages = 'en_US.utf8'
lc_monetary = 'en_US.utf8'
lc_numeric = 'en_US.utf8'
lc_time = 'en_US.utf8'
default_text_search_config = 'pg_catalog.english'
max_replication_slots=10
wal_log_hints=on
max_wal_senders = 10
wal_keep_segments = 256
wal_sender_timeout = 60s 



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

image.png寄,这是我电脑问题还是网页问题

暂无图片 评论
暂无图片 有用 0
打赏 0
YueCailei

切换过程成功停止了当前主节点并将备用节点提升为主节点。但是,由于未提供密码而无法连接到数据库,因此在新主节点的检查点阶段发生错误。与重新加入目标节点的复制连接也失败,系统正在等待之前的主节点重新连接到新的主节点。需要进一步调查以确定这些错误的原因。

暂无图片 评论
暂无图片 有用 2
打赏 0
hanwenzhi
2023-04-25
这是我每台机的密码文件 [pgsql@itpuxpg25:/postgresql/pgdata]$more ~/.pgpass #ip:port:db:user:pwd 192.168.101.24:5432:repmgr:repmgr:repmgr 192.168.101.25:5432:repmgr:repmgr:repmgr 192.168.101.26:5432:repmgr:repmgr:repmgr 192.168.101.27:5432:repmgr:repmgr:repmgr 这是我主库创建的数据库用户密码: createuser -s repmgr -h 127.0.0.1 createdb repmgr -O repmgr -h 127.0.0.1 psql -h 127.0.0.1 -c "alter user repmgr with password 'repmgr'" psql -h 127.0.0.1 -c "alter user repmgr set search_path to repmgr, \"\$user\",public" 不知道哪里还有问题,看不出来
回答交流
Markdown


请输入正文
提交
相关推荐
postgresql 必须禁用ipv6吗?
回答 2
没有必须禁用一说,一般情况下如果不使用ipv6,我们推荐设置listenaddresses'0.0.0.0'而不是设置为“”,这样PG不会监听ipv6。
list_agg --> stringagg
回答 2
这样写也许是可以的,但是至少需要对同一个表扫描2次,或者表自身关联,性能肯定会打折扣!还是希望有可以只扫描一次表就得到结果的方法,谢谢!
pg中为什么大量的逻辑读不好?怎么理解
回答 1
大量的全表扫描,全表扫描会带来大量的逻辑读的请求逻辑读更多引起latchlock,消耗CPU资源、性能损耗IO消耗负载较高。逻辑读buffer读物理读,无论大量的buffer读还是物理读,都会影响性能
pg中~表示啥意思?
回答 4
给你做个实验方便你理解:postgrescreatetablet1(namevarchar);CREATETABLEpostgresinsertintot1values(&x27;A&x27;);IN
pg_bulkload安装出错
回答 1
cannotfindlpam>找不到pam,缺少依赖包pamdevel
大家在运维postgresql过程中,用过什么工具呢?
回答 2
已采纳
pgAdmin、Navicat、DBeaver
从MSSQL 转postgreSQL 效率怎么样?
回答 1
PG15复杂查询我测试下来和MSSQL不相上下,有个别会慢一点,但是可以接受。但是测试环境并发小,不知道几百个客户端连接后的表现如何,不过我想应该没有问题。计划明年迁到PG16,主要是PG16有了双向
pg会自动analyze吗
回答 1
已采纳
会autovacuumanalyzethreshold:设置在一张表上触发analyze操作的最小更新或删除元组数,默认50autovacuumanalyzescalefactor:设置在一张表上触发
pg命令行中如何手动插入表情符号emoji的数据?
回答 2
可以用图形化工具里的psql,可以直接插入表情符号我本地pgadmin4以及pgadmin4唤起的psql测试截图图下:
postgresql的检查点刷新脏页面是通过bgwriter进行的吗?
回答 1
Yes,PostgreSQL中的检查点刷新脏页面是通过bgwriter(后台写入器)进行的。在PostgreSQL中,检查点是一个特定的点,所有之前的更改(包括数据和系统元数据)都被永久保存到磁盘中。
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~