Set up a Greengage DB demo cluster
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:
-
Greengage DB is installed using one of the supported installation methods:
-
gitandmakeare installed on the host. -
The
en_US.UTF-8locale is available on the host. -
OpenSSH server (
sshd) is installed and running.
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)
-
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.
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
-
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
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
-
(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 -
Go to the greengage directory:
$ cd greengage
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
PGPORTandMASTER_DATA_DIRECTORYenvironment variables:$ source gpAux/gpdemo/gpdemo-env.sh -
Check the cluster state to make sure all the instances are up and running:
$ gpstate
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
-
List all cluster databases:
$ psql -lThe 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) -
Connect to the default
postgresdatabase:$ psql postgresThe output should look like this:
psql (9.4.26) Type "help" for help.
-
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
-
Quit your
psqlsession:\q -
Stop the cluster using the
gpstoputility:$ gpstop
To start the demo cluster again, use gpstart:
$ gpstart
Learn more in Start and stop a cluster.