百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pg_easy_replicate

> 数据库
开源

轻松设置逻辑复制和切换到新数据库,停机时间最少

1.0K stars0 点赞3 次浏览
访问官网GitHub

工具介绍

轻松设置逻辑复制和切换到新数据库,停机时间最少

pg_easy_replicate 是一个 CLI 编排工具,可简化在两个 PostgreSQL 数据库之间设置 逻辑复制 的过程。pg_easy_replicate 还支持切换。在源(主数据库)完全复制后,pg_easy_replicate 将其置于只读模式,并通过逻辑复制将所有数据刷新到新的目标数据库。这样可确保零数据丢失和最小的应用程序停机时间。这种方法可用于执行最小的停机时间(最多 [-l

[ { "id": 1, "group_name": "cluster-1", "event_type": "ddl_command_end", "object_type": "table", "object_identity": "public.pgbench_accounts", "ddl_command": "ALTER TABLE public.pgbench_accounts ADD COLUMN test_column VARCHAR(255)", "created_at": "2024-08-31 15:42:33 UTC" } ]


#### Applying DDL Changes

`pg_easy_replicate` won't automatically apply the changes for you. To apply the tracked DDL changes to the target database:

bash $ pg_easy_replicate apply_ddl_change -g [-i]


If you specify a change ID with the `-i` option, only that specific change will be applied. If you don't specify an ID, you'll be prompted to apply all pending changes.

bash $ pg_easy_replicate apply_ddl_change -g cluster-1 将应用以下 DDL 更改: ID: 1, 类型: 表, 命令: ALTER TABLE public.pgbench_accounts ADD COLUMN test_column VARCHAR(255) ... 是否要应用所有这些更改?(y/n): y … 所有待处理的 DDL 更改均已成功应用。


### Stats

You can inspect or watch stats any time during the sync process. The stats give you an idea of when the sync started, current flush/write lag, how many tables are in `replicating`, `copying` or other stages, and more.

You can poll these stats to perform any other after the switchover is done. The stats include a `switchover_completed_at` which is updated once the switch over is complete.

bash $ pg_easy_replicate stats --group-name database-cluster-1 { "lag_stats": [ { "pid": 66, "cli

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyhacktoberfesthigh-availabilitylogical-replicationpostgres

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库