repmgr pg_rewind 失败,无法获取远程的 pg_control 文件。

huangapple go评论61阅读模式
英文:

repmgr pg_rewind failed with could not fetch pg_control remote file

问题

I'm testing repmgr to setup auto fail over and replication for postgreSQL cluster.

我正在测试repmgr以设置自动故障转移和PostgreSQL集群的复制。

So far I had reach the stage where I had successfully setup a 3-nodes cluster which consists of one primary and 2 standby. Fail over is a success in which I purposely down the primary node, and one of the standby node is successfully promoted to primary node automatically.

到目前为止,我已经成功地设置了一个由一个主节点和两个备用节点组成的三节点集群。故障转移成功,我故意关闭了主节点,一个备用节点成功自动晋升为主节点。

The prob starts when I want to sync back the failed primary node back to the cluster as standby node...

问题出现在我想将失败的主节点同步回集群作为备用节点时...

If I attempt to use node rejoin when postgres service is up, I will see these messages:

如果我在PostgreSQL服务运行时尝试使用node rejoin,我会看到以下消息:

ERROR: database is still running in state "in production"
HINT: "repmgr node rejoin" cannot be executed on a running node

错误:数据库仍处于“正在生产中”的状态
提示:无法在运行中的节点上执行“repmgr node rejoin”

Fair enough, but if I run node rejoin after I stop the postgres service, I get these instead:

还可以,但是如果我在停止PostgreSQL服务后运行node rejoin,我会得到以下消息:

ERROR: pg_rewind execution failed
DETAIL: pg_rewind: error: could not fetch remote file "global/pg_control": ERROR: permission denied for function pg_read_binary_file

错误:pg_rewind执行失败
详细信息:pg_rewind:错误:无法获取远程文件“global/pg_control”:错误:函数pg_read_binary_file的权限被拒绝

The postgreSQL version I using is 15 and repmgr version is 5.3.3

我使用的PostgreSQL版本是15,repmgr版本是5.3.3

Kindly help me on this. Thanks~

请帮助我解决这个问题。谢谢~

英文:

I'm testing repmgr to setup auto fail over and replication for postgreSQL cluster.

So far I had reach the stage where I had successfully setup a 3-nodes cluster which consists of one primary and 2 standby. Fail over is a success in which I purposely down the primary node, and one of the standby node is successfully promoted to primary node automatically.

The prob starts when I want to sync back the failed primary node back to the cluster as standby node...

If I attempt to use node rejoin when postgres service is up, I will see these messages:

ERROR: database is still running in state "in production"
HINT: "repmgr node rejoin" cannot be executed on a running node

Fair enough, but if I run node rejoin after I stop the postgres service, I get these instead:

ERROR: pg_rewind execution failed
DETAIL: pg_rewind: error: could not fetch remote file "global/pg_control": ERROR:  permission denied for function pg_read_binary_file

The postgreSQL version I using is 15 and repmgr version is 5.3.3

Kindly help me on this. Thanks~

答案1

得分: 1

"The documentation" 中文翻译:

> 连接必须是一个具备足够权限以执行 pg_rewind 在源服务器上使用的函数的普通(非复制)连接的角色(详见备注部分),或者是一个超级用户角色。

您用于复制的用户似乎不符合这些条件。

我不是一个 repmgr 专家,但我建议您在 conninfo 中使用一个超级用户,同时在 replication_user 中使用您的常规复制用户。

英文:

The documentation says:

> The connection must be a normal (non-replication) connection with a role having sufficient permissions to execute the functions used by pg_rewind on the source server (see Notes section for details) or a superuser role.

The user you are using for replication doesn't seem to meet these criteria.

I am not a repmgr expert, but I'd say that you should have a superuser in conninfo and your regular replication user in replication_user.

huangapple
  • 本文由 发表于 2023年5月22日 12:18:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76303017.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定