PolarDB 开源基础教程系列 9 开源社区合作和共建

本文涉及的产品
云原生数据库 PolarDB PostgreSQL 版,标准版 2核4GB 50GB
云原生数据库 PolarDB MySQL 版,通用型 2核8GB 50GB
简介: 本文介绍了玩转 PolarDB 开源社区指南:如何搭建 PolarDB 开发环境及参与开源社区。主要内容:1. **搭建开发环境**:提供多种 Docker 镜像供开发者选择,支持 x86_64 和 ARM64 架构,适配 CentOS、Debian、Ubuntu 等多个 Linux 发行版。2. **编译与部署**:通过 Docker 容器克隆 PolarDB 源码并编译安装,支持构建一写多读集群测试 ePQ MPP 优化器功能。3. **参与开源社区**:介绍个人、生态伙伴和用户如何从社区中获取技能、建立连接、积累战绩并提升影响力。社区活动涵盖公开课、训练营、编程大赛、企业行等。

玩转 PolarDB 开源社区

本节阅读导航

1、搭建 PolarDB 开发环境

2、如何玩转 PolarDB 开源社区?

1、搭建 PolarDB 开发环境

参考:

在继续阅读之前, 你可以先阅读如下文章: 《PolarDB 100 问 | 如何构建PolarDB Docker镜像 OR 本地编译PolarDB?》

1、PolarDB开源社区提供了多种环境的Docker镜像作为开发环境供开发者选择.

支持的 CPU 架构包含:

linux/amd64(x86_64)  
linux/arm64

支持的 Linux 发行版包含:

CentOS 7  
Anolis 8  
Rocky 8  
Rocky 9
Debian 11
Debian 12
Ubuntu 20.04  
Ubuntu 22.04  
Ubuntu 24.04

通过如下方式即可拉取相应发行版的镜像:

docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:centos7  
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:anolis8  
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:rocky8  
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:rocky9
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:debian11  
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:debian12
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:ubuntu20.04  
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:ubuntu22.04  
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:ubuntu24.04

另外,也提供了构建上述开发镜像的 Dockerfile,您可以根据自己的需要在 Dockerfile 中添加更多依赖,然后构建自己的开发镜像。

2、搭建PolarDB开发环境, 在开发环境中通过源码编译安装PolarDB

拉取一个你熟悉的PolarDB开发环境Docker镜像, 例如

docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:ubuntu22.04

创建并运行容器

docker run -d -it -P --shm-size=1g --cap-add=SYS_PTRACE --cap-add SYS_ADMIN --privileged=true --name polardb_pg_devel registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:ubuntu22.04 bash

进入容器后,克隆PolarDB源码(根据需要选择对应的分支),编译部署 PolarDB-PG 实例。

# 进入容器
docker exec -ti polardb_pg_devel bash  
  
cd /tmp   
# 例如这里拉取 POLARDB_11_STABLE 分支; PS: 截止2024.9.24 PolarDB开源的最新分支为: POLARDB_15_STABLE  
git clone -c core.symlinks=true --depth 1 -b POLARDB_11_STABLE https://github.com/ApsaraDB/PolarDB-for-PostgreSQL 
cd /tmp/PolarDB-for-PostgreSQL  
./polardb_build.sh --without-fbl --debug=off  
  
# 验证PolarDB-PG  
psql -c 'SELECT version();'    
  
            version               
--------------------------------  
 PostgreSQL 11.9 (POLARDB 11.9)  
(1 row)
# 在容器内关闭、启动PolarDB数据库:   
pg_ctl stop -m fast -D ~/tmp_master_dir_polardb_pg_1100_bld     
pg_ctl start -D ~/tmp_master_dir_polardb_pg_1100_bld    
# 查看PolarDB的编译选项
pg_config
BINDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/bin
DOCDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/share/doc
HTMLDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/share/doc
INCLUDEDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/include
PKGINCLUDEDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/include
INCLUDEDIR-SERVER = /home/postgres/tmp_basedir_polardb_pg_1100_bld/include/server
LIBDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/lib
PKGLIBDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/lib
LOCALEDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/share/locale
MANDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/share/man
SHAREDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/share
SYSCONFDIR = /home/postgres/tmp_basedir_polardb_pg_1100_bld/etc
PGXS = /home/postgres/tmp_basedir_polardb_pg_1100_bld/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/home/postgres/tmp_basedir_polardb_pg_1100_bld' '--with-pgport=5432' '--with-openssl' '--with-libxml' '--with-perl' '--with-python' '--with-tcl' '--with-pam' '--with-gssapi' '--enable-nls' '--with-libxslt' '--with-ldap' '--with-uuid=e2fs' '--with-icu' '--with-llvm' 'CFLAGS=  -g -pipe -Wall -grecord-gcc-switches -I/usr/include/et -O3' 'LDFLAGS=-Wl,-rpath,'''/../lib'''' 'CXXFLAGS=-g -pipe -Wall -grecord-gcc-switches -I/usr/include/et -O3'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE -I/usr/include/libxml2
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation   -g -pipe -Wall -grecord-gcc-switches -I/usr/include/et -O3
CFLAGS_SL = -fPIC
LDFLAGS = -L ../../src/backend/polar_dma/libconsensus/polar_wrapper/lib -Wl,-rpath,'/../lib' -L/usr/lib/llvm-15/lib -Wl,--as-needed -Wl,-rpath,'/home/postgres/tmp_basedir_polardb_pg_1100_bld/lib',--enable-new-dtags
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -lreadline -lcrypt -lm 
VERSION = PostgreSQL 11.9
PX_VERSION_STR = PolarDB PX version 1.1

3、polardb_build.sh 构建选项说明

如无定制的需求,则可以按照下面给出的选项编译部署不同形态的 PolarDB-PG 集群并进行测试。

polardb_build.sh --help  
  
  This script is to be used to compile PG core source code (PG engine code without files within contrib and external)  
  It can be called with following options:  
  --basedir=<temp dir for PG installation>, specifies which dir to install PG to, note this dir would be cleaned up before being used  
  --datadir=<temp dir for databases>], specifies which dir to store database cluster, note this dir would be cleaned up before being used  
  --conf=<file path for postgresql.conf>, specifies the configure file to use  
  --user=<user to start PG>, specifies which user to run PG as  
  --port=<port to run PG on>, specifies which port to run PG on  
  --debug=[on|off], specifies whether to compile PG with debug mode (affecting gcc flags)  
  -c,--coverage, specifies whether to build PG with coverage option  
  --nc,--nocompile, prevents re-compilation, re-installation, and re-initialization  
  -t,-r,--regress, runs regression test after compilation and installation.  
  -m --minimal compile with minimal extention set  
  --withrep init the database with a hot standby replica  
  --withstandby init the database with a hot standby replica  
  --pg_bld_rep_port=<port to run PG rep on>, specifies which port to run PG replica on  
  --pg_bld_standby_port=<port to run PG standby on>, specifies which port to run PG standby on  
  --repdir=<temp dir for databases>], specifies which dir to store replica data, note this dir would be cleaned up before being used  
  --storage=localfs, specify storage type  
  -e,--extension, run extension test  
  --with-tde, TDE enable  
  --with-dma, DMA enable  
  --with-pfsd, PFSD enable  
  --fault-injector, faultinjector enable  
  --without-fbl, run without flashback log  
  --extra-conf, add an extra conf file  
  
  Please lookup the following secion to find the default values for above options.  
  
  Typical command patterns to kick off this script:  
  
  1) To just cleanup, re-compile, re-install and get PG restart:  
  polardb_build.sh  
  2) To run all steps included 1), as well as run the ALL regression test cases:  
  polardb_build.sh -t  
  3) To cleanup and re-compile with code coverage option:  
  polardb_build.sh -c  
  4) To run the tests besides 3).  
  polardb_build.sh -c -t  
  5) To run with specific port, user, and/or configuration file  
  polardb_build.sh --port=5501 --user=pg001 --conf=/root/data/postgresql.conf  
  6) To run on local pfs  
  polardb_build.sh --storage=localfs  
  7) To run with a replica (it also works with --storage=localfs)  
  polardb_build.sh --withrep  
  8) To run with a standby (it also works with --storage=localfs)  
  polardb_build.sh --withstandby  
  9) To run all the tests (make check)(include src/test,src/pl,src/interfaces/ecpg,contrib,external)  
  polardb_build.sh -r-check-all  
  10) To run all the tests (make installcheck)(include src/test,src/pl,src/interfaces/ecpg,contrib,external)  
  polardb_build.sh -r-installcheck-all

4、构建一写多读的PolarDB集群, 可以测试ePQ MPP优化器功能.

在一个新的容器中测试

# 创新容器, 名为polardb_pg_devel_epq  
docker run -d -it -P --shm-size=1g --cap-add=SYS_PTRACE --cap-add SYS_ADMIN --privileged=true --name polardb_pg_devel_epq registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_devel:ubuntu22.04 bash
# 进入容器
docker exec -ti polardb_pg_devel_epq bash
  
# 下载PolarDB代码  
cd /tmp  
git clone -c core.symlinks=true --depth 1 -b POLARDB_11_STABLE https://github.com/ApsaraDB/PolarDB-for-PostgreSQL  
cd /tmp/PolarDB-for-PostgreSQL    
  
# 编译PolarDB, 并初始化一写多读的PolarDB集群  
./polardb_build.sh --without-fbl --debug=off --withrep --initpx --storage=localfs  
      
# 检查集群状态  
psql  
  
psql (11.9)  
Type "help" for help.  
  
postgres=# select * from pg_stat_replication ;  
  pid  | usesysid | usename  | application_name | client_addr | client_hostname | client_port |         backend_start         | backend_xmin |   state   | sent_lsn  | write_lsn | flush_lsn | replay_lsn   
| write_lag | flush_lag | replay_lag | sync_priority | sync_state   
-------+----------+----------+------------------+-------------+-----------------+-------------+-------------------------------+--------------+-----------+-----------+-----------+-----------+------------  
+-----------+-----------+------------+---------------+------------  
 19713 |       10 | postgres | replica2         | 127.0.0.1   |                 |       45658 | 2024-09-25 10:16:17.738143+08 |              | streaming | 0/174FE60 | 0/174FE60 | 0/174FE60 | 0/174FE60    
|           |           |            |             0 | async  
 19334 |       10 | postgres | replica1         | 127.0.0.1   |                 |       59062 | 2024-09-25 10:16:15.719794+08 |              | streaming | 0/174FE60 | 0/174FE60 | 0/174FE60 | 0/174FE60    
|           |           |            |             1 | sync  
(2 rows)

测试epq, 参考如下文章“PolarDB/PostgreSQL TPCH测试”章节:

常见错误排查

1、如果在编译并启动PolarDB集群时报内存不足的错误, 可能是docker desktop的内存资源限制太少了, 可以修改一下(修改配置后需要重启docker daemon. 例如Linux: systemctl restart docker). 例如 16G内存的Mac我配置了limit 8G内存和4G swap. 配置请参考docker手册:

图形界面配置路径: Settings-Resources-Advanced-Memory/Swap

或者直接修改docker settings.json file at:

Mac: ~/Library/"Group Containers"/group.com.docker/settings.json
Windows: C:\Users\[USERNAME]\AppData\Roaming\Docker\settings.json
Linux: ~/.docker/desktop/settings.json

2、如果你是在宿主机clone的代码, 然后拷贝到容器内, 编译时可能遇到这样的错误:

In file included from ../../src/include/polar_dma/polar_dma.h:33,
                 from relpath.c:26:
../../src/include/polar_dma/polar_consensus_stats.h:1:1: error: expected identifier or ‘(’ before ‘.’ token
    1 | ../../backend/polar_dma/libconsensus/polar_wrapper/include/polar_consensus_stats.h
      | ^
In file included from relpath.c:26:
../../src/include/polar_dma/polar_dma.h:41:3: warning: data definition has no type or storage class
   41 | } ConsensusState;
      |   ^~~~~~~~~~~~~~
../../src/include/polar_dma/polar_dma.h:41:3: warning: type defaults to ‘int’ in declaration of ‘ConsensusState’ [-Wimplicit-int]
../../src/include/polar_dma/polar_dma.h:200:36: error: unknown type name ‘ConsensusMemberInfo’; did you mean ‘ConsensusProcInfo’?
  200 | extern void ConsensusGetMemberInfo(ConsensusMemberInfo *member_info);
      |                                    ^~~~~~~~~~~~~~~~~~~
      |                                    ConsensusProcInfo
../../src/include/polar_dma/polar_dma.h:201:36: error: unknown type name ‘ConsensusClusterInfo’; did you mean ‘ConsensusProcInfo’?
  201 | extern int ConsensusGetClusterInfo(ConsensusClusterInfo *cluster_info);
      |                                    ^~~~~~~~~~~~~~~~~~~~
      |                                    ConsensusProcInfo
../../src/include/polar_dma/polar_dma.h:202:35: error: unknown type name ‘ConsensusStatsInfo’; did you mean ‘ConsensusStats’?
  202 | extern void ConsensusGetStatsInfo(ConsensusStatsInfo *stats_info);
      |                                   ^~~~~~~~~~~~~~~~~~
      |                                   ConsensusStats
make[2]: *** [<builtin>: relpath.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:42: all-common-recurse] Error 2
make: *** [GNUmakefile:11: all-src-recurse] Error 2

在宿主机克隆代码时加上core.symlinks=true参数可以解决.

git clone -c core.symlinks=true --depth 1 -b POLARDB_11_STABLE https://github.com/ApsaraDB/PolarDB-for-PostgreSQL

2、如何玩转 PolarDB 开源社区?

PolarDB 开源社区是由PolarDB 数据库企业用户、PolarDB 生态伙伴、PolarDB 产品研发、开发者、学生、高校老师、合作协会、合作社区和媒体、资本等组成的一个大的社区组织. PolarDB 开源社区由理事会领导, 并代表社区群体共同利益. 通过社区运营, 将社区的个体紧密连接在一起, 在连接和碰撞中产生创新与价值. 所有参与开源社区的个人、企业或机构都能在开源社区贡献自己的力量, 并从开源社区获得自己所需要的价值.

个人参与社区可以总结为几个阶段, 分别获得技能、圈子连接、战绩、影响力, 详细参考: 《2024在华科分享的PPT: PostgreSQL深耕中国的技术洞察》

生态伙伴通过参与社区, 提升自身品牌影响力、获得潜在商机.

用户通过参与社区, 分享业务最佳实践、问题痛点, 获得行业影响力, 了解前沿技术和解决方案.

PolarDB 开源社区的活动和内容产出围绕社区群体价值展开. 下面列举一些例子, 如何玩转PolarDB 开源社区?

技能

  • 开源公开课, PolarDB开源社区会不定期邀请“PolarDB的资深技术专家、高校数据库专业领域老师、PolarDB MVP(数据库行业领袖)”共同打造高质量的开源数据库公开课, 帮助爱好者由浅入深体系化的了解PolarDB.
  • 开源训练营, 与公开课不同, 开源训练营通常是一周(每天45分钟)左右的课程, 训练营通常针对一个比较聚焦的内容进行讲解, 把场景讲深讲透.
  • 开源电子书, 一般由训练营、公开课等内容的讲师进行编制, 便于喜欢文字阅读学习的小伙伴使用.

视频链接:

技能、圈子连接

  • 高校PolarDB 开源工作室, 通过在各大高校开设PolarDB 开源工作室, 定期的公开课, 培训, 实验, 校企交流等活动, 帮助对数据库行业或技术感兴趣的同学提升技能, 获得认证, 同时尽早和企业、行业大咖建立连接, 提升就业率.

战绩

  • 开源人才认证, 针对PolarDB的开源人才认证, 帮助同学验证对PolarDB的掌握程度, 通过认证说明你掌握了该认证级别的PolarDB体系知识.
  • 编程大赛, 例如编程之夏, 开源之夏等编程大赛, PolarDB会作为数据库子赛道参与进去, 感兴趣的学生可以关注每年举办的大赛. 参与编程比赛可以提升自己的能力、就业竞争力、考研加分(取决于目标学校的政策)等.

技能、圈子连接、影响力

  • 企业行, 通过组织大型企业的深入交流, 了解行业需求和痛点, 建立开源生态企业、数据库专家、业务专家的深度交流机会, 共同解决企业或行业难题.
  • 沙龙, 通过组织线上/线下的活动沙龙, 搭台子建立用户、生态、数据库产品、资本等各方的资源连接, 充分沟通, 碰撞出商业机会, 技术创新点, 解决方案等. 同时通过优质的活动内容、热点信息等帮助社区/媒体类的伙伴提升流量.
  • PolarDB 开发者峰会, 沙龙通常以省会城市为单位开展, 辐射周边企业, 而PolarDB 开发者峰会是年度全国大会, 上千人规模. 新产品发布、前沿发展趋势、用户分享、伙伴分享、展厅、现场体验等, 融合了技术和商业会议的元素.
  • 博客, 钉钉、微信等实时交流社群, 建立实时交流的渠道, 有技术专家在里面可以回答各类数据库问题, 碰撞出好的行业解决方案. 帮助别人的同时提升自己或企业的影响力, 对于生态伙伴则能在其中发现商机.
  • PolarDB AI助理, 使用PolarDB 知识库、各类数据库及底层高质量语料对通用大模型进行微调, 提升AI机器人在数据库领域的专业性, 不仅能回答使用数据库的问题, 也能回答内核开发的问题.

战绩、影响力

  • PolarDB SIG/实习平台, PolarDB SIG是数据库的兴趣小组, 例如有安全小组、AI小组(例如pg4ml for PolarDB)、优化器、存储、FDW、高可用、ARM一体机等等方向的兴趣小组. 学生通过参与PolarDB SIG开源兴趣小组, 通过贡献文档、解决方案、代码、领实习任务等, 获得PolarDB开源贡献, 同时由机会获得PolarDB开源项目的实习证书.

其他参考:

相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
目录
打赏
0
4
5
0
20687
分享
相关文章
PolarDB开源数据库进阶课11 激活容灾(Standby)节点
本文介绍了如何激活PolarDB容灾(Standby)节点,实验环境依赖于Docker容器中用loop设备模拟共享存储。通过`pg_ctl promote`命令可以将Standby节点提升为主节点,使其能够接收读写请求。激活后,原Standby节点不能再成为PolarDB集群的Standby节点。建议删除对应的复制槽位以避免WAL文件堆积。相关操作和配置请参考系列文章及视频教程。
30 1
PolarDB开源数据库进阶课17 集成数据湖功能
本文介绍了如何在PolarDB数据库中接入pg_duckdb、pg_mooncake插件以支持数据湖功能, 可以读写对象存储的远程数据, 支持csv, parquet等格式, 支持delta等框架, 并显著提升OLAP性能。
33 0
PolarDB开源数据库进阶课15 集成DeepSeek等大模型
本文介绍了如何在PolarDB数据库中接入私有化大模型服务,以实现多种应用场景。实验环境依赖于Docker容器中的loop设备模拟共享存储,具体搭建方法可参考相关系列文章。文中详细描述了部署ollama服务、编译并安装http和openai插件的过程,并通过示例展示了如何使用这些插件调用大模型API进行文本分析和情感分类等任务。此外,还探讨了如何设计表结构及触发器函数自动处理客户反馈数据,以及生成满足需求的SQL查询语句。最后对比了不同模型的回答效果,展示了deepseek-r1模型的优势。
66 0
PolarDB开源数据库进阶课14 纯享单机版
PolarDB不仅支持基于“共享存储+多计算节点”的集群版,还提供类似开源PostgreSQL的单机版。单机版部署简单,适合大多数应用场景,并可直接使用PostgreSQL生态插件。通过Docker容器、Git克隆代码、编译软件等步骤,即可完成PolarDB单机版的安装与配置。具体操作包括启动容器、进入容器、克隆代码、编译软件、初始化实例、配置参数及启动数据库。此外,还有多个相关教程和视频链接供参考,帮助用户更好地理解和使用PolarDB单机版。
35 0
PolarDB开源数据库进阶课13 单机版转换为集群版
本文介绍如何将“本地存储实例”转换为“共享存储实例”,依赖于先前搭建的实验环境。主要步骤包括:准备PFS二进制文件、格式化共享盘为pfs文件系统、启动pfsd服务、停库并拷贝数据到pfs内、修改配置文件,最后启动实例。通过这些操作,成功实现了从本地存储到共享存储的转换,并验证了新实例的功能。相关系列文章和视频链接提供了更多背景信息和技术细节。
21 0
喜报|PolarDB开源社区荣获“2024数据库国内活跃开源项目”奖
喜报|PolarDB开源社区荣获“2024数据库国内活跃开源项目”奖
PolarDB开源数据库进阶课12 集群版转换为单机版
本文介绍了如何将“共享存储实例”转换为“本地存储实例”,实验环境依赖于Docker容器中的loop设备模拟共享存储。具体步骤包括准备本地目录、停库、拷贝数据、修改配置文件并启动实例。通过这些操作,可以实现从共享存储到本地存储的平滑转换。相关系列文章详细记录了PolarDB RAC一写多读集群的搭建与管理,提供了丰富的实战经验。
20 2
PolarDB开源数据库进阶课18 通过pg_bulkload适配pfs实现批量导入提速
本文介绍了如何修改 `pg_bulkload` 工具以适配 PolarDB 的 PFS(Polar File System),从而加速批量导入数据。实验环境依赖于 Docker 容器中的 loop 设备模拟共享存储。通过对 `writer_direct.c` 文件的修改,替换了一些标准文件操作接口为 PFS 对应接口,实现了对 PolarDB 15 版本的支持。测试结果显示,使用 `pg_bulkload` 导入 1000 万条数据的速度是 COPY 命令的三倍多。此外,文章还提供了详细的步骤和代码示例,帮助读者理解和实践这一过程。
36 0
PolarDB开源数据库进阶课16 接入PostGIS全功能及应用举例
本文介绍了如何在PolarDB数据库中接入PostGIS插件全功能,实现地理空间数据处理。此外,文章还提供了使用PostGIS生成泰森多边形(Voronoi diagram)的具体示例,帮助用户理解其应用场景及操作方法。
38 0
PolarDB开源数据库进阶课10 计算节点全毁, 灾难恢复
本文介绍了在PolarDB RAC一写多读集群中,当所有计算节点(主机)故障仅剩共享存储时的修复方法。实验基于Docker容器和loop设备模拟共享存储环境。通过重建计算节点、恢复PolarDB实例及配置相关参数,最终成功恢复RW和RO节点的功能,确保数据完整性和集群正常运行。视频回放可在B站和YouTube上查看。
28 0

相关产品

  • 云原生数据库 PolarDB