原 在Docker中快速体验GreenPlum 7.0.0和gpcc 7.0.0
Tags: 原创GreenPlumDocker快速体验GPDB 7gpccdocker环境
简介
GreenPlum 7.0.0正式版已于2023.09.29发布,基于PG 12.12内核版本。
一个月后,在2023.10.30日发布了gpcc 7.0.0版本,可以用来监控GreenPlum 7.0.0的数据库。
相关新特性请参考:https://www.dbaup.com/greenplum-7-xintexingzhengli.html
环境配置
地址:https://hub.docker.com/r/lhrbest/greenplum/tags
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | docker rm -f gpdb7 docker run -itd --name gpdb7 -h gpdb7 \ -p 5437:5432 -p 28087:28080 \ -v /sys/fs/cgroup:/sys/fs/cgroup \ --privileged=true lhrbest/greenplum:7.0.0_v2 \ /usr/sbin/init docker exec -it gpdb7 bash su - gpadmin gpstart -a gpcc start gpcc status gpstate |
此docker包括1个master,1个standby master,2个segment,2个mirror实例;还包括gpcc 7.0.0.
示例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | [root@gpdb7 /]# su - gpadmin Last login: Fri Jul 21 16:42:55 CST 2023 on pts/1 [gpadmin@gpdb7 ~]$ [gpadmin@gpdb7 ~]$ [gpadmin@gpdb7 ~]$ gpstart -a 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-Starting gpstart with args: -a 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-Gathering information and validating the environment... 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 7.0.0 build commit:0a7a3566873325aca1789ae6f818c80f17a9402d Open Source' 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-Greenplum Catalog Version: '302307241' 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-Starting Coordinator instance in admin mode 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-CoordinatorStart pg_ctl cmd is env GPSESSID=0000000000 GPERA=None $GPHOME/bin/pg_ctl -D /opt/greenplum/data/master/gpseg-1 -l /opt/greenplum/data/master/gpseg-1/log/startup.log -w -t 600 -o " -c gp_role=utility " start 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-Obtaining Greenplum Coordinator catalog information 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-Obtaining Segment details from coordinator... 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-Setting new coordinator era 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-Coordinator Started... 20231009:12:17:40:000512 gpstart:gpdb7:gpadmin-[INFO]:-Shutting down coordinator 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait... 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:-Process results... 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:- 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:----------------------------------------------------- 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:- Successful segment starts = 4 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:- Failed segment starts = 0 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) = 0 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:----------------------------------------------------- 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:-Successfully started 4 of 4 segment instances 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:----------------------------------------------------- 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:-Starting Coordinator instance gpdb7 directory /opt/greenplum/data/master/gpseg-1 20231009:12:17:43:000512 gpstart:gpdb7:gpadmin-[INFO]:-CoordinatorStart pg_ctl cmd is env GPSESSID=0000000000 GPERA=cbcbcc7d30fa4b35_231009121740 $GPHOME/bin/pg_ctl -D /opt/greenplum/data/master/gpseg-1 -l /opt/greenplum/data/master/gpseg-1/log/startup.log -w -t 600 -o " -c gp_role=dispatch " start 20231009:12:17:44:000512 gpstart:gpdb7:gpadmin-[INFO]:-Command pg_ctl reports Coordinator gpdb7 instance active 20231009:12:17:44:000512 gpstart:gpdb7:gpadmin-[INFO]:-Connecting to db template1 on host localhost 20231009:12:17:44:000512 gpstart:gpdb7:gpadmin-[INFO]:-Starting standby coordinator 20231009:12:17:44:000512 gpstart:gpdb7:gpadmin-[INFO]:-Checking if standby coordinator is running on host: gpdb7 in directory: /opt/greenplum/data/master_standby/gpseg-1 20231009:12:17:44:000512 gpstart:gpdb7:gpadmin-[INFO]:-CoordinatorStart pg_ctl cmd is env GPSESSID=0000000000 GPERA=cbcbcc7d30fa4b35_231009121740 $GPHOME/bin/pg_ctl -D /opt/greenplum/data/master_standby/gpseg-1 -l /opt/greenplum/data/master_standby/gpseg-1/log/startup.log -t 600 -o " -c gp_role=dispatch " start 20231009:12:17:45:000512 gpstart:gpdb7:gpadmin-[INFO]:-Database successfully started [gpadmin@gpdb7 ~]$ gpstate -e 20231009:12:18:02:001543 gpstate:gpdb7:gpadmin-[INFO]:-Starting gpstate with args: -e 20231009:12:18:02:001543 gpstate:gpdb7:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 7.0.0 build commit:0a7a3566873325aca1789ae6f818c80f17a9402d Open Source' 20231009:12:18:02:001543 gpstate:gpdb7:gpadmin-[INFO]:-coordinator Greenplum Version: 'PostgreSQL 12.12 (Greenplum Database 7.0.0 build commit:0a7a3566873325aca1789ae6f818c80f17a9402d Open Source) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-18), 64-bit compiled on Sep 20 2023 23:29:19 Bhuvnesh C.' 20231009:12:18:02:001543 gpstate:gpdb7:gpadmin-[INFO]:-Obtaining Segment details from coordinator... 20231009:12:18:02:001543 gpstate:gpdb7:gpadmin-[INFO]:-Gathering data from segments... 20231009:12:18:03:001543 gpstate:gpdb7:gpadmin-[WARNING]:-pg_stat_replication shows no standby connections 20231009:12:18:03:001543 gpstate:gpdb7:gpadmin-[WARNING]:-pg_stat_replication shows no standby connections 20231009:12:18:03:001543 gpstate:gpdb7:gpadmin-[INFO]:----------------------------------------------------- 20231009:12:18:03:001543 gpstate:gpdb7:gpadmin-[INFO]:-Segment Mirroring Status Report 20231009:12:18:03:001543 gpstate:gpdb7:gpadmin-[INFO]:----------------------------------------------------- 20231009:12:18:03:001543 gpstate:gpdb7:gpadmin-[INFO]:-Unsynchronized Segment Pairs 20231009:12:18:03:001543 gpstate:gpdb7:gpadmin-[INFO]:- Current Primary Port WAL sync remaining bytes Mirror Port 20231009:12:18:03:001543 gpstate:gpdb7:gpadmin-[INFO]:- gpdb7 6000 Unknown gpdb7 7000 20231009:12:18:03:001543 gpstate:gpdb7:gpadmin-[INFO]:- gpdb7 6001 Unknown gpdb7 7001 [gpadmin@gpdb7 ~]$ |
GreenPlum使用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | postgres=# select version(); version ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PostgreSQL 12.12 (Greenplum Database 7.0.0 build commit:0a7a3566873325aca1789ae6f818c80f17a9402d Open Source) on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-18), 64-bit compiled on Sep 20 2023 23:29:19 Bhuvnesh C. (1 row) postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+---------+----------+-------------+-------------+--------------------- lhrgpdb | gpadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | postgres | gpadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | template0 | gpadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/gpadmin + | | | | | gpadmin=CTc/gpadmin template1 | gpadmin | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/gpadmin + | | | | | gpadmin=CTc/gpadmin (4 rows) postgres=# select * from gp_segment_configuration order by 1,3 ; dbid | content | role | preferred_role | mode | status | port | hostname | address | datadir ------+---------+------+----------------+------+--------+------+----------+---------+-------------------------------------------- 1 | -1 | p | p | n | u | 5432 | gpdb7 | gpdb7 | /opt/greenplum/data/master/gpseg-1 2 | 0 | p | p | s | u | 6000 | gpdb7 | gpdb7 | /opt/greenplum/data/primary/gpseg0 3 | 1 | p | p | s | u | 6001 | gpdb7 | gpdb7 | /opt/greenplum/data/primary/gpseg1 4 | 0 | m | m | s | u | 7000 | gpdb7 | gpdb7 | /opt/greenplum/data/mirror/gpseg0 5 | 1 | m | m | s | u | 7001 | gpdb7 | gpdb7 | /opt/greenplum/data/mirror/gpseg1 6 | -1 | m | m | s | u | 5433 | gpdb7 | gpdb7 | /opt/greenplum/data/master_standby/gpseg-1 (6 rows) postgres=# |
gpcc使用
gpmon/lhr