From 7914d33d1bc8d2df1ab50ac0f89cf6c86054b3f0 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Mon, 30 Oct 2023 18:02:26 +0800 Subject: [PATCH] Docs: update Linux build docs for Rocky and RHEL This PR updates the steps of building CBDB on Rocky and RHEL systems. In addition, this PR briefly adds links to README file. --- readmes/README.Linux.md | 89 +++++++++++++++++++---------------------- readmes/README.md | 19 ++------- 2 files changed, 46 insertions(+), 62 deletions(-) diff --git a/readmes/README.Linux.md b/readmes/README.Linux.md index edce1863b96..8221bc33be5 100644 --- a/readmes/README.Linux.md +++ b/readmes/README.Linux.md @@ -4,13 +4,13 @@ This document shares how to compile and install Cloudberry Database on Linux sys Take the following steps to set up the development environments: -1. [Clone GitHub repo](#step-1-clone-github-repo). +1. [Clone the GitHub repo](#step-1-clone-the-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 +## Step 1. Clone the GitHub repo Clone the GitHub repository `cloudberrydb/cloudberrydb` to the target machine: @@ -23,14 +23,14 @@ 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 7 and 8](#for-rhel-7-and-8) +- [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 dependencies work on CentOS 7. For other CentOS versions, these steps might work but are not guaranteed to work. +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. +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 @@ -62,58 +62,45 @@ The following dependencies work on CentOS 7. For other CentOS versions, these st sudo ln -sf /usr/bin/cmake3 /usr/local/bin/cmake ``` -### For RHEL 7 and 8 +### For RHEL 8 or Rocky Linux 8 1. Install Development Tools. - - For RHEL 8: Install: - - ```bash - sudo yum group install -y "Development Tools" - ``` - - - For RHEL versions (< 8.0): - - ```bash - sudo yum-config-manager --enable rhui-REGION-rhel-server-rhscl - sudo yum install -y devtoolset-7-toolchain - ``` + ```bash + sudo yum group install -y "Development Tools" + ``` -2. Install dependencies by running the `README.CentOS.bash` script. +2. Install dependencies: - - For RHEL 8: + ```bash + sudo yum install -y epel-release - ```bash - # This makes sure that git and make is installed. - # Then run the README.CentOS.bash script in the `readmes` directory. - ./README.CentOS.bash - ``` + 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 + ``` - - For RHEL 7: +3. Install more dependencies by running the `README.Rhel-Rocky.bash` script. - ```bash - # First install the epel extension for RHEL 7. - # This makes sure that git and make is installed. - ./README.CentOS.bash - ``` + ```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 ./README.Ubuntu.bash + # You need to enter your password to run. + sudo ~/cloudberrydb/readmes/README.Ubuntu.bash ``` > [!Note] - > - 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 you fail to download packages, we recommend that you can try another one software source for Ubuntu. + > - 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: +2. Install GCC 10. Ubuntu 18.04 and later versions should use GCC 10 or later: ```bash - ## Install gcc-10 + # 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 @@ -122,7 +109,7 @@ The following dependencies work on CentOS 7. For other CentOS versions, these st ## 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. +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 operations include manually running `ldconfig`, 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. @@ -133,7 +120,7 @@ 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 7: + - For CentOS, RHEL, and Rocky Linux: ```bash useradd gpadmin # Creates gpadmin user @@ -192,15 +179,23 @@ After you have installed all the dependencies and performed the prerequisite pla source /usr/local/cloudberrydb/greenplum_path.sh ``` -5. Start the demo cluster. +4. Start the demo cluster. - ```bash - scl enable devtoolset-10 bash - source /opt/rh/devtoolset-10/enable - make create-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 + ``` -6. Prepare the test by running the following command. This command will configure the port and environment variables for the test. +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 `MASTER_DATA_DIRECTORY` will be configured, which are the default port and the data directory of the master node. @@ -210,7 +205,7 @@ After you have installed all the dependencies and performed the prerequisite pla ## Step 5. Verify the cluster -1. You can verify whether the cluster has started successfully by running the following command. You might see many active `postgres` processes with ports ranging from `7000` to `7007`. +1. You can verify whether the cluster has started successfully by running the following command. If successful, you can see multiple active `postgres` processes with ports ranging from `7000` to `7007`. ```bash ps -ef | grep postgres diff --git a/readmes/README.md b/readmes/README.md index 7e552342415..a02926fa43e 100644 --- a/readmes/README.md +++ b/readmes/README.md @@ -1,23 +1,12 @@ -This guide shows how to build Cloudberry Database with GPORCA. +# Build Cloudberry Database from Source Code -# Building Cloudberry Database with GPORCA +This guides describes how to build Cloudberry Database from source code. -GPORCA is a cost-based optimizer which is used by Greenplum -Database/Cloudberry Database in conjunction with the PostgreSQL -planner. It is also known as just ORCA, and Pivotal Optimizer. The -code for GPORCA resides src/backend/gporca. It is built automatically -by default. - -## Installing dependencies - -Please follow these steps for your OS to get your system ready. - -- for macOS developers: Follow [these macOS steps](README.macOS.md) -- for Linux developers: Follow [appropriate Linux - steps](README.Linux.md) including CentOS, RHEL, Ubuntu +- For building on Linux systems, see [Compile and Install Cloudberry Database on Linux](/readmes/README.Linux.md). +- For building on macOS system, see [Compile and Install Cloudberry Database on macOS](/readmes/README.macOS.md). ## Build the database