Sign inSign up

andreihes/gpdb

By andreihes

•Updated almost 4 years ago
Archived

Greenplum Database Learning

Image
0

212

andreihes/gpdb repository overview

⁠Overview

This docker image features Greenplum 6.21.2 installed in Ubuntu 18.04 (bionic) with the below configuration:

  • Coordinator and standby
  • Three segments
  • Three mirrors

The installation has been done using gpadmin user whose password is gpadmin. The image has been created for educational purposes.

⁠Starting Container from the Image

docker pull andreihes/gpdb
docker run -d -i -h u18 -p 5432:5432/tcp -p 222:22/tcp --name gpdb andreihes/gpdb /bin/bash -c '. /app/run.sh'

Notes:

  • Use -h u18 to run container with given hostname
  • Expose port 5432 if you want to connect GPDB from outside of the container
  • Expose port 222 if you want SSH from outside of the container
  • Name your container gpdb for consistency
  • Run the command: /bin/bash -c '. /app/run.sh'

Following the recommendations will spin a container with a GP instance running.

⁠Stopping and Starting GPDB

The /app/run.sh will stop GP array In a fast mode (-M fast) and do exit 0 then if you stop the container:

docker stop gpdb

Once you need it again, do:

docker start gpdb

⁠Get Connected

Once container started and runs you may connect using exec as usual:

docker exec -t -i gpdb bash

Once you're in you may switch to gpadmin user:

su -l gpadmin

You may alter the .ssh/authorized_keys to be able to connect directly into a running container as gpadmin using the ssh:

# hostname to be the one where docker is running
ssh -p 222 gpadmin@hostname

⁠Connection Details

  • PORT: 5432
  • USER: gpadmin
  • PASS: gpadmin
  • MDD: /data/gpc/S-1
  • DBNAME: gpdb

You may always find this here: cat /home/gpadmin/.bash_profile. User gpadmin already has all necessary setup to jump directly inside using psql:

gpadmin@u18:[GP]:~$ psql -c 'select * from gp_segment_configuration order by dbid'
 dbid | content | role | preferred_role | mode | status | port | hostname | address |    datadir
------+---------+------+----------------+------+--------+------+----------+---------+---------------
    1 |      -1 | p    | p              | n    | u      | 5432 | u18      | u18     | /data/gpc/S-1
    2 |       0 | p    | p              | s    | u      | 6000 | u18      | u18     | /data/sp/S0
    3 |       1 | p    | p              | s    | u      | 6001 | u18      | u18     | /data/sp/S1
    4 |       2 | p    | p              | s    | u      | 6002 | u18      | u18     | /data/sp/S2
    5 |       0 | m    | m              | s    | u      | 7000 | u18      | u18     | /data/sm/S0
    6 |       1 | m    | m              | s    | u      | 7001 | u18      | u18     | /data/sm/S1
    7 |       2 | m    | m              | s    | u      | 7002 | u18      | u18     | /data/sm/S2
    8 |      -1 | m    | m              | s    | u      | 5431 | u18      | u18     | /data/gpcs
(8 rows)

gpadmin@u18:[GP]:~$

Tag summary

Content type

Image

Digest

sha256:b05c13a3f…

Size

248.4 MB

Last updated

almost 4 years ago

docker pull andreihes/gpdb