Hello, I’m DocuDroid!
Submitting feedback
Thank you for rating our AI Search!
We would be grateful if you could share your thoughts so we can improve our AI Search for you and other readers.
GitHub

Build Greengage DB from the source code

Andrey Aksenov

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)

  1. Open the /etc/selinux/config file for editing:

    $ sudo vi /etc/selinux/config
  2. Set the SELINUX parameter to disabled to turn SELinux off:

    SELINUX=disabled
  3. Save and close the file.

  4. Reboot the system to apply the changes.

Edit sysctl.conf

  1. Open the /etc/sysctl.conf file for editing:

    $ sudo vi /etc/sysctl.conf
  2. 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
  3. Save and close the file.

  4. To apply the changes, run the sysctl command:

    $ sudo sysctl --system

Edit limits.conf

  1. Open the /etc/security/limits.conf file:

    $ sudo vi /etc/security/limits.conf
  2. Specify the following options for the gpadmin user:

    gpadmin soft nofile 524288
    gpadmin hard nofile 524288
    gpadmin soft nproc 150000
    gpadmin hard nproc 150000

    gpadmin is created in the next section.

  3. 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

  1. Add the content of the generated public key to the authorized_keys file:

    $ cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
  2. Change the permissions of the authorized_keys file as follows:

    $ chmod 600 ~/.ssh/authorized_keys
NOTE

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

  1. Ensure you are logged in as gpadmin and in the home directory.

  2. Clone the greengage repository:

    $ git clone --recurse-submodules https://github.com/GreengageDB/greengage.git
  3. Change the current directory to greengage:

    $ cd greengage
  4. 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

  1. Change the current directory to greengage:

    $ cd ~/greengage
  2. 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/gpdb
    NOTE

    To see all the available build options, run ./configure --help.

  3. 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.
  4. Install Greengage DB using make install:

    $ sudo make -j$(nproc) install

    If the installation is successful, the output should contain this information:

    ...
    Greengage Database installation complete.
  5. 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*
  6. Set the Greengage DB path and environment variables as follows:

    $ source /usr/local/gpdb/greengage_path.sh
    NOTE

    Add the above source command to the gpadmin user’s shell startup file (for example, .bashrc). This sets the Greengage DB path and environment variables each time you log in as gpadmin.

Create a demo cluster

This section shows how to run a demo cluster.

Start a demo cluster

  1. Start a demo cluster by executing the command below:

    $ make create-demo-cluster
  2. After the cluster is initialized and started, source the gpAux/gpdemo/gpdemo-env.sh file to set values of the PGPORT and COORDINATOR_DATA_DIRECTORY environment variables:

    $ source gpAux/gpdemo/gpdemo-env.sh
  3. Check the cluster state to make sure all the instances are up and running:

    $ gpstate

Verify the cluster

  1. List all cluster databases:

    $ psql -l

    The 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)
  2. Connect to the default postgres database:

    $ psql postgres

    The output should look like this:

    psql (12.22)
    Type "help" for help.
  3. 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

  1. Quit your psql session:

    \q
  2. Stop the cluster using the gpstop utility:

    $ gpstop

To start the demo cluster again, use gpstart:

$ gpstart