From e1127256f35bfed21e1b900f32373956914e6156 Mon Sep 17 00:00:00 2001
From: TomShawn <41534398+TomShawn@users.noreply.github.com>
Date: Wed, 1 Nov 2023 17:54:22 +0800
Subject: [PATCH 1/2] docs: add Linux complile guide
---
docs/cbdb-linux-compile.md | 250 ++++++++++++++++++
docs/cbdb-macos-compile.md | 2 +-
.../current/cbdb-linux-compile.md | 250 ++++++++++++++++++
.../current/cbdb-macos-compile.md | 2 +-
sidebars.js | 2 +-
5 files changed, 503 insertions(+), 3 deletions(-)
create mode 100644 docs/cbdb-linux-compile.md
create mode 100644 i18n/zh/docusaurus-plugin-content-docs/current/cbdb-linux-compile.md
diff --git a/docs/cbdb-linux-compile.md b/docs/cbdb-linux-compile.md
new file mode 100644
index 00000000000..c14ff8e6536
--- /dev/null
+++ b/docs/cbdb-linux-compile.md
@@ -0,0 +1,250 @@
+---
+title: On Linux
+---
+
+# Compile and Install Cloudberry Database on Linux
+
+:::info
+The source of this document is from the GitHub repository [`cloudberrydb/cloudberrydb`](https://github.com/cloudberrydb/cloudberrydb/blob/main/readmes/README.Linux.md).
+:::
+
+This document shares how to compile and install Cloudberry Database on Linux systems (CentOS 7, RHEL, and Ubuntu). Note that this document is for developers to try out Cloudberry Database in a single-node environments. DO NOT use this document for production environments.
+
+Take the following steps to compile and install Cloudberry Database:
+
+1. [Clone GitHub repo](#step-1-clone-github-repo).
+2. [Install dependencies](#step-2-install-dependencies).
+3. [Perform prerequisite platform tasks](#step-3-perform-prerequisite-platform-tasks).
+4. [Build Cloudberry Database](#step-4-build-cloudberry-database).
+5. [Verify the cluster](#step-5-verify-the-cluster).
+
+## Step 1. Clone GitHub repo
+
+Clone the GitHub repository `cloudberrydb/cloudberrydb` to the target machine:
+
+```shell
+git clone https://github.com/cloudberrydb/cloudberrydb.git
+```
+
+## Step 2. Install dependencies
+
+Enter the repository and install dependencies according to your operating systems:
+
+- [For CentOS 7](#for-centos-7)
+- [For RHEL 8 or Rocky Linux 8](#for-rhel-8-or-rocky-linux-8)
+- [For Ubuntu 18.04 or later](#for-ubuntu-1804-or-later)
+
+### For CentOS 7
+
+The following steps work on CentOS 7. For other CentOS versions, these steps might work but are not guaranteed to work.
+
+1. Run the Bash script `README.CentOS.bash` in the `readmes` directory of the `cloudberrydb/cloudberrydb` repository. To run this script, password is required. Then, some required dependencies will be automatically downloaded.
+
+ ```bash
+ cd cloudberrydb/readmes
+ ./README.CentOS.bash
+ ```
+
+2. Install additional packages required for configurations.
+
+ ```bash
+ yum -y install R apr apr-devel apr-util automake autoconf bash bison bison-devel bzip2 bzip2-devel centos-release-scl curl flex flex-devel gcc gcc-c++ git gdb iproute krb5-devel less libcurl libcurl-devel libevent libevent-devel libxml2 libxml2-devel libyaml libzstd-devel libzstd make openldap openssh openssh-clients openssh-server openssl openssl-devel openssl-libs perl python3-devel readline readline-devel rsync sed sudo tar vim wget which xerces-c-devel zip zlib && \
+ yum -y install epel-release
+ ```
+
+3. Update the GNU Compiler Collection (GCC) to version `devtoolset-10` to support C++ 14.
+
+ ```bash
+ yum install centos-release-scl
+ yum -y install devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-binutils
+ scl enable devtoolset-10 bash
+ source /opt/rh/devtoolset-10/enable
+ echo "source /opt/rh/devtoolset-10/enable" >> /etc/bashrc
+ source /etc/bashrc
+ gcc -v
+ ```
+
+4. Link cmake3 to cmake:
+
+ ```bash
+ sudo ln -sf /usr/bin/cmake3 /usr/local/bin/cmake
+ ```
+
+### For RHEL 8 or Rocky Linux 8
+
+1. Install Development Tools.
+
+ ```bash
+ sudo yum group install -y "Development Tools"
+ ```
+
+2. Install dependencies:
+
+ ```bash
+ sudo yum install -y epel-release
+
+ sudo yum install -y apr-devel bison bzip2-devel cmake3 flex gcc gcc-c++ krb5-devel libcurl-devel libevent-devel libkadm5 libxml2-devel libzstd-devel openssl-devel perl-ExtUtils-Embed python3-devel python3-pip readline-devel xerces-c-devel zlib-devel
+ ```
+
+3. Install more dependencies by running the `README.Rhel-Rocky.bash` script.
+
+ ```bash
+ ~/cloudberrydb/readmes/README.Rhel-Rocky.bash
+ ```
+
+### For Ubuntu 18.04 or later
+
+1. Install dependencies by running the `README.Ubuntu.bash` script in the `readmes` directory.
+
+ ```shell
+ ## You need to enter your password to run.
+ sudo ~/cloudberrydb/readmes/README.Ubuntu.bash
+ ```
+
+ :::info
+ - When you run the `README.Ubuntu.bash` script for dependencies, you will be asked to configure `realm` for Kerberos. You can enter any realm, because this is just for testing, and during testing, it will reconfigure a local server/client. If you want to skip this manual configuration, run `export DEBIAN_FRONTEND=noninteractive`.
+ - If the script fails to download packages, we recommend that you can try another one software source for Ubuntu.
+ :::
+
+2. Install GCC 10. Ubuntu 18.04 and later versions should use GCC 10 or newer:
+
+ ```bash
+ ## Install gcc-10
+ sudo apt install software-properties-common
+ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
+ sudo apt install gcc-10 g++-10
+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100
+ ```
+
+## Step 3. Perform prerequisite platform tasks
+
+After you have installed all the dependencies for your operating system, it is time to do some prerequisite platform tasks before you go on building Cloudberry Database. These operation include manually running `ldconfig` on all platforms, creating the `gpadmin` user, and setting up a password to start the Cloudberry Database and test.
+
+1. Make sure that you add `/usr/local/lib` and `/usr/local/lib64` to the `/etc/ld.so.conf` file.
+
+ ```bash
+ echo -e "/usr/local/lib \n/usr/local/lib64" >> /etc/ld.so.conf
+ ldconfig
+ ```
+
+2. Create the `gpadmin` user and set up the SSH key. Manually create SSH keys based on different operating systems, so that you can run `ssh localhost` without a password.
+
+ - For CentOS, RHEL, and Rocky Linux:
+
+ ```bash
+ useradd gpadmin # Creates gpadmin user
+ su - gpadmin # Uses the gpadmin user
+ ssh-keygen # Creates SSH key
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+ exit
+ ```
+
+ - For Ubuntu:
+
+ ```bash
+ useradd -r -m -s /bin/bash gpadmin # Creates gpadmin user
+ su - gpadmin # Uses the gpadmin user
+ ssh-keygen # Creates SSH key
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+ exit
+ ```
+
+## Step 4. Build Cloudberry Database
+
+After you have installed all the dependencies and performed the prerequisite platform tasks, you can start to build Cloudberry Database. Run the following commands in sequence.
+
+1. Configure the build environment. Enter the `cloudberrydb` directory and run the `configure` script.
+
+ ```bash
+ cd cloudberrydb
+ ./configure --with-perl --with-python --with-libxml --with-gssapi --prefix=/usr/local/cloudberrydb
+ ```
+
+ :::info
+ Cloudberry Database is built with GPORCA by default. If you want to build CBDB without GPORCA, add the `--disable-orca` flag in the `./configure` command.
+
+ ```bash
+ ./configure --disable-orca --with-perl --with-python --with-libxml --prefix=/usr/local/cloudberrydb
+ ```
+
+ :::
+
+2. Compile the code and install the database.
+
+ ```bash
+ make -j8
+ make -j8 install
+ ```
+
+3. Bring in the Greenplum environment for your running shell.
+
+ ```bash
+ cd ..
+ cp -r cloudberrydb/ /home/gpadmin/
+ cd /home/gpadmin/
+ chown -R gpadmin:gpadmin cloudberrydb/
+ su - gpadmin
+ cd cloudberrydb/
+ source /usr/local/cloudberrydb/greenplum_path.sh
+ ```
+
+4. Start the demo cluster.
+
+ - For CentOS:
+
+ ```bash
+ scl enable devtoolset-10 bash
+ source /opt/rh/devtoolset-10/enable
+ make create-demo-cluster
+ ```
+
+ - For Ubuntu, Rocky, and RHEL:
+
+ ```bash
+ make create-demo-cluster
+ ```
+
+5. Prepare the test by running the following command. This command will configure the port and environment variables for the test.
+
+ Environment variables such as `PGPORT` and `COORDINATOR_DATA_DIRECTORY` will be configured, which are the default port and the data directory of the coordinator node.
+
+ ```bash
+ source gpAux/gpdemo/gpdemo-env.sh
+ ```
+
+## Step 5. Verify the cluster
+
+1. You can verify whether the cluster has started successfully by running the following command. If successful, you might see multiple active `postgres` processes with ports ranging from `7000` to `7007`.
+
+ ```bash
+ ps -ef | grep postgres
+ ```
+
+2. Connect to the Cloudberry Database and see the active segment information by querying the system table `gp_segement_configuration`. For detailed description of this table, see the Greenplum document [here](https://docs.vmware.com/en/VMware-Greenplum/6/greenplum-database/ref_guide-system_catalogs-gp_segment_configuration.html).
+
+ ```sql
+ $ psql -p 7000 postgres
+ psql (14.4, server 14.4)
+ Type "help" for help.
+
+ postgres=# select version();
+ version
+ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ PostgreSQL 14.4 (Cloudberry Database 1.0.0+1c0d6e2224 build dev) on x86_64( GCC 13.2.0) 13.2.0, 64-bit compiled on Sep 22 2023 10:56:01
+ (1 row)
+
+ postgres=# select * from gp_segment_configuration;
+ dbid | content | role | preferred_role | mode | status | port | hostname | address | datadir | warehouseid
+ ------+---------+------+----------------+------+--------+------+------------+------------+------------------------------------------------------------------------------+-------------
+ 1 | -1 | p | p | n | u | 7000 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/qddir/demoDataDir-1 | 0
+ 8 | -1 | m | m | s | u | 7001 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/standby | 0
+ 3 | 1 | p | p | s | u | 7003 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast2/demoDataDir1 | 0
+ 6 | 1 | m | m | s | u | 7006 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast_mirror2/demoDataDir1 | 0
+ 2 | 0 | p | p | s | u | 7002 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast1/demoDataDir0 | 0
+ 5 | 0 | m | m | s | u | 7005 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast_mirror1/demoDataDir0 | 0
+ 4 | 2 | p | p | s | u | 7004 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast3/demoDataDir2 | 0
+ 7 | 2 | m | m | s | u | 7007 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast_mirror3/demoDataDir2 | 0
+ (8 rows)
+ ```
\ No newline at end of file
diff --git a/docs/cbdb-macos-compile.md b/docs/cbdb-macos-compile.md
index 1a91e18cd3d..55c1e04fa26 100644
--- a/docs/cbdb-macos-compile.md
+++ b/docs/cbdb-macos-compile.md
@@ -5,7 +5,7 @@ title: On macOS
# Compile and Install Cloudberry Database on macOS
:::info
-The source of this document is from [the document](https://github.com/cloudberrydb/cloudberrydb/blob/main/readmes/README.macOS.md) in the GitHub repository `cloudberrydb/cloudberrydb`.
+The source of this document is from the GitHub repository [`cloudberrydb/cloudberrydb`](https://github.com/cloudberrydb/cloudberrydb/blob/main/readmes/README.macOS.md).
:::
This document shares how to build, compile, and install Cloudberry Database on macOS (single node) for development and trial purposes. Follow the steps below.
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-linux-compile.md b/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-linux-compile.md
new file mode 100644
index 00000000000..654df140cf1
--- /dev/null
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-linux-compile.md
@@ -0,0 +1,250 @@
+---
+title: 在 Linux 上
+---
+
+# 在 Linux 系统上编译和安装 Cloudberry Database
+
+:::info
+本文档来自 GitHub 仓库 [`cloudberrydb/cloudberrydb`](https://github.com/cloudberrydb/cloudberrydb/blob/main/readmes/README.Linux.md).
+:::
+
+本文档分享如何在 Linux 系统(CentOS 7、RHEL 和 Ubuntu)上编译和安装 Cloudberry Database。请注意,本文档仅供开发人员在单节点环境中尝试 Cloudberry Database。**请勿将本文档用于生产环境**。
+
+按照以下步骤设置开发环境:
+
+1. [克隆 GitHub 仓库](#第-1-步克隆-github-仓库)。
+2. [安装依赖项](#第-2-步安装依赖项)。
+3. [执行平台准备工作](#第-3-步执行平台准备工作)。
+4. [构建 Cloudberry Database](#第-4-步构建-cloudberry-database)。
+5. [验证集群](#第-5-步验证集群)。
+
+## 第 1 步:克隆 GitHub 仓库
+
+将 GitHub 仓库 `cloudberrydb/cloudberrydb` 克隆到目标机器:
+
+```shell
+git clone https://github.com/cloudberrydb/cloudberrydb.git
+```
+
+## 第 2 步:安装依赖项
+
+进入仓库目录,根据你的操作系统安装依赖项:
+
+- [在 CentOS 7 上](#在-centos-7-上)
+- [在 RHEL 8 或 Rocky Linux 8 上](#在-rhel-8-或-rocky-linux-8-上)
+- [在 Ubuntu 18.04 或更新版本上](#在-ubuntu-1804-或更新版本上)
+
+### 在 CentOS 7 上
+
+以下步骤在 CentOS 7 上测试通过。对于其他版本的 CentOS,这些步骤可能有效,但不能保证有效。
+
+1. 执行 `cloudberrydb/cloudberrydb` 仓库下 `readmes` 目录中的 `README.CentOS.bash` 脚本。执行此脚本需要输入密码。然后,系统会自动下载一些必要的依赖项。
+
+ ```bash
+ cd cloudberrydb/readmes
+ ./README.CentOS.bash
+ ```
+
+2. 安装配置所需的其他包。
+
+ ```bash
+ yum -y install R apr apr-devel apr-util automake autoconf bash bison bison-devel bzip2 bzip2-devel centos-release-scl curl flex flex-devel gcc gcc-c++ git gdb iproute krb5-devel less libcurl libcurl-devel libevent libevent-devel libxml2 libxml2-devel libyaml libzstd-devel libzstd make openldap openssh openssh-clients openssh-server openssl openssl-devel openssl-libs perl python3-devel readline readline-devel rsync sed sudo tar vim wget which xerces-c-devel zip zlib && \
+ yum -y install epel-release
+ ```
+
+3. 将 GNU Compiler Collection (GCC) 更新到 `devtoolset-10` 版本,以支持 C++ 14。
+
+ ```bash
+ yum install centos-release-scl
+ yum -y install devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-binutils
+ scl enable devtoolset-10 bash
+ source /opt/rh/devtoolset-10/enable
+ echo "source /opt/rh/devtoolset-10/enable" >> /etc/bashrc
+ source /etc/bashrc
+ gcc -v
+ ```
+
+4. 将 cmake3 链接到 cmake:
+
+ ```bash
+ sudo ln -sf /usr/bin/cmake3 /usr/local/bin/cmake
+ ```
+
+### 在 RHEL 8 或 Rocky Linux 8 上
+
+1. 安装开发工具 Development Tools。
+
+ ```bash
+ sudo yum group install -y "Development Tools"
+ ```
+
+2. 安装依赖项。
+
+ ```bash
+ sudo yum install -y epel-release
+
+ sudo yum install -y apr-devel bison bzip2-devel cmake3 flex gcc gcc-c++ krb5-devel libcurl-devel libevent-devel libkadm5 libxml2-devel libzstd-devel openssl-devel perl-ExtUtils-Embed python3-devel python3-pip readline-devel xerces-c-devel zlib-devel
+ ```
+
+3. 执行 `README.Rhel-Rocky.bash` 脚本安装更多依赖项。
+
+ ```bash
+ ~/cloudberrydb/readmes/README.Rhel-Rocky.bash
+ ```
+
+### 在 Ubuntu 18.04 或更新版本上
+
+1. 执行 `readmes` 目录下的 `README.Ubuntu.bash` 脚本,以安装依赖项。
+
+ ```shell
+ # 执行该脚本需要输入密码。
+ sudo ~/cloudberrydb/readmes/README.Ubuntu.bash
+ ```
+
+ :::info 提示
+ - 当执行 `README.Ubutnu.bash` 脚本安装依赖项时,会提示你配置 Kerberos 的 `realm`。你可以输入任意 `realm`,因为这只是用于测试,而且在测试期间,系统会重新配置本地服务器/客户端。如果你想跳过此手动配置,请执行 `export DEBIAN_FRONTEND=noninteractive`。
+ - 如果脚本下载安装包失败,请尝试使用另一个 Ubuntu 软件源。
+ :::
+
+2. 安装 GCC 10。Ubuntu 18.04 及以上版本应当使用 GCC 10 或以上版本:
+
+ ```bash
+ # 安装 gcc-10
+ sudo apt install software-properties-common
+ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
+ sudo apt install gcc-10 g++-10
+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100
+ ```
+
+## 第 3 步:执行平台准备工作
+
+在操作系统上安装所有依赖项后,在构建 Cloudberry Database 之前你还需要执行一些平台准备工作。这些操作包括在平台上手动运行 `ldconfig`、创建 `gpadmin` 用户以及设置密码以启动 Cloudberry Database 并进行测试。
+
+1. 确保将 `/usr/local/lib` 和 `/usr/local/lib64` 添加到 `/etc/ld.so.conf` 文件中。
+
+ ```bash
+ echo -e "/usr/local/lib \n/usr/local/lib64" >> /etc/ld.so.conf
+ ldconfig
+ ```
+
+2. 创建 `gpadmin` 用户并设置 SSH 密钥。根据不同的操作系统手动创建 SSH 密钥,这样你就可以在不输入密码的情况下运行 `ssh localhost`。
+
+ - 在 CentOS、RHEL 和 Rocky Linux 上:
+
+ ```bash
+ useradd gpadmin # 创建 gpadmin 用户
+ su - gpadmin # 切换到 gpadmin 用户
+ ssh-keygen # 创建 SSH 密钥
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+ exit
+ ```
+
+ - 在 Ubuntu 上:
+
+ ```bash
+ useradd -r -m -s /bin/bash gpadmin # 创建 gpadmin 用户
+ su - gpadmin # 切换到 gpadmin 用户
+ ssh-keygen # 创建 SSH 密钥
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+ exit
+ ```
+
+## 第 4 步:构建 Cloudberry Database
+
+安装完所有依赖项并执行了平台准备工作后,你就可以开始构建 Cloudberry Database 了。按顺序执行以下命令。
+
+1. 进入 `cloudberrydb` 目录,执行 `configure` 脚本。
+
+ ```bash
+ cd cloudberrydb
+ ./configure --with-perl --with-python --with-libxml --with-gssapi --prefix=/usr/local/cloudberrydb
+ ```
+
+ :::info 提示
+ Cloudberry Database 默认使用 GPORCA 构建。如果你希望构建出不使用 GPORCA 的 Cloudberry Database,请在 `./configure` 命令中添加 `--disable-orca` 参数。
+
+ ```bash
+ ./configure --disable-orca --with-perl --with-python --with-libxml --prefix=/usr/local/cloudberrydb
+ ```
+
+ :::
+
+2. 编译源码并安装数据库。
+
+ ```bash
+ make -j8
+ make -j8 install
+ ```
+
+3. 将 Greenplum 环境引入运行中的 shell。
+
+ ```bash
+ cd ..
+ cp -r cloudberrydb/ /home/gpadmin/
+ cd /home/gpadmin/
+ chown -R gpadmin:gpadmin cloudberrydb/
+ su - gpadmin
+ cd cloudberrydb/
+ source /usr/local/cloudberrydb/greenplum_path.sh
+ ```
+
+4. 启动示例集群。
+
+ - 在 CentOS 上:
+
+ ```bash
+ scl enable devtoolset-10 bash
+ source /opt/rh/devtoolset-10/enable
+ make create-demo-cluster
+ ```
+
+ - 在 Ubuntu、Rocky、RHEL 上:
+
+ ```bash
+ make create-demo-cluster
+ ```
+
+5. 执行以下命令,以准备测试。此命令将为测试配置端口和环境变量。
+
+ 该命令会配置端口和环境变量,例如 `PGPORT`(主节点的默认端口)和 `COORDINATOR_DATA_DIRECTORY`(主节点的数据目录)。
+
+ ```bash
+ source gpAux/gpdemo/gpdemo-env.sh
+ ```
+
+## 第 5 步:验证集群
+
+1. 你可以通过以下命令来验证集群是否已成功启动。如果成功启动,你会看到端口在 `7000` 到 `7007` 之间的多个 `postgres` 进程。
+
+ ```bash
+ ps -ef | grep postgres
+ ```
+
+2. 连接至 Cloudberry Database,通过查询系统表 `gp_segement_configuration` 查看活跃 segment 的信息。有关此系统表的详细描述,参见 [Greenplum 文档](https://docs.vmware.com/en/VMware-Greenplum/7/greenplum-database/ref_guide-system_catalogs-gp_segment_configuration.html)。
+
+ ```sql
+ $ psql -p 7000 postgres
+ psql (14.4, server 14.4)
+ Type "help" for help.
+
+ postgres=# select version();
+ version
+ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ PostgreSQL 14.4 (Cloudberry Database 1.0.0+1c0d6e2224 build dev) on x86_64( GCC 13.2.0) 13.2.0, 64-bit compiled on Sep 22 2023 10:56:01
+ (1 row)
+
+ postgres=# select * from gp_segment_configuration;
+ dbid | content | role | preferred_role | mode | status | port | hostname | address | datadir | warehouseid
+ ------+---------+------+----------------+------+--------+------+------------+------------+------------------------------------------------------------------------------+-------------
+ 1 | -1 | p | p | n | u | 7000 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/qddir/demoDataDir-1 | 0
+ 8 | -1 | m | m | s | u | 7001 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/standby | 0
+ 3 | 1 | p | p | s | u | 7003 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast2/demoDataDir1 | 0
+ 6 | 1 | m | m | s | u | 7006 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast_mirror2/demoDataDir1 | 0
+ 2 | 0 | p | p | s | u | 7002 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast1/demoDataDir0 | 0
+ 5 | 0 | m | m | s | u | 7005 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast_mirror1/demoDataDir0 | 0
+ 4 | 2 | p | p | s | u | 7004 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast3/demoDataDir2 | 0
+ 7 | 2 | m | m | s | u | 7007 | i-6wvpa9wt | i-6wvpa9wt | /home/gpadmin/cloudberrydb/gpAux/gpdemo/datadirs/dbfast_mirror3/demoDataDir2 | 0
+ (8 rows)
+ ```
\ No newline at end of file
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-macos-compile.md b/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-macos-compile.md
index 03bf764ed1f..fe11e0e8390 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-macos-compile.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-macos-compile.md
@@ -5,7 +5,7 @@ title: 在 macOS 上
# 在 macOS 上编译和安装 Cloudberry Database
:::info 提示
-本文档来自 GitHub 仓库 [cloudberrydb/cloudberrydb](https://github.com/cloudberrydb/cloudberrydb/blob/main/readmes/README.macOS.md)。
+本文档来自 GitHub 仓库 [`cloudberrydb/cloudberrydb`](https://github.com/cloudberrydb/cloudberrydb/blob/main/readmes/README.macOS.md)。
:::
本文档分享了如何在 macOS 上(单节点)构建、编译和安装 Cloudberry Database 以供开发测试使用。请按照以下步骤操作。
diff --git a/sidebars.js b/sidebars.js
index 28bf336eeb7..7257162bfd3 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -29,7 +29,7 @@ const sidebars = {
{
type: 'category',
label: 'Build from Source Code',
- items: ['cbdb-macos-compile']
+ items: ['cbdb-macos-compile','cbdb-linux-compile']
},
{
type: 'category',
From 0829bf521586c9f2c04eb4b52754c32caca6415c Mon Sep 17 00:00:00 2001
From: TomShawn <41534398+TomShawn@users.noreply.github.com>
Date: Fri, 3 Nov 2023 14:58:09 +0800
Subject: [PATCH 2/2] add tab display to docs
---
docs/cbdb-linux-compile.md | 85 +++++++++++--------
.../current/cbdb-linux-compile.md | 85 +++++++++++--------
2 files changed, 100 insertions(+), 70 deletions(-)
diff --git a/docs/cbdb-linux-compile.md b/docs/cbdb-linux-compile.md
index c14ff8e6536..2f8c3513b0f 100644
--- a/docs/cbdb-linux-compile.md
+++ b/docs/cbdb-linux-compile.md
@@ -2,6 +2,9 @@
title: On Linux
---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
# Compile and Install Cloudberry Database on Linux
:::info
@@ -30,11 +33,8 @@ git clone https://github.com/cloudberrydb/cloudberrydb.git
Enter the repository and install dependencies according to your operating systems:
-- [For CentOS 7](#for-centos-7)
-- [For RHEL 8 or Rocky Linux 8](#for-rhel-8-or-rocky-linux-8)
-- [For Ubuntu 18.04 or later](#for-ubuntu-1804-or-later)
-
-### For CentOS 7
+
+
The following steps work on CentOS 7. For other CentOS versions, these steps might work but are not guaranteed to work.
@@ -70,7 +70,8 @@ The following steps work on CentOS 7. For other CentOS versions, these steps mig
sudo ln -sf /usr/bin/cmake3 /usr/local/bin/cmake
```
-### For RHEL 8 or Rocky Linux 8
+
+
1. Install Development Tools.
@@ -92,7 +93,8 @@ The following steps work on CentOS 7. For other CentOS versions, these steps mig
~/cloudberrydb/readmes/README.Rhel-Rocky.bash
```
-### For Ubuntu 18.04 or later
+
+
1. Install dependencies by running the `README.Ubuntu.bash` script in the `readmes` directory.
@@ -116,6 +118,9 @@ The following steps work on CentOS 7. For other CentOS versions, these steps mig
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100
```
+
+
+
## Step 3. Perform prerequisite platform tasks
After you have installed all the dependencies for your operating system, it is time to do some prerequisite platform tasks before you go on building Cloudberry Database. These operation include manually running `ldconfig` on all platforms, creating the `gpadmin` user, and setting up a password to start the Cloudberry Database and test.
@@ -129,27 +134,32 @@ After you have installed all the dependencies for your operating system, it is t
2. Create the `gpadmin` user and set up the SSH key. Manually create SSH keys based on different operating systems, so that you can run `ssh localhost` without a password.
- - For CentOS, RHEL, and Rocky Linux:
+
+
+
+ ```bash
+ useradd gpadmin # Creates gpadmin user
+ su - gpadmin # Uses the gpadmin user
+ ssh-keygen # Creates SSH key
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+ exit
+ ```
- ```bash
- useradd gpadmin # Creates gpadmin user
- su - gpadmin # Uses the gpadmin user
- ssh-keygen # Creates SSH key
- cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- chmod 600 ~/.ssh/authorized_keys
- exit
- ```
+
+
- - For Ubuntu:
+ ```bash
+ useradd -r -m -s /bin/bash gpadmin # Creates gpadmin user
+ su - gpadmin # Uses the gpadmin user
+ ssh-keygen # Creates SSH key
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+ exit
+ ```
- ```bash
- useradd -r -m -s /bin/bash gpadmin # Creates gpadmin user
- su - gpadmin # Uses the gpadmin user
- ssh-keygen # Creates SSH key
- cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- chmod 600 ~/.ssh/authorized_keys
- exit
- ```
+
+
## Step 4. Build Cloudberry Database
@@ -192,19 +202,24 @@ After you have installed all the dependencies and performed the prerequisite pla
4. Start the demo cluster.
- - For CentOS:
+
+
- ```bash
- scl enable devtoolset-10 bash
- source /opt/rh/devtoolset-10/enable
- make create-demo-cluster
- ```
+ ```bash
+ scl enable devtoolset-10 bash
+ source /opt/rh/devtoolset-10/enable
+ make create-demo-cluster
+ ```
- - For Ubuntu, Rocky, and RHEL:
+
+
+
+ ```bash
+ make create-demo-cluster
+ ```
- ```bash
- make create-demo-cluster
- ```
+
+
5. Prepare the test by running the following command. This command will configure the port and environment variables for the test.
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-linux-compile.md b/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-linux-compile.md
index 654df140cf1..f13a0fd4cda 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-linux-compile.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/cbdb-linux-compile.md
@@ -2,6 +2,9 @@
title: 在 Linux 上
---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
# 在 Linux 系统上编译和安装 Cloudberry Database
:::info
@@ -30,11 +33,8 @@ git clone https://github.com/cloudberrydb/cloudberrydb.git
进入仓库目录,根据你的操作系统安装依赖项:
-- [在 CentOS 7 上](#在-centos-7-上)
-- [在 RHEL 8 或 Rocky Linux 8 上](#在-rhel-8-或-rocky-linux-8-上)
-- [在 Ubuntu 18.04 或更新版本上](#在-ubuntu-1804-或更新版本上)
-
-### 在 CentOS 7 上
+
+
以下步骤在 CentOS 7 上测试通过。对于其他版本的 CentOS,这些步骤可能有效,但不能保证有效。
@@ -70,7 +70,8 @@ git clone https://github.com/cloudberrydb/cloudberrydb.git
sudo ln -sf /usr/bin/cmake3 /usr/local/bin/cmake
```
-### 在 RHEL 8 或 Rocky Linux 8 上
+
+
1. 安装开发工具 Development Tools。
@@ -92,7 +93,8 @@ git clone https://github.com/cloudberrydb/cloudberrydb.git
~/cloudberrydb/readmes/README.Rhel-Rocky.bash
```
-### 在 Ubuntu 18.04 或更新版本上
+
+
1. 执行 `readmes` 目录下的 `README.Ubuntu.bash` 脚本,以安装依赖项。
@@ -116,6 +118,9 @@ git clone https://github.com/cloudberrydb/cloudberrydb.git
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100
```
+
+
+
## 第 3 步:执行平台准备工作
在操作系统上安装所有依赖项后,在构建 Cloudberry Database 之前你还需要执行一些平台准备工作。这些操作包括在平台上手动运行 `ldconfig`、创建 `gpadmin` 用户以及设置密码以启动 Cloudberry Database 并进行测试。
@@ -129,27 +134,32 @@ git clone https://github.com/cloudberrydb/cloudberrydb.git
2. 创建 `gpadmin` 用户并设置 SSH 密钥。根据不同的操作系统手动创建 SSH 密钥,这样你就可以在不输入密码的情况下运行 `ssh localhost`。
- - 在 CentOS、RHEL 和 Rocky Linux 上:
+
+
+
+ ```bash
+ useradd gpadmin # 创建 gpadmin 用户
+ su - gpadmin # 切换到 gpadmin 用户
+ ssh-keygen # 创建 SSH 密钥
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+ exit
+ ```
- ```bash
- useradd gpadmin # 创建 gpadmin 用户
- su - gpadmin # 切换到 gpadmin 用户
- ssh-keygen # 创建 SSH 密钥
- cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- chmod 600 ~/.ssh/authorized_keys
- exit
- ```
+
+
- - 在 Ubuntu 上:
+ ```bash
+ useradd -r -m -s /bin/bash gpadmin # 创建 gpadmin 用户
+ su - gpadmin # 切换到 gpadmin 用户
+ ssh-keygen # 创建 SSH 密钥
+ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
+ chmod 600 ~/.ssh/authorized_keys
+ exit
+ ```
- ```bash
- useradd -r -m -s /bin/bash gpadmin # 创建 gpadmin 用户
- su - gpadmin # 切换到 gpadmin 用户
- ssh-keygen # 创建 SSH 密钥
- cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
- chmod 600 ~/.ssh/authorized_keys
- exit
- ```
+
+
## 第 4 步:构建 Cloudberry Database
@@ -192,19 +202,24 @@ git clone https://github.com/cloudberrydb/cloudberrydb.git
4. 启动示例集群。
- - 在 CentOS 上:
+
+
- ```bash
- scl enable devtoolset-10 bash
- source /opt/rh/devtoolset-10/enable
- make create-demo-cluster
- ```
+ ```bash
+ scl enable devtoolset-10 bash
+ source /opt/rh/devtoolset-10/enable
+ make create-demo-cluster
+ ```
- - 在 Ubuntu、Rocky、RHEL 上:
+
+
+
+ ```bash
+ make create-demo-cluster
+ ```
- ```bash
- make create-demo-cluster
- ```
+
+
5. 执行以下命令,以准备测试。此命令将为测试配置端口和环境变量。