import Tabs from ‘@theme/Tabs’; import TabItem from ‘@theme/TabItem’;
sudo
& git
(if missing)If sudo
& git
command is not already installed, run the following command to install it:
:::note In environments like Docker, the root
user will be able to use sudo
without a password prompt once it is installed. :::
gpadmin
userTo prepare the environment for Apache Cloudberry development, we need to create and configure a dedicated gpadmin
user.
Create a user ‘gpadmin’ with matching group, home directory, and bash shell:
sudo useradd -U -m -s /bin/bash gpadmin
Grant password-less sudo access to gpadmin
:
echo 'gpadmin ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/90-gpadmin
Verify the gpadmin
user setup:
sudo -u gpadmin sudo whoami
If the output is root
, the configuration is correct.
This script performs three main tasks as the gpadmin
user:
.bashrc
to source Cloudberry environment variablesThe script uses a heredoc (EOF) block to execute multiple commands under the gpadmin
user context. This will be used multiple time throughout these instructions.
sudo -u gpadmin bash <<'EOF' # Add Cloudberry environment setup to .bashrc echo -e '\n# Add Cloudberry entries if [ -f /usr/local/cloudberry-db/greenplum_path.sh ]; then source /usr/local/cloudberry-db/greenplum_path.sh fi # US English with UTF-8 character encoding export LANG=en_US.UTF-8 ' >> /home/gpadmin/.bashrc # Set up SSH for passwordless access mkdir -p /home/gpadmin/.ssh if [ ! -f /home/gpadmin/.ssh/id_rsa ]; then ssh-keygen -t rsa -b 2048 -C 'apache-cloudberry-dev' -f /home/gpadmin/.ssh/id_rsa -N "" fi cat /home/gpadmin/.ssh/id_rsa.pub >> /home/gpadmin/.ssh/authorized_keys # Set proper SSH directory permissions chmod 700 /home/gpadmin/.ssh chmod 600 /home/gpadmin/.ssh/authorized_keys chmod 644 /home/gpadmin/.ssh/id_rsa.pub EOF