documentdb_distributed
DocumentDB多节点模式的API层
仓库
documentdb/documentdb
https://github.com/documentdb/documentdb
源码
documentdb-0.114-0.tar.gz
documentdb-0.114-0.tar.gz
概览
| 扩展包名 | 版本 | 分类 | 许可证 | 语言 |
|---|---|---|---|---|
documentdb | 0.114 | SIM | MIT | C |
| ID | 扩展名 | Bin | Lib | Load | Create | Trust | Reloc | 模式 |
|---|---|---|---|---|---|---|---|---|
| 9000 | documentdb | 否 | 是 | 是 | 是 | 否 | 否 | - |
| 9010 | documentdb_core | 否 | 是 | 是 | 是 | 否 | 否 | - |
| 9020 | documentdb_distributed | 否 | 是 | 是 | 是 | 否 | 否 | - |
| 9030 | documentdb_extended_rum | 否 | 是 | 是 | 是 | 否 | 是 | - |
| 相关扩展 | citus documentdb_core documentdb citus mongo_fdw plproxy postgres_fdw rum pg_jsonschema jsquery |
|---|
版本
| 类型 | 仓库 | 版本 | PG 大版本 | 包名 | 依赖 |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.114 | 1817161514 | documentdb | citus, documentdb_core, documentdb |
| RPM | PIGSTY | 0.114 | 1817161514 | documentdb_$v | postgresql$v-contrib, pg_cron_$v, pgvector_$v, rum_$v, postgis36_$v |
| DEB | PIGSTY | 0.114 | 1817161514 | postgresql-$v-documentdb | postgresql-$v-cron, postgresql-$v-pgvector, postgresql-$v-rum, postgresql-$v-postgis-3 |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| el8.aarch64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| el9.x86_64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| el9.aarch64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| el10.x86_64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| el10.aarch64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| d12.x86_64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| d12.aarch64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| d13.x86_64 | PGDG 0.114 | PGDG 0.114 | PGDG 0.114 | PGDG 0.114 | N/A |
| d13.aarch64 | PGDG 0.114 | PGDG 0.114 | PGDG 0.114 | PGDG 0.114 | N/A |
| u22.x86_64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| u22.aarch64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| u24.x86_64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| u24.aarch64 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | PIGSTY 0.114 | N/A |
| u26.x86_64 | PGDG 0.114 | PGDG 0.114 | PGDG 0.114 | PGDG 0.114 | N/A |
| u26.aarch64 | PGDG 0.114 | PGDG 0.114 | PGDG 0.114 | PGDG 0.114 | N/A |
构建
您可以使用 pig build 命令构建 documentdb 扩展的 RPM / DEB 包:
pig build pkg documentdb # 构建 RPM / DEB 包
安装
您可以直接安装 documentdb 扩展包的预置二进制包,首先确保 PGDG 和 PIGSTY 仓库已经添加并启用:
pig repo add pgsql -u # 添加仓库并更新缓存
使用 pig 或者是 apt/yum/dnf 安装扩展:
pig install documentdb; # 当前活跃 PG 版本安装
pig ext install -y documentdb -v 18 # PG 18
pig ext install -y documentdb -v 17 # PG 17
pig ext install -y documentdb -v 16 # PG 16
pig ext install -y documentdb -v 15 # PG 15
dnf install -y documentdb_18 # PG 18
dnf install -y documentdb_17 # PG 17
dnf install -y documentdb_16 # PG 16
dnf install -y documentdb_15 # PG 15
apt install -y postgresql-18-documentdb # PG 18
apt install -y postgresql-17-documentdb # PG 17
apt install -y postgresql-16-documentdb # PG 16
apt install -y postgresql-15-documentdb # PG 15
预加载配置:
shared_preload_libraries = 'citus, pg_documentdb, pg_documentdb_core';
创建扩展:
CREATE EXTENSION documentdb_distributed CASCADE; -- 依赖: citus, documentdb_core, documentdb
用法
来源:
documentdb_distributed 是 DocumentDB 的内部多节点执行层。它将公共 documentdb API 与 Citus 集成;它不是一个独立的文档 API,并不会增加单独的客户端工作流程。
先决条件和安装
所有节点需要匹配版本的 Citus、documentdb_core、documentdb 和 documentdb_distributed。官方助手会将库按预加载顺序放置;在更改后,请重启每个节点:
shared_preload_libraries = 'citus, pg_cron, pg_documentdb_core, pg_documentdb, pg_documentdb_distributed'
配置好 Citus 拓扑和基础 DocumentDB 堆栈之后,以超级用户身份安装分布式组件:
CREATE EXTENSION documentdb CASCADE;
CREATE EXTENSION documentdb_distributed;
SELECT extname, extversion
FROM pg_extension
WHERE extname IN ('citus', 'documentdb_core', 'documentdb', 'documentdb_distributed');
安装完成后可以使用正常的 DocumentDB 网关或 documentdb_api 函数。分布式的集合放置、分片拓扑、工作进程可用性以及元数据一致性必须作为集群部署的一部分进行管理。
重要边界
- 控制文件需要
citus、documentdb_core和documentdb,并标记该扩展为超级用户专用且不可重定位。 documentdb_distributed向现有的 DocumentDB 命令提供分布式规划和执行支持;它不是公共 API 扩展的替代品。- 在尝试升级扩展之前,发布版本应在协调器和工作进程之间保持同步。
- 备份、恢复、故障转移以及滚动升级流程必须包括 Citus 元数据和 DocumentDB 数据。
上游 packaging/README.md 明确指出标准包不包含 internal/pg_documentdb_distributed 组件。在添加到配置之前,请确认该分发实际包含了此扩展。版本 0.114-0 包含了一个后端特性标志下的分片 $sample 优化修复;不应将其视为无条件行为。