diff --git a/versioned_docs/version-2.x/build/build-based-on-docker.md b/versioned_docs/version-2.x/build/build-based-on-docker.md index 4fd74f4c536..f63e5594e96 100644 --- a/versioned_docs/version-2.x/build/build-based-on-docker.md +++ b/versioned_docs/version-2.x/build/build-based-on-docker.md @@ -27,13 +27,27 @@ docker run --name cbdb-dev -it --rm -h cdw --shm-size=2gb apache/incubator-cloud docker run --name cbdb-dev -it --rm -h cdw --shm-size=2gb apache/incubator-cloudberry:cbdb-build-rocky9-latest ``` + +```bash +docker run --name cbdb-dev -it --rm -h cdw --shm-size=2gb apache/incubator-cloudberry:cbdb-build-rocky10-latest +``` + ```bash docker run --name cbdb-dev -it --rm -h cdw --shm-size=2gb apache/incubator-cloudberry:cbdb-build-ubuntu22.04-latest ``` + +```bash +docker run --name cbdb-dev -it --rm -h cdw --shm-size=2gb apache/incubator-cloudberry:cbdb-build-ubuntu24.04-latest +``` + +:::note +Rocky Linux 10 and Ubuntu 24.04 are supported starting from Apache Cloudberry 2.2. +::: + Explaination: - `--name=cbdb-dev` will set the name of the container to `cbdb-dev`. You can change it to any name you prefer. - `-it` will run the container in interactive mode, allowing you to execute commands inside it. @@ -114,6 +128,10 @@ cd /home/gpadmin/cloudberry export SRC_DIR=/home/gpadmin/cloudberry mkdir -p ${SRC_DIR}/build-logs +# Since Cloudberry 2.2 +# Pre-stage the Python packages for `--with-pythonsrc-ext` before building +make -C gpMgmt/bin download-python-deps + ## Configure, build, and install Cloudberry ./devops/build/automation/cloudberry/scripts/configure-cloudberry.sh ./devops/build/automation/cloudberry/scripts/build-cloudberry.sh diff --git a/versioned_docs/version-2.x/build/configure.md b/versioned_docs/version-2.x/build/configure.md index 60a734d3121..6fcc6905b93 100644 --- a/versioned_docs/version-2.x/build/configure.md +++ b/versioned_docs/version-2.x/build/configure.md @@ -5,6 +5,33 @@ title: Configure Apache Cloudberry Build import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; +## Pre-stage the Python packages for `--with-pythonsrc-ext` + +:::note +This step is only required starting from Apache Cloudberry 2.2. +::: + +The Python source packages used by `--with-pythonsrc-ext` are not bundled in the repository. They have been removed since Apache Cloudberry 2.0 to comply with the Apache release policy, and used to be downloaded on the fly during the build. Starting from Apache Cloudberry 2.2, they are downloaded ahead of the build instead, so pre-stage them before you run `configure`. + +Building PyYAML requires Cython earlier than 3.0. On Ubuntu, install the matching distribution package first: + +```bash +# For Ubuntu 22.04, cython3 is 0.29.x +sudo apt install -y cython3 + +# For Ubuntu 24.04, cython3 is 3.x and cannot build PyYAML, so use cython3-legacy instead +sudo apt install -y cython3-legacy +``` + +On Rocky Linux 8 and 9, `python3-Cython` has already been installed in [Install required packages](./install-required-packages). On Rocky Linux 10, the distribution only ships Cython 3.x, so the following command installs a compatible version through `pip3` for you. + +Then download the packages: + +```bash +cd ~/cloudberry +make -C gpMgmt/bin download-python-deps +``` + ## Configure the build process @@ -28,6 +55,44 @@ sudo chown -R gpadmin:gpadmin /usr/local/cloudberry-db The `configure` command sets up the build environment for Apache Cloudberry. This configuration includes several development features and extensions. +:::note +Starting from Apache Cloudberry 2.2, new extensions are available, including `diskquota`, `gp_stats_collector`, and `yezzey`. Use the corresponding `configure` options to enable them. +::: + + + +```bash +cd ~/cloudberry +export LD_LIBRARY_PATH=/usr/local/cloudberry-db/lib:${LD_LIBRARY_PATH:-""} +./configure --prefix=/usr/local/cloudberry-db \ + --disable-external-fts \ + --enable-gpcloud \ + --enable-ic-proxy \ + --enable-mapreduce \ + --enable-orafce \ + --enable-orca \ + --enable-pax \ + --disable-pxf \ + --enable-tap-tests \ + --with-diskquota \ + --with-gp-stats-collector \ + --with-gssapi \ + --with-ldap \ + --with-libxml \ + --with-lz4 \ + --with-pam \ + --with-perl \ + --with-pgport=5432 \ + --with-python \ + --with-pythonsrc-ext \ + --with-ssl=openssl \ + --with-uuid=e2fs \ + --with-yezzey \ + --with-includes=/usr/local/xerces-c/include \ + --with-libraries=/usr/local/cloudberry-db/lib +``` + + ```bash cd ~/cloudberry export LD_LIBRARY_PATH=/usr/local/cloudberry-db/lib:${LD_LIBRARY_PATH:-""} @@ -56,7 +121,9 @@ export LD_LIBRARY_PATH=/usr/local/cloudberry-db/lib:${LD_LIBRARY_PATH:-""} --with-libraries=/usr/local/cloudberry-db/lib ``` - + + + ### Prepare environment @@ -73,6 +140,12 @@ sudo chown -R gpadmin:gpadmin /usr/local/cloudberry-db The `configure` command sets up the build environment for Apache Cloudberry. This configuration includes several development features and extensions. +:::note +Starting from Apache Cloudberry 2.2, new extensions are available, including `diskquota`, `gp_stats_collector`, and `yezzey`. Use the corresponding `configure` options to enable them. +::: + + + ```bash cd ~/cloudberry ./configure --prefix=/usr/local/cloudberry-db \ @@ -85,6 +158,8 @@ cd ~/cloudberry --enable-pax \ --disable-pxf \ --enable-tap-tests \ + --with-diskquota \ + --with-gp-stats-collector \ --with-gssapi \ --with-ldap \ --with-libxml \ @@ -96,9 +171,39 @@ cd ~/cloudberry --with-pythonsrc-ext \ --with-ssl=openssl \ --with-uuid=e2fs \ + --with-yezzey \ --with-includes=/usr/include/xercesc ``` + +```bash +cd ~/cloudberry +./configure --prefix=/usr/local/cloudberry-db \ + --disable-external-fts \ + --enable-gpcloud \ + --enable-ic-proxy \ + --enable-mapreduce \ + --enable-orafce \ + --enable-orca \ + --enable-pax \ + --disable-pxf \ + --enable-tap-tests \ + --with-gssapi \ + --with-ldap \ + --with-libxml \ + --with-lz4 \ + --with-pam \ + --with-perl \ + --with-pgport=5432 \ + --with-python \ + --with-pythonsrc-ext \ + --with-ssl=openssl \ + --with-uuid=e2fs \ + --with-includes=/usr/include/xercesc +``` + + + ## `configure` options @@ -144,3 +249,6 @@ Also, some packages names vary between different Linux distributions. | `--with-libxml` | Build with libxml2, enabling SQL/XML support.|This requires libxml2 to be installed.| | `--with-lz4` | Build with LZ4 compression support |This allows the use of LZ4 for compression of table data and lz4 library is required to be installed.| | `--with-ssl=LIB` | Build with support for SSL (encrypted) connections. | The only LIBRARY supported is openssl, so `--with-ssl=openssl` is used in this guide. This requires the OpenSSL package to be installed. | +| `--with-diskquota` | Build with diskquota extension. | Diskquota is an extension that provides disk usage enforcement for database objects in Apache Cloudberry. **Since Cloudberry 2.2**| +| `--with-gp-stats-collector` | Build with stats collector extension. | An extension for collecting query execution metrics and reporting them to an external agent. **Since Cloudberry 2.2**| +| `--with-yezzey` | Build with Yezzey extension. | Yezzey is an extension for offloading data from Cloudberry to S3-compatible external storage. This option builds the extension only. You do not need a proxy if there are only a few requests to S3, but many parallel data exchange streams can exhaust CPU and network on the cluster host. For better performance under heavy traffic, additionally deploy [YProxy](https://github.com/open-gpdb/yproxy), which pools connections to S3 and schedules the requests. **Since Cloudberry 2.2**| diff --git a/versioned_docs/version-2.x/build/create-gpadmin-user.md b/versioned_docs/version-2.x/build/create-gpadmin-user.md index 89a1d84c480..a95889139a8 100644 --- a/versioned_docs/version-2.x/build/create-gpadmin-user.md +++ b/versioned_docs/version-2.x/build/create-gpadmin-user.md @@ -16,7 +16,7 @@ If `sudo` & `git` command is not already installed, run the following command to dnf install -y sudo git ``` - + ```bash apt update && apt install -y sudo git ``` @@ -63,7 +63,7 @@ This script performs three main tasks as the `gpadmin` user: The script uses a heredoc (EOF) block to execute multiple commands under the `gpadmin` user context. This will be used multiple time throughout these instructions. - + ```bash sudo -u gpadmin bash <<'EOF' # Add Cloudberry environment setup to .bashrc diff --git a/versioned_docs/version-2.x/build/download-source-code.md b/versioned_docs/version-2.x/build/download-source-code.md index b0edd10744f..c27a224771c 100644 --- a/versioned_docs/version-2.x/build/download-source-code.md +++ b/versioned_docs/version-2.x/build/download-source-code.md @@ -19,32 +19,28 @@ git clone https://github.com/apache/cloudberry.git ~/cloudberry cd ~/cloudberry git fetch --tags -# For Apache Cloudberry 2.0.0 -git checkout tags/2.0.0-incubating +# For Apache Cloudberry 2.2.0 +git checkout tags/2.2.0-incubating # For Apache Cloudberry 2.1.0 git checkout tags/2.1.0-incubating +# For Apache Cloudberry 2.0.0 +git checkout tags/2.0.0-incubating + git submodule update --init --recursive ``` :::note -The command `git submodule update --init --recursive` is used to initialize submodules for building with PAX support in this guide. If you don't plan to build with PAX support, you can skip this step. +The command `git submodule update --init --recursive` initializes the submodules that the build depends on. In Apache Cloudberry 2.0 and 2.1, these are only needed for building with PAX support, so you can skip this step if you don't plan to enable PAX. Starting from Apache Cloudberry 2.2, other components are shipped as submodules too, such as `gpcontrib/yezzey` for `--with-yezzey`, so run this command unless you are sure you need none of them. ::: :::caution -In the Ubuntu container, you may encounter the following error when clone the source code: +In the Ubuntu container, you may encounter the following error when cloning the source code: `error: git-remote-https died of signal 4`. -``` -error: git-remote-https died of signal 4 -``` - -You can set the following environment variable to avoid this error: +You can set the following environment variable to avoid this error: `export GNUTLS_CPUID_OVERRIDE=0x1`. -```bash -export GNUTLS_CPUID_OVERRIDE=0x1 -``` ::: ## Download the source code archive @@ -52,11 +48,11 @@ export GNUTLS_CPUID_OVERRIDE=0x1 Alternatively, you can download the source code archive from the [Apache Cloudberry releases page](/releases). -- For Apache Cloudberry 2.0.0 +- For Apache Cloudberry 2.2.0 ```bash -tar xvzf apache-cloudberry-2.0.0-incubating-src.tar.gz -mv apache-cloudberry-2.0.0-incubating cloudberry +tar xvzf apache-cloudberry-2.2.0-incubating-src.tar.gz +mv apache-cloudberry-2.2.0-incubating cloudberry ``` - For Apache Cloudberry 2.1.0 @@ -66,6 +62,13 @@ tar xvzf apache-cloudberry-2.1.0-incubating-src.tar.gz mv apache-cloudberry-2.1.0-incubating cloudberry ``` +- For Apache Cloudberry 2.0.0 + +```bash +tar xvzf apache-cloudberry-2.0.0-incubating-src.tar.gz +mv apache-cloudberry-2.0.0-incubating cloudberry +``` + :::note The submodules are already included in the latest 2.x.0 release source code archive, so you don't need to download the submodules manually after extracting the archive. -::: \ No newline at end of file +::: diff --git a/versioned_docs/version-2.x/build/index.md b/versioned_docs/version-2.x/build/index.md index e3d24ad371f..7e1c5cc53db 100644 --- a/versioned_docs/version-2.x/build/index.md +++ b/versioned_docs/version-2.x/build/index.md @@ -35,20 +35,24 @@ For those new to Cloudberry or PostgreSQL, we recommend starting with a PostgreS ## Prerequisites -### Provision a Rocky Linux 8+ / Ubuntu 20.04+ Environment +### Provision a Rocky Linux 8+ / Ubuntu 22.04+ Environment + +:::note +Since Apache Cloudberry 2.2, Ubuntu 20.04 support has been dropped, and support for Rocky Linux 10 and Ubuntu 24.04 has been added. +::: - Use any platform to create a virtual machine or container: - - **Cloud providers**: You can use the Rocky Linux 8+ or Ubuntu 20.04+ images provided by the cloud providers, such as AWS, Google Cloud, Microsoft Azure, and more. - - **VirtualBox**: Use the official [Rocky Linux 8+](https://rockylinux.org/download) / [Ubuntu 20.04+](https://ubuntu.com/download) ISO or Vagrant boxes. - - **Docker**: These instructions were validated under Rocky Linux 8+ and Ubuntu 20.04 official base docker images, but should work with any of their based container. + - **Cloud providers**: You can use the Rocky Linux 8+ or Ubuntu 22.04+ images provided by the cloud providers, such as AWS, Google Cloud, Microsoft Azure, and more. + - **VirtualBox**: Use the official [Rocky Linux 8+](https://rockylinux.org/download) / [Ubuntu 22.04+](https://ubuntu.com/download) ISO or Vagrant boxes. + - **Docker**: These instructions were validated under Rocky Linux 8+ and Ubuntu 22.04 official base docker images, but should work with any of their based container. - For example, you can run the following command to start a Rocky Linux 8 container: ```bash docker run -it --shm-size=2gb -h cdw rockylinux/rockylinux:8 - # Start a Ubuntu 20.04 container: - # docker run -it --shm-size=2gb -h cdw ubuntu:20.04 + # Start a Ubuntu 22.04 container: + # docker run -it --shm-size=2gb -h cdw ubuntu:22.04 ``` The hostname `cdw` (Coordinator Data Warehouse) is just an example of how we started the container for testing. @@ -76,7 +80,7 @@ Minimum requirements for development environment: ## Build Apache Cloudberry from source code -The following steps guide you through building Apache Cloudberry from source code on Rocky Linux 8+ or Ubuntu 20.04+. The process is similar for both operating systems, with minor differences in package management, dependencies and software versions between these two distributions. +The following steps guide you through building Apache Cloudberry from source code on Rocky Linux 8+ or Ubuntu 22.04+. The process is similar for both operating systems, with minor differences in package management, dependencies and software versions between these two distributions. Just go ahead and follow the steps below to build Apache Cloudberry from source code: diff --git a/versioned_docs/version-2.x/build/install-required-packages.md b/versioned_docs/version-2.x/build/install-required-packages.md index 41db3656e9d..a739e117455 100644 --- a/versioned_docs/version-2.x/build/install-required-packages.md +++ b/versioned_docs/version-2.x/build/install-required-packages.md @@ -45,6 +45,7 @@ sudo dnf install -y apr-devel \ perl-Env \ python3-devel \ python3-pip \ + python3-setuptools \ readline-devel \ rsync \ wget \ @@ -61,6 +62,12 @@ On Rocky Linux, they are disabled by default and must be explicitly enabled. +- For Apache Cloudberry 2.2.0 + +```bash +sudo dnf install -y --enablerepo=devel liburing-devel libuv-devel libyaml-devel perl-IPC-Run protobuf-devel python3-wheel python3-Cython +``` + - For Apache Cloudberry 2.1.0 ```bash @@ -75,6 +82,12 @@ sudo dnf install -y --enablerepo=devel libuv-devel libyaml-devel perl-IPC-Run pr +- For Apache Cloudberry 2.2.0 + +```bash +sudo dnf install -y --enablerepo=crb liburing-devel libuv-devel libyaml-devel perl-IPC-Run protobuf-devel python3-wheel python3-Cython +``` + - For Apache Cloudberry 2.1.0 ```bash @@ -86,6 +99,15 @@ sudo dnf install -y --enablerepo=crb liburing-devel libuv-devel libyaml-devel pe ```bash sudo dnf install -y --enablerepo=crb libuv-devel libyaml-devel perl-IPC-Run protobuf-devel ``` + + + +- For Apache Cloudberry 2.2.0 + +```bash +sudo dnf install -y --enablerepo=crb liburing-devel libuv-devel libyaml-devel perl-IPC-Run protobuf-devel python3-wheel +``` + @@ -96,7 +118,7 @@ In Red Hat Enterprise Linux (RHEL), this repository is called "PowerTools." ### Install gcc and gcc-c++ 11+ for Rocky Linux 8 (Optional) :::tip -This step is only required for Apache Cloudberry 2.0.0. You can skip this step when building Apache Cloudberry 2.1.0. +This step is only required for Apache Cloudberry 2.0.0. You can skip this step when building Apache Cloudberry 2.1.0+. ::: For Rocky Linux 8, we need to install the higher version of gcc and gcc-c++ to build Apache Cloudberry 2.0.0 with PAX support: @@ -164,7 +186,7 @@ Ensure the SHA-256 checksum validation passes (output: `xerces-c-3.3.0.tar.gz: O ::: - + For Ubuntu users: @@ -207,24 +229,25 @@ sudo apt install -y bison \ python3-dev \ python3-pip \ python3-setuptools \ + python3-wheel \ rsync ``` ### Extra dependencies for building PAX (Optional) :::tip -Only required for Apache Cloudberry 2.1.0. You can skip this step when building Apache Cloudberry 2.0.0. +Only required for Apache Cloudberry 2.1.0+. You can skip this step when building Apache Cloudberry 2.0.0. ::: -In Apache Cloudberry 2.1.0, we have introduced a new dependency `liburing` for building PAX. +In Apache Cloudberry 2.1.0+, we have introduced a new dependency `liburing` for building PAX. -* For Ubuntu 22.04 +* For Ubuntu 22.04/24.04 ```bash sudo apt install -y liburing-dev ``` -* For Ubuntu 20.04 +* For Ubuntu 20.04 (Apache Cloudberry 2.1) ```bash sudo apt install -y git build-essential diff --git a/versioned_docs/version-2.x/build/quick-build.md b/versioned_docs/version-2.x/build/quick-build.md index a2df5d47c4f..e1488e82cbc 100644 --- a/versioned_docs/version-2.x/build/quick-build.md +++ b/versioned_docs/version-2.x/build/quick-build.md @@ -10,11 +10,194 @@ In the following sections, we'll provide detailed, step-by-step instructions for By this, you will get an Apache Cloudberry environment with a demo cluster ready for testing and development. - + -Below are the instructions for building Apache Cloudberry 2.0.0 and Apache Cloudberry 2.1.0 from source code on Rocky Linux 8/9: -- [For Apache Cloudberry 2.1.0](#for-apache-cloudberry-210) -- [For Apache Cloudberry 2.0.0](#for-apache-cloudberry-200) +Below are the instructions for building Apache Cloudberry from source code on Rocky Linux 8/9/10: +- [For Apache Cloudberry 2.2.0](#for-apache-cloudberry-220) (Rocky Linux 8/9/10) +- [For Apache Cloudberry 2.1.0](#for-apache-cloudberry-210) (Rocky Linux 8/9) +- [For Apache Cloudberry 2.0.0](#for-apache-cloudberry-200) (Rocky Linux 8/9) + +### For Apache Cloudberry 2.2.0 + +```bash +# Install sudo & git +dnf install -y sudo git + +# Create and configure the gpadmin user +sudo useradd -U -m -s /bin/bash gpadmin +echo 'gpadmin ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/90-gpadmin +sudo -u gpadmin sudo whoami # if the output is root, the configuration is correct + + +# Required configuration for gpadmin user +sudo -u gpadmin bash <<'EOF' +## Add Cloudberry environment setup to .bashrc +echo -e '\n# Add Cloudberry entries +if [ -f /usr/local/cloudberry-db/cloudberry-env.sh ]; then + source /usr/local/cloudberry-db/cloudberry-env.sh +fi +## US English with UTF-8 character encoding +export LANG=en_US.UTF-8 +' >> /home/gpadmin/.bashrc +## Set up SSH for passwordless access +mkdir -p /home/gpadmin/.ssh +if [ ! -f /home/gpadmin/.ssh/id_rsa ]; then + ssh-keygen -t rsa -b 2048 -C 'apache-cloudberry-dev' -f /home/gpadmin/.ssh/id_rsa -N "" +fi +cat /home/gpadmin/.ssh/id_rsa.pub >> /home/gpadmin/.ssh/authorized_keys +## Set proper SSH directory permissions +chmod 700 /home/gpadmin/.ssh +chmod 600 /home/gpadmin/.ssh/authorized_keys +chmod 644 /home/gpadmin/.ssh/id_rsa.pub +EOF + + +# Configure system settings +sudo tee /etc/security/limits.d/90-db-limits.conf << 'EOF' +## Core dump file size limits for gpadmin +gpadmin soft core unlimited +gpadmin hard core unlimited +## Open file limits for gpadmin +gpadmin soft nofile 524288 +gpadmin hard nofile 524288 +## Process limits for gpadmin +gpadmin soft nproc 131072 +gpadmin hard nproc 131072 +EOF + +# Verify resource limits. +sudo -u gpadmin bash -c "ulimit -a" + +# Install required packages +sudo dnf install -y apr-devel \ + bison \ + bzip2-devel \ + curl \ + cmake3 \ + diffutils \ + flex \ + gcc \ + gcc-c++ \ + glibc-langpack-en \ + glibc-locale-source \ + iproute \ + krb5-devel \ + libcurl-devel \ + libevent-devel \ + libxml2-devel \ + libuuid-devel \ + libzstd-devel \ + lz4-devel \ + net-tools \ + openldap-devel \ + openssl-devel \ + openssh-server \ + pam-devel \ + perl \ + perl-ExtUtils-Embed \ + perl-Test-Simple \ + perl-Env \ + python3-devel \ + python3-pip \ + python3-setuptools \ + readline-devel \ + rsync \ + wget \ + which \ + zlib-devel + +# Enable additional development tools and libraries +## For Rocky Linux 8 +sudo dnf install -y --enablerepo=devel liburing-devel libuv-devel libyaml-devel perl-IPC-Run protobuf-devel python3-wheel python3-Cython +## For Rocky Linux 9 +sudo dnf install -y --enablerepo=crb liburing-devel libuv-devel libyaml-devel perl-IPC-Run protobuf-devel python3-wheel python3-Cython +## For Rocky Linux 10 +sudo dnf install -y --enablerepo=crb liburing-devel libuv-devel libyaml-devel perl-IPC-Run protobuf-devel python3-wheel + +# Build Xerces-C source code +XERCES_LATEST_RELEASE=3.3.0 +XERCES_INSTALL_PREFIX="/usr/local/xerces-c" +wget -nv "https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-${XERCES_LATEST_RELEASE}.tar.gz" +echo "$(curl -sL https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-${XERCES_LATEST_RELEASE}.tar.gz.sha256)" | sha256sum -c - +tar xf "xerces-c-${XERCES_LATEST_RELEASE}.tar.gz" +rm "xerces-c-${XERCES_LATEST_RELEASE}.tar.gz" +cd xerces-c-${XERCES_LATEST_RELEASE} +./configure --prefix="${XERCES_INSTALL_PREFIX}-${XERCES_LATEST_RELEASE}" +make -j$(nproc) +make check +sudo make install +sudo ln -s ${XERCES_INSTALL_PREFIX}-${XERCES_LATEST_RELEASE} ${XERCES_INSTALL_PREFIX} + +# Switch to the gpadmin user from now on +su - gpadmin + +# Download Source Code (2.x branch) +git clone https://github.com/apache/cloudberry.git ~/cloudberry +cd ~/cloudberry +git fetch --tags +git checkout tags/2.2.0-incubating +git submodule update --init --recursive + +# Prepare the build environment for Apache Cloudberry +sudo rm -rf /usr/local/cloudberry-db +sudo chmod a+w /usr/local +mkdir -p /usr/local/cloudberry-db/lib +sudo cp -v /usr/local/xerces-c/lib/libxerces-c.so \ + /usr/local/xerces-c/lib/libxerces-c-3.*.so \ + /usr/local/cloudberry-db/lib +sudo chown -R gpadmin:gpadmin /usr/local/cloudberry-db + +# Pre-stage the Python packages for `--with-pythonsrc-ext` before building +cd ~/cloudberry +make -C gpMgmt/bin download-python-deps + +# Run configure +export LD_LIBRARY_PATH=/usr/local/cloudberry-db/lib:${LD_LIBRARY_PATH:-""} +./configure --prefix=/usr/local/cloudberry-db \ + --disable-external-fts \ + --enable-gpcloud \ + --enable-ic-proxy \ + --enable-mapreduce \ + --enable-orafce \ + --enable-orca \ + --enable-pax \ + --disable-pxf \ + --enable-tap-tests \ + --with-diskquota \ + --with-gp-stats-collector \ + --with-gssapi \ + --with-ldap \ + --with-libxml \ + --with-lz4 \ + --with-pam \ + --with-perl \ + --with-pgport=5432 \ + --with-python \ + --with-pythonsrc-ext \ + --with-ssl=openssl \ + --with-uuid=e2fs \ + --with-yezzey \ + --with-includes=/usr/local/xerces-c/include \ + --with-libraries=/usr/local/cloudberry-db/lib + +# Build and install Cloudberry and its contrib modules +make -j$(nproc) -C ~/cloudberry +make -j$(nproc) -C ~/cloudberry/contrib +make install -C ~/cloudberry +make install -C ~/cloudberry/contrib + +# Verify the installation +/usr/local/cloudberry-db/bin/postgres --gp-version +/usr/local/cloudberry-db/bin/postgres --version +ldd /usr/local/cloudberry-db/bin/postgres + +# Set up a Cloudberry demo cluster +source /usr/local/cloudberry-db/cloudberry-env.sh +make create-demo-cluster -C ~/cloudberry +source ~/cloudberry/gpAux/gpdemo/gpdemo-env.sh +psql -P pager=off template1 -c 'SELECT * from gp_segment_configuration' +psql template1 -c 'SELECT version()' +``` ### For Apache Cloudberry 2.1.0 @@ -370,12 +553,174 @@ psql -P pager=off template1 -c 'SELECT * from gp_segment_configuration' psql template1 -c 'SELECT version()' ``` - + + +Below are the instructions for building Apache Cloudberry from source code on Ubuntu 20.04/22.04/24.04: + +- [For Apache Cloudberry 2.2.0](#for-apache-cloudberry-220-1) (Ubuntu 22.04/24.04) +- [For Apache Cloudberry 2.1.0](#for-apache-cloudberry-210-1) (Ubuntu 20.04/22.04) +- [For Apache Cloudberry 2.0.0](#for-apache-cloudberry-200-1) (Ubuntu 20.04/22.04) + +### For Apache Cloudberry 2.2.0 + +```bash +# Install sudo & git +apt update && apt install -y sudo git + +# Create and configure the gpadmin user +sudo useradd -U -m -s /bin/bash gpadmin +echo 'gpadmin ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/90-gpadmin +sudo -u gpadmin sudo whoami # if the output is root, the configuration is correct + +# Required configuration +sudo -u gpadmin bash <<'EOF' +## Add Cloudberry environment setup to .bashrc +echo -e '\n# Add Cloudberry entries +if [ -f /usr/local/cloudberry-db/cloudberry-env.sh ]; then + source /usr/local/cloudberry-db/cloudberry-env.sh +fi +## US English with UTF-8 character encoding +export LANG=en_US.UTF-8 +' >> /home/gpadmin/.bashrc +## Set up SSH for passwordless access +mkdir -p /home/gpadmin/.ssh +if [ ! -f /home/gpadmin/.ssh/id_rsa ]; then + ssh-keygen -t rsa -b 2048 -C 'apache-cloudberry-dev' -f /home/gpadmin/.ssh/id_rsa -N "" +fi +cat /home/gpadmin/.ssh/id_rsa.pub >> /home/gpadmin/.ssh/authorized_keys +## Set proper SSH directory permissions +chmod 700 /home/gpadmin/.ssh +chmod 600 /home/gpadmin/.ssh/authorized_keys +chmod 644 /home/gpadmin/.ssh/id_rsa.pub +EOF + +# Configure system settings +sudo tee /etc/security/limits.d/90-db-limits.conf << 'EOF' +## Core dump file size limits for gpadmin +gpadmin soft core unlimited +gpadmin hard core unlimited +## Open file limits for gpadmin +gpadmin soft nofile 524288 +gpadmin hard nofile 524288 +## Process limits for gpadmin +gpadmin soft nproc 131072 +gpadmin hard nproc 131072 +EOF + +# Verify resource limits +sudo -u gpadmin bash -c "ulimit -a" + +# Install basic system packages +sudo apt install -y bison \ + bzip2 \ + cmake \ + curl \ + flex \ + gcc \ + g++ \ + iproute2 \ + iputils-ping \ + language-pack-en \ + locales \ + libapr1-dev \ + libbz2-dev \ + libcurl4-gnutls-dev \ + libevent-dev \ + libkrb5-dev \ + libipc-run-perl \ + libldap2-dev \ + libpam0g-dev \ + libprotobuf-dev \ + libreadline-dev \ + libssl-dev \ + libuv1-dev \ + liburing-dev \ + liblz4-dev \ + libxerces-c-dev \ + libxml2-dev \ + libyaml-dev \ + libzstd-dev \ + libperl-dev \ + make \ + pkg-config \ + protobuf-compiler \ + python3-dev \ + python3-pip \ + python3-setuptools \ + python3-wheel \ + rsync + +# Use the gpadmin user from now on +sudo su - gpadmin + +# Clone the Apache Cloudberry repository (2.x branch) +git clone https://github.com/apache/cloudberry.git ~/cloudberry +cd ~/cloudberry +git fetch --tags +git checkout tags/2.2.0-incubating +git submodule update --init --recursive -Below are the instructions for building Apache Cloudberry 2.0.0 and Apache Cloudberry 2.1.0 from source code on Ubuntu 20.04/22.04: +# Prepare the build environment for Apache Cloudberry +sudo rm -rf /usr/local/cloudberry-db +sudo chmod a+w /usr/local +mkdir -p /usr/local/cloudberry-db +sudo chown -R gpadmin:gpadmin /usr/local/cloudberry-db -- [For Apache Cloudberry 2.1.0](#for-apache-cloudberry-210-1) -- [For Apache Cloudberry 2.0.0](#for-apache-cloudberry-200-1) +# Pre-stage the Python packages for `--with-pythonsrc-ext` before building +cd ~/cloudberry +# Building PyYAML requires Cython earlier than 3.0 +# For Ubuntu 22.04, cython3 is 0.29.x +sudo apt install -y cython3 +# For Ubuntu 24.04, cython3 is 3.x, so use cython3-legacy instead +sudo apt install -y cython3-legacy +# For Ubuntu 22.04 & 24.04 +make -C gpMgmt/bin download-python-deps + +# Run configure +./configure --prefix=/usr/local/cloudberry-db \ + --disable-external-fts \ + --enable-gpcloud \ + --enable-ic-proxy \ + --enable-mapreduce \ + --enable-orafce \ + --enable-orca \ + --enable-pax \ + --disable-pxf \ + --enable-tap-tests \ + --with-diskquota \ + --with-gp-stats-collector \ + --with-gssapi \ + --with-ldap \ + --with-libxml \ + --with-lz4 \ + --with-pam \ + --with-perl \ + --with-pgport=5432 \ + --with-python \ + --with-pythonsrc-ext \ + --with-ssl=openssl \ + --with-uuid=e2fs \ + --with-yezzey \ + --with-includes=/usr/include/xercesc + +# Build and install Cloudberry and its contrib modules +make -j$(nproc) -C ~/cloudberry +make -j$(nproc) -C ~/cloudberry/contrib +make install -C ~/cloudberry +make install -C ~/cloudberry/contrib + +# Verify the installation +/usr/local/cloudberry-db/bin/postgres --gp-version +/usr/local/cloudberry-db/bin/postgres --version +ldd /usr/local/cloudberry-db/bin/postgres + +# Set up a Cloudberry demo cluster +source /usr/local/cloudberry-db/cloudberry-env.sh +make create-demo-cluster -C ~/cloudberry +source ~/cloudberry/gpAux/gpdemo/gpdemo-env.sh +psql -P pager=off template1 -c 'SELECT * from gp_segment_configuration' +psql template1 -c 'SELECT version()' +``` ### For Apache Cloudberry 2.1.0 diff --git a/versioned_docs/version-2.x/build/set-demo-cluster.md b/versioned_docs/version-2.x/build/set-demo-cluster.md index f5faf160b2c..cb793116052 100644 --- a/versioned_docs/version-2.x/build/set-demo-cluster.md +++ b/versioned_docs/version-2.x/build/set-demo-cluster.md @@ -37,11 +37,11 @@ Please note that the `greenplum_path.sh` has changed to `cloudberry-env.sh` sin Load Cloudberry environment variables that set up paths for binaries, libraries, and other essential components: ```bash +# For Apache Cloudberry 2.1.0+ +source /usr/local/cloudberry-db/cloudberry-env.sh + # For Apache Cloudberry 2.0.0 source /usr/local/cloudberry-db/greenplum_path.sh - -# For Apache Cloudberry 2.1.0 -source /usr/local/cloudberry-db/cloudberry-env.sh ``` ## Create development cluster diff --git a/versioned_docs/version-2.x/deployment/platform-requirements.md b/versioned_docs/version-2.x/deployment/platform-requirements.md index 0bb94e54606..dcd1291ff80 100644 --- a/versioned_docs/version-2.x/deployment/platform-requirements.md +++ b/versioned_docs/version-2.x/deployment/platform-requirements.md @@ -123,9 +123,9 @@ mount /dev/data/data2 /data2/ Apache Cloudberry supports the following operating systems: -- Rocky Linux 8/9 -- Ubuntu 22.04 -- RHEL 8/9 and compatible distributions (Oracle Linux, AlmaLinux, etc.) +- Rocky Linux 8/9/10 (**Rocky Linux 10 is supported starting from Cloudberry 2.2**) +- Ubuntu 22.04/24.04 (**Ubuntu 24.04 is supported starting from Cloudberry 2.2**) +- RHEL 8/9/10 and compatible distributions (Oracle Linux, AlmaLinux, etc.) ### Software dependencies