Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion docs/guide/15-docker-deploy.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ cd ${SOURCECODE_PATH}/docker

Commands above will build `opentenbasebase` and `opentenbase` images.

Replace `SOURCECODE_PATH` with the path of your local clone of this repository, for example `/data/opentenbase/OpenTenBase`.

## 2.Start the example service and enter the CN contaioner

> **Note**: the directory `${SOURCECODE_PATH}/example/1c_2d_cluster` no longer exists on the current `master` branch, so the commands below cannot be run as written.
> Its `docker-compose.yaml`, `README` and `pgxc_conf/` were removed together with the whole `example/` tree, by commit
> [`aca7e2c`](https://github.com/OpenTenBase/OpenTenBase/commit/aca7e2c34a25e1480548a20dc7462612fb8a17f7) ("Update basecode version from 2.6.0 to 5.0.0") in the OpenTenBase repository.
> The only part still present in that repository is the image build path used in step 1 (`docker/buildImage.sh`).
>
> The cluster configuration template used by this example is still published in this repository:
> <https://github.com/OpenTenBase/docs/blob/main/docs/guide/pgxc_ctl_double.conf>.
> If you need the removed `docker-compose.yaml`, it can be retrieved from the revision just before the deletion:
> <https://github.com/OpenTenBase/OpenTenBase/tree/efc01b0c079f73900ab2a199c90ff04fe3ad6435/example/1c_2d_cluster> (historical file, no longer maintained).

```shell
cd ${SOURCECODE_PATH}/example/1c_2d_cluster
docker-compose up -d
Expand All @@ -39,12 +52,17 @@ cp ~/pgxc_conf/pgxc_ctl.conf ~/pgxc_ctl
Use `pgxc_ctl` for deployment. Avoid using commands like `ls` or `echo` after entering `pgxc_ctl`.
```shell
pgxc_ctl # This step will enter --home location, which is by default /home/$USER/pgxc_ctl. Type exit to exit or Ctrl + D
deploy all # This will use pgxc.conf located in /home/$USER/pgxc_ctl/pgxc.conf for deployment
deploy all # This will use /home/$USER/pgxc_ctl/pgxc_ctl.conf for deployment
init all

exit
```

The configuration file name read by `pgxc_ctl` is fixed to `pgxc_ctl.conf`, located in the directory given by `--home`
(`$HOME/pgxc_ctl` by default); see `contrib/pgxc_ctl/pgxc_ctl.h` (`DEFAULT_CONF_FILE_NAME`) and
`contrib/pgxc_ctl/pgxc_ctl.c` (`build_configuration_path()`) in the OpenTenBase repository.
The file copied in step 4 therefore **must not be renamed**; `pgxc.conf` is the configuration file of a different,
unrelated tool, `pgxc_ddl`.

## 5.Connect OpenTenbase using psql

Expand Down
19 changes: 18 additions & 1 deletion docs/guide/15-docker-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,20 @@ cd ${SOURCECODE_PATH}/docker

上述指令会构建`opentenbasebase`和 `opentenbase`两个镜像。

其中 `SOURCECODE_PATH` 请替换为本仓库在本机的克隆路径,例如 `/data/opentenbase/OpenTenBase`。

## 2.启动 example 服务,进入 opentenbaseCN 容器

> **注意**:`${SOURCECODE_PATH}/example/1c_2d_cluster` 目录在当前 `master` 分支上已不存在,因此下面这段命令目前无法执行。
> 该目录下的 `docker-compose.yaml`、`README` 和 `pgxc_conf/` 已随整个 `example/` 目录,在 OpenTenBase 仓库的提交
> [`aca7e2c`](https://github.com/OpenTenBase/OpenTenBase/commit/aca7e2c34a25e1480548a20dc7462612fb8a17f7)("Update basecode version from 2.6.0 to 5.0.0")中被移除。
> 目前仓库里保留的只有第 1 步的镜像构建路径(`docker/buildImage.sh`)。
>
> 本次示例使用的集群配置模板仍发布在本仓库中:
> <https://github.com/OpenTenBase/docs/blob/main/docs/guide/pgxc_ctl_double.conf>。
> 如果需要被移除的 `docker-compose.yaml`,可从删除前的历史版本获取:
> <https://github.com/OpenTenBase/OpenTenBase/tree/efc01b0c079f73900ab2a199c90ff04fe3ad6435/example/1c_2d_cluster>(历史文件,已不再维护)。

```shell
cd ${SOURCECODE_PATH}/example/1c_2d_cluster
docker-compose up -d
Expand All @@ -39,12 +52,16 @@ cp ~/pgxc_conf/pgxc_ctl.conf ~/pgxc_ctl
使用 `pgxc_ctl` 进行部署,使用`pgxc_ctl`之后,不要敲 `ls` ,`echo` 这种命令。
```shell
pgxc_ctl # 这一步会进入 --home 位置,默认是/home/$USER/pgxc_ctl, 使用exit退出,或者ctrl + D
deploy all # 会使用/home/$USER/pgxc_ctl/pgxc.conf 这个配置文件
deploy all # 会使用 /home/$USER/pgxc_ctl/pgxc_ctl.conf 这个配置文件
init all

exit
```

`pgxc_ctl` 读取的配置文件名固定为 `pgxc_ctl.conf`,位置为 `--home` 指定的目录(默认 `$HOME/pgxc_ctl`),
可参考 OpenTenBase 仓库中的 `contrib/pgxc_ctl/pgxc_ctl.h`(`DEFAULT_CONF_FILE_NAME`)和
`contrib/pgxc_ctl/pgxc_ctl.c`(`build_configuration_path()`)。
因此第 4 步复制过去的文件**无需改名**;`pgxc.conf` 是另一个独立工具 `pgxc_ddl` 的配置文件,请不要与它混淆。

## 5.使用psql连接OpenTenbase

Expand Down