Skip to content
Database

手动复制常见问题

Common questions and considerations when setting up manual replication.

应该使用哪个连接字符串? #

🌐 Which connection string should be used?

在逻辑复制时总是使用直接连接字符串。

🌐 Always use the direct connection string for logical replication.

通过像 Supavisor 这样的连接池器的连接是行不通的。

🌐 Connections through a pooler, such as Supavisor, will not work.

正在使用的工具不支持IPv6 #

🌐 The tool in use does not support IPv6

你可以为你的项目启用 IPv4 插件

🌐 You can enable the IPv4 add-on for your project.

XMIN 是什么,应该使用吗? #

🌐 What is XMIN and should it be used?

Xmin 是一种不同于逻辑复制的复制形式,只有在你的数据库不支持逻辑复制时(比如老版本的 Postgres)才应使用。

🌐 Xmin is a different form of replication from logical replication and should only be used if logical replication is not available for your database (i.e. older versions of Postgres).

Xmin 通过检查 xmin 系统列 来执行复制,并判断该行是否已经同步。

🌐 Xmin performs replication by checking the xmin system column and determining if that row has already been synchronized.

它不能捕捉数据的删除,不推荐使用,尤其是对于较大的数据库。

🌐 It does not capture deletion of data and is not recommended, particularly for larger databases.

可以在仪表板中配置复制吗? #

🌐 Can replication be configured in the Dashboard?

你可以在仪表板中查看发布物,但所有配置复制的步骤都必须使用SQL 编辑器或你选择的 CLI 工具完成。

🌐 You can view publications in the Dashboard but all steps to configure replication must be done using the SQL Editor or a CLI tool of your choice.

如何配置数据库以实现复制? #

🌐 How to configure database settings for replication?

使用 Supabase CLI,你可以配置数据库设置来优化它们以满足你的复制需求。这些值会根据你的数据库大小和活动情况有所不同。

🌐 Using the Supabase CLI, you can configure database settings to optimize them for your replication needs. These values can vary depending on your database size and activity.

有哪些重要的配置选项? #

🌐 What are some important configuration options?

一些比较重要的选项需要注意的是:

🌐 Some of the more important options to be aware of are:

  • max_wal_size - WAL 在自动检查点之间可以增长的最大大小
  • max_slot_wal_keep_size - 复制槽允许保留的 WAL 文件最大大小
  • wal_keep_size - 备用服务器要保留的最少过去 WAL 文件数量
  • max_wal_senders - 来自备用服务器或流备客户端的最大并发连接数

这些设置可以帮助确保你的复制槽不会耗尽空间,并且副本可以在不需要完全重新同步的情况下重新连接。

🌐 These settings help ensure your replication slots don't run out of space and that replicas can reconnect without requiring a full re-sync.