Set up a Cloudberry demo cluster
This step walks through setting up a Cloudberry demo cluster, and testing basic functionality. The demo cluster includes a coordinator, standby coordinator, and multiple primary/mirror segments all running on a single development host.
Set up initial container (not required for all environments)
Container environments typically don't start the SSH daemon process by default. Since Cloudberry relies heavily on SSH for inter-process communication, we need to initialize and start the SSH server:
if ! pgrep sshd > /dev/null; then
echo "SSH daemon not running. Starting it now..."
sudo ssh-keygen -A
echo "PasswordAuthentication yes" | sudo tee -a /etc/ssh/sshd_config
sudo /usr/sbin/sshd
else
echo "SSH daemon is already running"
fi
Configure SSH for Cloudberry
Cloudberry uses SSH for coordinator-segment communication. The following commands ensure SSH is properly configured for the gpadmin user by adding the host to known_hosts and verifying SSH connectivity:
ssh-keyscan $(hostname) >> ~/.ssh/known_hosts
ssh $(hostname) date
Set up Cloudberry environment variables
Load Cloudberry environment variables that set up paths for binaries, libraries, and other essential components:
source /usr/local/cloudberry-db/greenplum_path.sh
Create development cluster
Create a demo cluster that simulates a full Cloudberry deployment on a single machine. This includes 1 coordinator, 1 standby coordinator, 3 primary segments, and 3 mirror segments:
make create-demo-cluster --directory=~/cloudberry
In the demo cluster, the cooradinator, standby coordinator and segments ports will be as follows:
COORDINATOR PORT (PGPORT). : 7000
STANDBY PORT ............. : 7001
SEGMENT PORTS ............ : 7002 7003 7004 7005 7006 7007
Configure cluster environment
After cluster creation, verify and load cluster-specific variables that point to the coordinator port and data directory:
source ~/cloudberry/gpAux/gpdemo/gpdemo-env.sh
Validate cluster deployment
Verify the cluster is running correctly with these essential commands:
# Displays detailed cluster state including segment status
gpstate
# Tests cluster shutdown and startup
gpstop -a
gpstart -a
# Confirms Cloudberry version and build
psql template1 -c 'SELECT version()'
# Views segment configuration showing primary/mirror relationships
psql template1 -c 'SELECT * from gp_segment_configuration'
# Checks available PostgreSQL extensions
psql template1 -c 'SELECT * FROM pg_available_extensions'
Connect to the default postgres
database
To connect to the default postgres
database, use the following command:
psql -p 7000 postgres