Skip to content

Commit 2b4dc1e

Browse files
committed
Merge branch 'POLARDB_11_DEV' into POLARDB_11_STABLE
2 parents ffa2fa5 + 37be626 commit 2b4dc1e

34 files changed

+584
-129
lines changed

README-CN.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,12 @@ PolarDB for PostgreSQL 采用了基于 Shared-Storage 的存储计算分离架
5454

5555
## 快速部署
5656

57-
如果您已安装 Docker,那么可以从 DockerHub 上拉取 PolarDB for PostgreSQL 的 本地存储实例镜像,创建、运行并进入容器,然后直接使用 PolarDB 实例:
57+
如果您已安装 Docker,那么拉取 PolarDB-PG 的单机实例镜像,创建、运行并进入容器,然后直接使用 PolarDB-PG 实例:
5858

5959
```bash
60-
# 拉取单节点 PolarDB 镜像
61-
docker pull polardb/polardb_pg_local_instance
62-
# 创建运行并进入容器
63-
docker run -it --rm polardb/polardb_pg_local_instance psql
60+
# 拉取镜像并运行容器
61+
docker pull polardb/polardb_pg_local_instance:11
62+
docker run -it --rm polardb/polardb_pg_local_instance:11 psql
6463
# 测试实例可用性
6564
postgres=# SELECT version();
6665
version

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,12 @@ For more information, see [Architecture](https://apsaradb.github.io/PolarDB-for-
5454

5555
## Quick Start with PolarDB
5656

57-
If you have Docker installed already,then you can pull the instance image of PolarDB for PostgreSQL based on local storage. Create, run and enter the container, and use PolarDB instance directly:
57+
If you have Docker installed already,then you can pull the instance image of PolarDB-PG based on local storage. Create, run and enter the container, and use PolarDB-PG instance directly:
5858

5959
```bash
60-
# pull the instance image from DockerHub
61-
docker pull polardb/polardb_pg_local_instance
62-
# create, run and enter the container
63-
docker run -it --rm polardb/polardb_pg_local_instance psql
60+
# pull the instance image and run the container
61+
docker pull polardb/polardb_pg_local_instance:11
62+
docker run -it --rm polardb/polardb_pg_local_instance:11 psql
6463
# check
6564
postgres=# SELECT version();
6665
version

docs/.vuepress/configs/navbar/zh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const zh: NavbarConfig = [
2424
],
2525
},
2626
{
27-
text: "部署 PolarDB 数据库",
27+
text: "部署 PolarDB-PG 数据库",
2828
children: [
2929
"/zh/deploying/db-localfs.html",
3030
"/zh/deploying/db-pfs.html",

docs/.vuepress/configs/sidebar/zh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const zh: SidebarConfig = {
2828
],
2929
},
3030
{
31-
text: "部署 PolarDB 数据库",
31+
text: "部署 PolarDB-PG 数据库",
3232
children: [
3333
"/zh/deploying/db-localfs.md",
3434
"/zh/deploying/db-pfs.md",

docs/README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,28 @@ footer: Apache 2.0 Licensed | Copyright © Alibaba Group, Inc.
1111

1212
Pull the [local instance image](https://hub.docker.com/r/polardb/polardb_pg_local_instance/tags) of PolarDB for PostgreSQL based on local storage. Create and run the container, and try PolarDB-PG instance directly:
1313

14+
:::: code-group
15+
::: code-group-item DockerHub
16+
17+
```bash:no-line-numbers
18+
# pull the instance image and run the container
19+
docker pull polardb/polardb_pg_local_instance:11
20+
docker run -it --rm polardb/polardb_pg_local_instance:11 psql
21+
# check
22+
postgres=# SELECT version();
23+
version
24+
--------------------------------
25+
PostgreSQL 11.9 (POLARDB 11.9)
26+
(1 row)
27+
```
28+
29+
:::
30+
::: code-group-item Alibaba Cloud ACR
31+
1432
```bash:no-line-numbers
15-
# pull the instance image from DockerHub
16-
docker pull polardb/polardb_pg_local_instance
17-
# create and run the container
18-
docker run -it --rm polardb/polardb_pg_local_instance psql
33+
# pull the instance image and run the container
34+
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_local_instance:11
35+
docker run -it --rm registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_local_instance:11 psql
1936
# check
2037
postgres=# SELECT version();
2138
version
@@ -24,6 +41,9 @@ postgres=# SELECT version();
2441
(1 row)
2542
```
2643

44+
:::
45+
::::
46+
2747
<div class="features">
2848

2949
<div class="feature">

docs/deploying/db-localfs.md

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,25 @@ minute: 15
1414

1515
## 拉取镜像
1616

17-
我们在 DockerHub 上提供了 PolarDB-PG 的 [本地实例镜像](https://hub.docker.com/r/polardb/polardb_pg_local_instance/tags),里面已包含启动 PolarDB-PG 本地存储实例的入口脚本。镜像目前支持 `linux/amd64``linux/arm64` 两种 CPU 架构。
17+
我们已提供 PolarDB-PG 的 [单机实例镜像](https://hub.docker.com/r/polardb/polardb_pg_local_instance/tags),里面已包含启动 PolarDB-PG 单机实例的入口脚本。镜像目前支持 `linux/amd64``linux/arm64` 两种 CPU 架构。
18+
19+
:::: code-group
20+
::: code-group-item DockerHub
21+
22+
```bash:no-line-numbers
23+
docker pull polardb/polardb_pg_local_instance:11
24+
```
25+
26+
:::
27+
::: code-group-item 阿里云 ACR
1828

1929
```bash:no-line-numbers
20-
docker pull polardb/polardb_pg_local_instance
30+
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_local_instance:11
2131
```
2232

33+
:::
34+
::::
35+
2336
## 初始化数据库
2437

2538
新建一个空白目录 `${your_data_dir}` 作为 PolarDB-PG 实例的数据目录。启动容器时,将该目录作为 VOLUME 挂载到容器内,对数据目录进行初始化。在初始化的过程中,可以传入环境变量覆盖默认值:
@@ -30,32 +43,83 @@ docker pull polardb/polardb_pg_local_instance
3043

3144
使用如下命令初始化数据库:
3245

46+
:::: code-group
47+
::: code-group-item DockerHub
48+
49+
```bash:no-line-numbers
50+
docker run -it --rm \
51+
--env POLARDB_PORT=5432 \
52+
--env POLARDB_USER=u1 \
53+
--env POLARDB_PASSWORD=your_password \
54+
-v ${your_data_dir}:/var/polardb \
55+
polardb/polardb_pg_local_instance:11 \
56+
echo 'done'
57+
```
58+
59+
:::
60+
::: code-group-item 阿里云 ACR
61+
3362
```bash:no-line-numbers
3463
docker run -it --rm \
3564
--env POLARDB_PORT=5432 \
3665
--env POLARDB_USER=u1 \
3766
--env POLARDB_PASSWORD=your_password \
3867
-v ${your_data_dir}:/var/polardb \
39-
polardb/polardb_pg_local_instance \
68+
registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_local_instance:11 \
4069
echo 'done'
4170
```
4271

72+
:::
73+
::::
74+
4375
## 启动 PolarDB-PG 服务
4476

4577
数据库初始化完毕后,使用 `-d` 参数以后台模式创建容器,启动 PolarDB-PG 服务。通常 PolarDB-PG 的端口需要暴露给外界使用,使用 `-p` 参数将容器内的端口范围暴露到容器外。比如,初始化数据库时使用的是 `5432-5434` 端口,如下命令将会把这三个端口映射到容器外的 `54320-54322` 端口:
4678

79+
:::: code-group
80+
::: code-group-item DockerHub
81+
4782
```bash:no-line-numbers
4883
docker run -d \
4984
-p 54320-54322:5432-5434 \
5085
-v ${your_data_dir}:/var/polardb \
51-
polardb/polardb_pg_local_instance
86+
polardb/polardb_pg_local_instance:11
5287
```
5388

89+
:::
90+
::: code-group-item 阿里云 ACR
91+
92+
```bash:no-line-numbers
93+
docker run -d \
94+
-p 54320-54322:5432-5434 \
95+
-v ${your_data_dir}:/var/polardb \
96+
registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_local_instance:11
97+
```
98+
99+
:::
100+
::::
101+
54102
或者也可以直接让容器与宿主机共享网络:
55103

104+
:::: code-group
105+
::: code-group-item DockerHub
106+
56107
```bash:no-line-numbers
57108
docker run -d \
58109
--network=host \
59110
-v ${your_data_dir}:/var/polardb \
60-
polardb/polardb_pg_local_instance
111+
polardb/polardb_pg_local_instance:11
61112
```
113+
114+
:::
115+
::: code-group-item 阿里云 ACR
116+
117+
```bash:no-line-numbers
118+
docker run -d \
119+
--network=host \
120+
-v ${your_data_dir}:/var/polardb \
121+
registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_local_instance:11
122+
```
123+
124+
:::
125+
::::

docs/deploying/db-pfs-curve.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ minute: 15
1414

1515
## 源码下载
1616

17-
在前置文档中,我们已经从 DockerHub 上拉取了 PolarDB 开发镜像,并且进入到了容器中。进入容器后,从 [GitHub](https://github.com/ApsaraDB/PolarDB-for-PostgreSQL) 上下载 PolarDB for PostgreSQL 的源代码,稳定分支为 `POLARDB_11_STABLE`。如果因网络原因不能稳定访问 GitHub,则可以访问 [Gitee 国内镜像](https://gitee.com/mirrors/PolarDB-for-PostgreSQL)
17+
在前置文档中,我们已经从 DockerHub 上拉取了 PolarDB 开发镜像,并且进入到了容器中。进入容器后,从 [GitHub](https://github.com/ApsaraDB/PolarDB-for-PostgreSQL) 上下载 PolarDB for PostgreSQL 的源代码,稳定分支为 `POLARDB_11_STABLE`。如果因网络原因不能稳定访问 GitHub,则可以访问 [Gitee](https://gitee.com/mirrors/PolarDB-for-PostgreSQL)
1818

1919
:::: code-group
2020
::: code-group-item GitHub
@@ -24,7 +24,7 @@ git clone -b POLARDB_11_STABLE https://github.com/ApsaraDB/PolarDB-for-PostgreSQ
2424
```
2525

2626
:::
27-
::: code-group-item Gitee 国内镜像
27+
::: code-group-item Gitee
2828

2929
```bash:no-line-numbers
3030
git clone -b POLARDB_11_STABLE https://gitee.com/mirrors/PolarDB-for-PostgreSQL
@@ -50,7 +50,7 @@ cd PolarDB-for-PostgreSQL/
5050
```
5151

5252
::: warning
53-
上述脚本在编译完成后,会自动部署一个基于 **本地文件系统** 的实例,运行于 `5432` 端口上。
53+
上述脚本在编译完成后,会自动部署一个基于 **单机文件系统** 的实例,运行于 `5432` 端口上。
5454

5555
手动键入以下命令停止这个实例,以便 **在 PFS 和共享存储上重新部署实例**
5656

@@ -146,7 +146,7 @@ $HOME/tmp_basedir_polardb_pg_1100_bld/bin/psql \
146146
```
147147

148148
::: warning
149-
上述脚本在编译完成后,会自动部署一个基于 **本地文件系统** 的实例,运行于 `5432` 端口上。
149+
上述脚本在编译完成后,会自动部署一个基于 **单机文件系统** 的实例,运行于 `5432` 端口上。
150150

151151
手动键入以下命令停止这个实例,以便 **在 PFS 和共享存储上重新部署实例**
152152

docs/deploying/db-pfs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ minute: 15
88

99
<ArticleInfo :frontmatter=$frontmatter></ArticleInfo>
1010

11-
本文将指导您在分布式文件系统 PolarDB File System(PFS)上编译部署 PolarDB,适用于已经在共享存储上格式化并挂载 PFS 文件系统的计算节点。
11+
本文将指导您在分布式文件系统 PolarDB File System(PFS)上编译部署 PolarDB-PG,适用于已经在共享存储上格式化并挂载 PFS 文件系统的计算节点。
1212

1313
[[toc]]
1414

docs/deploying/deploy.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,11 @@ minute: 10
1414
2. **文件系统层**:由于 PostgreSQL 将数据存储在文件中,因此需要在块存储设备上架设文件系统。根据底层块存储设备的不同,可以选用单机文件系统(如 ext4)或分布式文件系统 [PolarDB File System(PFS)](https://github.com/ApsaraDB/PolarDB-FileSystem)
1515
3. **数据库层**:PolarDB for PostgreSQL 的编译和部署环境。
1616

17-
以下表格给出了三个层次排列组合出的的不同实践方式,其中的步骤包含:
18-
19-
- 存储层:块存储设备的准备
20-
- 文件系统:PolarDB File System 的编译、挂载
21-
- 数据库层:PolarDB for PostgreSQL 各集群形态的编译部署
22-
23-
我们强烈推荐使用发布在 DockerHub 上的 [PolarDB 开发镜像](https://hub.docker.com/r/polardb/polardb_pg_devel/tags) 来完成实践!开发镜像中已经包含了文件系统层和数据库层所需要安装的所有依赖,无需手动安装。
17+
以下表格给出了三个层次排列组合出的的不同实践方式:
2418

2519
| | 块存储 | 文件系统 |
2620
| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------- |
27-
| [实践 1(极简本地部署)](./db-localfs.md) | 本地 SSD | 本地文件系统(如 ext4) |
21+
| [实践 1(极简本地部署)](./db-localfs.md) | 本地 SSD | 单机文件系统(如 ext4) |
2822
| [实践 2(生产环境最佳实践)](./storage-aliyun-essd.md) <a href="https://developer.aliyun.com/live/249628"><Badge type="tip" text="视频" vertical="top" /></a> | 阿里云 ECS + ESSD 云盘 | PFS |
2923
| [实践 3(生产环境最佳实践)](./storage-curvebs.md) <a href="https://developer.aliyun.com/live/250218"><Badge type="tip" text="视频" vertical="top" /></a> | [CurveBS](https://opencurve.io/Curve/HOME) 共享存储 | [PFS for Curve](https://github.com/opencurve/PolarDB-FileSystem) |
3024
| [实践 4](./storage-ceph.md) | Ceph 共享存储 | PFS |

docs/deploying/fs-pfs.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,39 @@ PolarDB File System,简称 PFS 或 PolarFS,是由阿里云自主研发的高
1414

1515
## PFS 编译安装
1616

17-
推荐使用 [DockerHub](https://hub.docker.com/u/polardb) 上的 PolarDB for PostgreSQL [可执行文件镜像](https://hub.docker.com/r/polardb/polardb_pg_binary/tags),目前支持 `linux/amd64``linux/arm64` 两种架构,其中已经包含了编译完毕的 PFS 工具,无需手动编译安装。通过以下命令进入容器即可:
17+
推荐使用 PolarDB-PG 的 [可执行文件镜像](https://hub.docker.com/r/polardb/polardb_pg_binary/tags),目前支持 `linux/amd64``linux/arm64` 两种架构,其中已经包含了编译完毕的 PFS 工具,无需手动编译安装。通过以下命令进入容器即可:
18+
19+
:::: code-group
20+
::: code-group-item DockerHub
21+
22+
```shell:no-line-numbers
23+
docker pull polardb/polardb_pg_binary:11
24+
docker run -it \
25+
--cap-add=SYS_PTRACE \
26+
--privileged=true \
27+
--name polardb_pg \
28+
--shm-size=512m \
29+
polardb/polardb_pg_binary:11 \
30+
bash
31+
```
32+
33+
:::
34+
::: code-group-item 阿里云 ACR
1835

1936
```shell:no-line-numbers
20-
docker pull polardb/polardb_pg_binary
37+
docker pull registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_binary:11
2138
docker run -it \
2239
--cap-add=SYS_PTRACE \
2340
--privileged=true \
2441
--name polardb_pg \
2542
--shm-size=512m \
26-
polardb/polardb_pg_binary \
43+
registry.cn-hangzhou.aliyuncs.com/polardb_pg/polardb_pg_binary:11 \
2744
bash
2845
```
2946

47+
:::
48+
::::
49+
3050
PFS 的手动编译安装方式请参考 PFS 的 [README](https://github.com/ApsaraDB/polardb-file-system/blob/master/Readme-CN.md),此处不再赘述。
3151

3252
## 块设备重命名

0 commit comments

Comments
 (0)