gpt4 book ai didi

postgresql - 用于 Postgresql 9.6 的 pgpool HA + repmgr

转载 作者:行者123 更新时间:2023-11-29 13:46:26 25 4
gpt4 key购买 nike

我正在尝试在我的 postgresql 环境(2 个 postgresql 服务器 + 1 个 pgpool)中配置 pgpool 以执行 HA,而 repmgr 负责复制。

我在日志中收到下一条消息:

017-12-03 19:27:07: pid 19033: DEBUG:  pool_flush_it: flush size: 0
2017-12-03 19:27:07: pid 19033: DEBUG: pool_read: read 103 bytes from backend 1
2017-12-03 19:27:07: pid 19033: ERROR: failed to authenticate
2017-12-03 19:27:07: pid 19033: DETAIL: password authentication failed for user "nobody"
2017-12-03 19:27:07: pid 19033: DEBUG: find_primary_node: no primary node found
2017-12-03 19:27:08: pid 19033: LOG: find_primary_node: checking backend no 0
2017-12-03 19:27:08: pid 19033: DEBUG: SSL is requested but SSL support is not available
2017-12-03 19:34:27: pid 22132: ERROR: unable to read data from DB node 1
2017-12-03 19:34:27: pid 22132: DETAIL: EOF encountered with backend
2017-12-03 19:28:27: pid 19033: DEBUG: find_primary_node: no primary node found

pool_hba.conf :

TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust

在 postgresql pg_hba.conf 中,我启用了来自 pgpool 服务器的连接:

####pgpool####
host all all 172.22.13.170/32 trust

1.可能是什么问题?

2.如果 repmgr 负责复制,我应该将参数 backend_flag 设置为 'DISALLOW_TO_FAILOVER' 吗?

谢谢。

最佳答案

我刚刚开始了解 repmgr 和 pgpool,但我认为这里有多个问题:

1) 你的 pgpool.conf 有一些默认的事件检查设置,并且用户是'nobody',所以要让它工作你需要用那个名字创建一个 pgsql 用户,这样 pgpool 可以查询所有主机找到当前的主人。

2) pgpool 执行脚本来更改哪个是主节点等,并且该脚本通常只运行 repmgr 命令以在故障转移时提升一个新的主节点,所以我认为不需要 DISALLOW_TO_FAILOVER。

如果 repmgr 会进行故障转移,那么你问题的第一个部分会让 pgpool 找到新的主服务器,但在那种情况下,我会让 repmgr 配置为不自动进行故障转移(因为他们可能会争论谁应该做什么。

关于postgresql - 用于 Postgresql 9.6 的 pgpool HA + repmgr,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47635551/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com