Build Greengage DB from the source code
This topic describes how to build Greengage DB (based on Greenplum Database) on Linux operating systems and run a demo cluster. The source code for Greengage DB is available in the greengage repository. This repository also includes scripts to help you install the dependencies required to build Greengage DB on the required platform.
Prerequisites
To follow the steps described in this document, you need one of the following operating systems:
-
Ubuntu.
-
Rocky Linux.
For both operating systems, make sure you have git installed.
Configure an operating system
First, you need to customize some of the operating system parameters to ensure a demo Greengage DB cluster can operate correctly.
Deactivate SELinux (Rocky Linux)
-
Open the /etc/selinux/config file for editing:
$ sudo vi /etc/selinux/config -
Set the
SELINUXparameter todisabledto turn SELinux off:SELINUX=disabled -
Save and close the file.
-
Reboot the system to apply the changes.
Edit sysctl.conf
-
Open the /etc/sysctl.conf file for editing:
$ sudo vi /etc/sysctl.conf -
Specify the following parameters:
vm.overcommit_memory = 2 vm.overcommit_ratio = 95 net.ipv4.ip_local_port_range = 12000 65535 kernel.sem = 250 2048000 200 8192 -
Save and close the file.
-
To apply the changes, run the
sysctlcommand:$ sudo sysctl --system
Edit limits.conf
-
Open the /etc/security/limits.conf file:
$ sudo vi /etc/security/limits.conf -
Specify the following options for the
gpadminuser:gpadmin soft nofile 524288 gpadmin hard nofile 524288 gpadmin soft nproc 150000 gpadmin hard nproc 150000
gpadminis created in the next section. -
Save and close the file.
Create the Greengage DB administrative user
You need to create a system user account used to run and administer Greengage DB and generate an SSH key pair for this account. To do this, follow the steps in Create the Greengage DB administrative user. Then, you need to enable passwordless SSH for this user, as described below.
Enable passwordless SSH
-
Add the content of the generated public key to the authorized_keys file:
$ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys -
Change the permissions of the authorized_keys file as follows:
$ chmod 600 ~/.ssh/authorized_keys
Use the ssh <hostname> command to verify the ability to connect to the current host using SSH without a password.
Clone the Greengage DB repository
-
Ensure you are logged in as
gpadminand in the home directory. -
Clone the greengage repository:
$ git clone --recurse-submodules https://github.com/GreengageDB/greengage.git -
Change the current directory to greengage:
$ cd greengage -
Check out the required tag, for example:
$ git checkout tags/7.4.0
Install the dependencies
Install the dependencies required to build Greengage DB on different operating systems.
Execute the README.Ubuntu.bash script to install the dependencies:
$ sudo ./README.Ubuntu.bash
Execute the README.Rhel-Rocky.bash script to install the dependencies:
$ sudo ./README.Rhel-Rocky.bash
Build and install Greengage DB
-
Change the current directory to greengage:
$ cd ~/greengage -
Configure the build environment as follows to build Greengage DB:
$ ./configure \ --with-perl \ --with-python \ --with-libxml \ --with-uuid=e2fs \ --with-openssl \ --with-gssapi \ --with-ldap \ --enable-ic-proxy \ --enable-orafce \ --prefix=/usr/local/gpdbNOTETo see all the available build options, run
./configure --help. -
Compile Greengage DB using
make:$ make -j$(nproc)If the compilation is finished successfully, the output should contain this information:
... All of Greengage Database successfully made. Ready to install.
-
Install Greengage DB using
make install:$ sudo make -j$(nproc) installIf the installation is successful, the output should contain this information:
... Greengage Database installation complete.
-
Change the owner and group of the installed files to
gpadmin:$ sudo chown -R gpadmin:gpadmin /usr/local/gpdb* $ sudo chgrp -R gpadmin /usr/local/gpdb* -
Set the Greengage DB path and environment variables as follows:
$ source /usr/local/gpdb/greengage_path.shNOTEAdd the above
sourcecommand to thegpadminuser’s shell startup file (for example, .bashrc). This sets the Greengage DB path and environment variables each time you log in asgpadmin.
Create a demo cluster
This section shows how to run a demo cluster.
Start a demo cluster
-
Start a demo cluster by executing the command below:
$ make create-demo-cluster -
After the cluster is initialized and started, source the gpAux/gpdemo/gpdemo-env.sh file to set values of the
PGPORTandCOORDINATOR_DATA_DIRECTORYenvironment variables:$ source gpAux/gpdemo/gpdemo-env.sh -
Check the cluster state to make sure all the instances are up and running:
$ gpstate
Verify the cluster
-
List all cluster databases:
$ psql -lThe result can look like this:
List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+---------+----------+---------+---------+--------------------- postgres | gpadmin | UTF8 | C.UTF-8 | C.UTF-8 | template0 | gpadmin | UTF8 | C.UTF-8 | C.UTF-8 | =c/gpadmin + | | | | | gpadmin=CTc/gpadmin template1 | gpadmin | UTF8 | C.UTF-8 | C.UTF-8 | =c/gpadmin + | | | | | gpadmin=CTc/gpadmin (3 rows) -
Connect to the default
postgresdatabase:$ psql postgresThe output should look like this:
psql (12.22) Type "help" for help.
-
Get the version information about the installed Greengage DB:
SELECT version();The output might look like this:
PostgreSQL 12.22 (Greengage Database 7.4.0 build dev) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04.2) 11.4.0, 64-bit compiled on Nov 26 2025 07:33:50 Bhuvnesh C.
PostgreSQL 12.22 (Greengage Database 7.4.0 build dev) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5), 64-bit compiled on Nov 26 2025 08:50:58 Bhuvnesh C.
Stop the cluster
-
Quit your
psqlsession:\q -
Stop the cluster using the
gpstoputility:$ gpstop
To start the demo cluster again, use gpstart:
$ gpstart