获取错误:复制插槽 ‘slot_name’ 不存在

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

Getting ERROR: replication slot 'slot_name' does not exist

问题

我正在尝试在PostgreSQL数据库之间使用Apache Age设置数据复制,但是出现了这样的错误消息:"复制槽 'slot_name' 不存在"。

我原本希望主数据库的复制槽已经建立并准备好进行复制。

英文:

I'm trying to set up data replication between PostgreSQL databases using Apache Age and I am getting an error message like this: "replication slot 'slot_name' does not exist".

I was expecting the primary database's replication slot to be established and ready for replication.

答案1

得分: 1

错误消息如下:"复制插槽 'slot_name' 不存在",这表示主数据库中不存在该复制插槽。

因此,您需要运行以下命令来创建复制插槽:

pg_create_physical_replication_slot('slot_name');
英文:

The error message like this: "replication slot 'slot_name' does not exist" is telling that the replication slot is not present in the primary database.

So you need to run this command for creating the replication slot:

pg_create_physical_replication_slot('slot_name');

答案2

得分: 0

为了复制和负载平衡,Apache-age 提供了对 Pgpool-II(AGEHA) 的定制支持,@repo: https://github.com/apache/age/tree/AGEHA
您可以使用它来复制查询和负载平衡。
您可以按照将PostgreSQL连接到pgpool-II的传统程序进行操作。

英文:

For replication and load balancing, Apache-age offers the customized support of Pgpool-II(AGEHA), @repo: https://github.com/apache/age/tree/AGEHA,
You can use this for replication of queries, and load balancing.
You can follow the conventional procedure of connecting Postgresql to pgpool-II.

答案3

得分: 0

如果您遇到此问题,那是因为尚未创建复制槽或数据库中不存在该槽。请确保已在PostgreSQL中创建了复制槽。
您可以使用以下命令在主数据库上创建复制槽。

SELECT pg_create_physical_replication_slot('slot_name');

将槽名称替换为您所需的槽名称。创建复制槽后,您可以继续进行数据复制,而不会遇到此错误。

英文:

If you are facing such an issue, it is because the replication slot has not been created or the slot doesn't exist in the database. Make sure you have created the replication slot in PostgreSQL.
You can use the below command to create a replication slot on the primary database.

SELECT pg_create_physical_replication_slot('slot_name');

Replace the slot name with your desired slot name. After creating the replication slot, you can proceed to data replication without facing such an error.

答案4

得分: 0

有一些步骤要按照它们进行:

  1. 检查复制插槽是否存在:SELECT slot_name FROM pg_replication_slots;

  2. 如果复制插槽不存在,则创建一个:SELECT pg_create_physical_replication_slot('slot_name');

英文:

There are certain steps follow them:

  1. To check if the replication slot exists: SELECT slot_name FROM pg_replication_slots;

  2. If the replication slot does not exist create one: SELECT pg_create_physical_replication_slot('slot_name');

答案5

得分: 0

这个错误很可能是因为复制槽没有被创建,或者在数据库中不存在该槽。
要创建它,请使用以下命令:

SELECT pg_create_physical_replication_slot ('slot_name');

将 slot_name 更改为您想要的名称,这将解决您的错误。

如果这不起作用,还有其他方法可以解决:

其中一种方法是配置 PostgreSQL 进行持续归档,并提供一个 restore_command,以便副本可以访问归档。

英文:

This error is likely because the replication slot has not been created or the slot does not exist in the database.
To create use following command:

SELECT pg_create_physical_replication_slot ('slot_name');

Change the slot_name with name you want to give and this solves your error.

If this not works, There are alternative ways to do that:

One of the way is configure PostgreSQL with continuous archiving and provide a restore_command to give the replica access to the archive.

huangapple
  • 本文由 发表于 2023年6月16日 02:45:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76484654.html
匿名

发表评论

匿名网友

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

确定