How to install Cloudberry Database on Cent OS

The source of this document is from the GitHub repository cloudberrydb/cloudberrydb.

This guide outlines the steps for compiling and installing Cloudberry Database on Cent OS 9.

To compile and install Cloudberry Database, follow these steps:

  • Clone the GitHub repository.
  • Install required dependencies.
  • Complete necessary platform prerequisites.
  • Build the Cloudberry Database software.
  • Verify the cluster functionality.

Step 1. Clone GitHub repo

dnf install git
git clone https://github.com/cloudberrydb/cloudberrydb.git

Step 2. Install dependencies

dnf group install -y "Development Tools"
dnf install -y epel-release
dnf config-manager --set-enabled crb
dnf 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  libpq-devel perl

Install PostgreSQL repository

# Install the repository RPM:
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# Disable the built-in PostgreSQL module:
sudo dnf -qy module disable postgresql

Step 3. Navigate to cloudberrydb and install dependencies

cd ~/cloudberrydb/deploy/build/

Edit README.CentOS.bash with postgresql version and pg_config path

..
..
sudo yum install -y \
postgresql14-server \
postgresql14-devel
sudo yum install -y libpq5-devel
export PATH=/usr/pgsql-14/bin:$PATH
..

Upgrade PyYAML

pip install --upgrade "PyYAML>=6.0,<7.0"

Modify pyyaml version in python-dependencies.txt file

cd ../../
vi python-dependencies.txt
pyyaml==6.0.2
cd -

and then run README.CentOS.bash

./README.CentOS.bash

Step 4. Perform prerequisite platform tasks

echo -e "/usr/local/lib \n/usr/local/lib64" >> /etc/ld.so.conf
ldconfig

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

Step 5. Build Cloudberry Database (Configure,make and make install)

cd cloudberrydb
./configure --with-perl --with-python --with-libxml --with-gssapi --prefix=/usr/local/cloudberrydb
make 
make -j8 install

Set up environment

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

Set up and start the demo cluster.

make create-demo-cluster

Step 6. Verify the cluster

Check the processes

ps -ef | grep postgres

Login and check the segment details

psql -p 7000 postgres
select version();
select * from gp_segment_configuration;

More commands

gpstate -c
gpstate -m