diff --git a/docker_greenplum/README.md b/docker_greenplum/README.md index 868ee7c..f2533b2 100644 --- a/docker_greenplum/README.md +++ b/docker_greenplum/README.md @@ -1,20 +1,48 @@ -```bash -docker build -t qpod0dev/greenplum --build-arg "BASE_NAMESPACE=qpod" . +# GreenplumDB -docker run -it \ +This is the docker contianer for starting a GreenplumDB 7 cluster. +https://docs.vmware.com/en/VMware-Greenplum/7/greenplum-database/landing-index.html + +Note: After the creation of a cluster, it is required to initialize the cluster using the functions in `$GPHOME/entrypoint.sh`. + +## Quick Start + +To start a GPDB single node cluster, try the command below, or refer to the `example/gpdb-single-node/docker-compose.yml` + +```bash +docker run -d \ -p 15432:5432 -p 10022:22 \ -v /data/database/gpdb:/data/gpdb \ -h gpdb-cdw \ --name gpdb-cdw \ - docker.io/qpod0dev/greenplum \ - bash + docker.io/qpod0dev/greenplum -docker run -d \ +# to change the password for gpadmin db user, enter the container and execute the command below. +psql -d postgres -c "ALTER ROLE gpadmin WITH PASSWORD 'gpadmin';" +``` + +## Multi-node cluster on a single machine + +Please refer to the file `example/gpdb-single-vm/docker-compose.yml`. +Note: it is neded to create folders `primary1` and `primary2` for segment nodes in `/data/database/greenplum`: +``` +mkdir -pv /data/database/greenplum/primary1 +mkdir -pv /data/database/greenplum/primary2 +``` + +# Debug + +```bash +# to build the docker image +docker build -t qpod0dev/greenplum --build-arg "BASE_NAMESPACE=qpod" . + +docker run -it \ -p 15432:5432 -p 10022:22 \ -v /data/database/gpdb:/data/gpdb \ -h gpdb-cdw \ --name gpdb-cdw \ - docker.io/qpod0dev/greenplum + docker.io/qpod0dev/greenplum \ + bash /bin/bash -c ${GPHOME}/entrypoint.sh ``` diff --git a/docker_greenplum/example/gpdb-single-vm/docker-compose.yml b/docker_greenplum/example/gpdb-single-vm/docker-compose.yml index 7409fbc..00ff4fd 100644 --- a/docker_greenplum/example/gpdb-single-vm/docker-compose.yml +++ b/docker_greenplum/example/gpdb-single-vm/docker-compose.yml @@ -23,6 +23,9 @@ services: volumes: - ./conf:/opt/gpdb/conf - /data/database/greenplum:/data/gpdb + depends_on: + - sdw1 + - sdw2 sdw1: image: "docker.io/qpod/greenplum" diff --git a/docker_greenplum/rootfs/opt/gpdb/entrypoint.sh b/docker_greenplum/rootfs/opt/gpdb/entrypoint.sh index 88fd56a..fece77b 100755 --- a/docker_greenplum/rootfs/opt/gpdb/entrypoint.sh +++ b/docker_greenplum/rootfs/opt/gpdb/entrypoint.sh @@ -28,3 +28,4 @@ else echo "Starting existing GPDB" && gpstart -a fi # tail -f gpAdminLogs/*.log +bash