This docker image features Greenplum 6.21.2 installed in Ubuntu 18.04 (bionic) with the below configuration:
The installation has been done using gpadmin user whose password is gpadmin. The image has been created for educational purposes.
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:
-h u18 to run container with given hostnamegpdb for consistency/bin/bash -c '. /app/run.sh'Following the recommendations will spin a container with a GP instance running.
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
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
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]:~$
Content type
Image
Digest
sha256:b05c13a3f…
Size
248.4 MB
Last updated
almost 4 years ago
docker pull andreihes/gpdb