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

Set up a Greengage DB demo cluster

Andrey Aksenov

This guide provides instructions for setting up a Greengage DB demo cluster on a single host for testing purposes. For a multi-host cluster deployment, see Initialize DBMS.

Prerequisites

Before creating and running the demo cluster, make sure the following prerequisites are met:

Configure an operating system

To run a Greengage DB demo cluster, you must prepare the operating system environment. For proper operation of the demo cluster, it is sufficient to configure only specific parameters, as described below.

Make sure you are logged in as a user with sudo privileges.

Deactivate SELinux (CentOS)

  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.

NOTE

If the gpadmin user already exists, the limits you set in limits.conf apply only to new login sessions. Log out and log back in as gpadmin before creating and starting the demo cluster to ensure these updated limits take effect.

Create the Greengage DB administrative user

You need to create a system user account for running and administering 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

Create a demo cluster

This section describes how to clone the Greengage DB repository and set up a demo cluster. All steps should be executed as the gpadmin user, which you created in the previous section.

Configure the environment

Before creating and running the demo cluster, configure the Greengage DB path and environment variables. The commands differ depending on whether you installed Greengage DB from the .deb package or built it from source:

$ source /opt/greengagedb/greengage/greengage_path.sh
$ source /usr/local/gpdb/greengage_path.sh

This ensures that all Greengage DB commands are available in your shell session. For more details on setting environment variables for Greengage DB, see Set Greengage DB environment variables.

Clone the Greengage DB repository

  1. (Optional) Clone the greengage repository if it has not been obtained previously:

    $ git clone \
      --branch 6.30.1 \
      --recurse-submodules \
      https://github.com/GreengageDB/greengage.git
  2. Go to the greengage directory:

    $ cd greengage

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 MASTER_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
NOTE

The demo cluster supports additional configuration options, such as changing the number of segments, port range, or data directory location. For details about these settings, see README.

Verify the cluster

  1. List all cluster databases:

    $ psql -l

    The result can look similar to this:

                                   List of databases
       Name    |  Owner  | Encoding |  Collate   |   Ctype    |  Access privileges
    -----------+---------+----------+------------+------------+---------------------
     postgres  | gpadmin | UTF8     | en_US.utf8 | en_US.utf8 |
     template0 | gpadmin | UTF8     | en_US.utf8 | en_US.utf8 | =c/gpadmin         +
               |         |          |            |            | gpadmin=CTc/gpadmin
     template1 | gpadmin | UTF8     | en_US.utf8 | en_US.utf8 | =c/gpadmin         +
               |         |          |            |            | gpadmin=CTc/gpadmin
    (3 rows)
  2. Connect to the default postgres database:

    $ psql postgres

    The output should look like this:

    psql (9.4.26)
    Type "help" for help.
  3. Get the version information about the installed Greengage DB:

    SELECT version();

    The output might look like this:

    PostgreSQL 9.4.26 (Greengage Database 6.30.1 build dev) on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0, 64-bit compiled on Mar 19 2026 07:54:38

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

Learn more in Start and stop a cluster.