在Docker中快速体验GreenPlum 7.0.0

2023-08-10 15:29:22 浏览数 (2)

GreenPlum6版本:在Docker中快速体验GreenPlum 6.23.1和gpcc监控工具

环境配置

地址:https://hub.docker.com/r/lhrbest/greenplum/tags

代码语言:javascript复制
docker rm -f gpdb7
docker run -itd --name gpdb7 -h gpdb7 
  -p 5436:5432 -p 28086:28080  
  -v /sys/fs/cgroup:/sys/fs/cgroup 
  --privileged=true lhrbest/greenplum:7.0.0 
  /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实例。

示例:

代码语言:javascript复制
[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
20230721:16:45:00:001025 gpstart:gpdb7:gpadmin-[INFO]:-Starting gpstart with args: -a
20230721:16:45:00:001025 gpstart:gpdb7:gpadmin-[INFO]:-Gathering information and validating the environment...
20230721:16:45:00:001025 gpstart:gpdb7:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 7.0.0-beta.4 build commit:f3782c6dd89c9b6565a84518174ed4dd448f3293 Open Source'
20230721:16:45:00:001025 gpstart:gpdb7:gpadmin-[INFO]:-Greenplum Catalog Version: '302306121'
20230721:16:45:00:001025 gpstart:gpdb7:gpadmin-[INFO]:-Starting Coordinator instance in admin mode
20230721:16:45:00:001025 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
20230721:16:45:00:001025 gpstart:gpdb7:gpadmin-[INFO]:-Obtaining Greenplum Coordinator catalog information
20230721:16:45:00:001025 gpstart:gpdb7:gpadmin-[INFO]:-Obtaining Segment details from coordinator...
20230721:16:45:01:001025 gpstart:gpdb7:gpadmin-[INFO]:-Setting new coordinator era
20230721:16:45:01:001025 gpstart:gpdb7:gpadmin-[INFO]:-Coordinator Started...
20230721:16:45:02:001025 gpstart:gpdb7:gpadmin-[INFO]:-Shutting down coordinator
20230721:16:45:05:001025 gpstart:gpdb7:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait...
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-Process results...
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-----------------------------------------------------
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-   Successful segment starts                                            = 4
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-   Failed segment starts                                                = 0
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-----------------------------------------------------
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-Successfully started 4 of 4 segment instances 
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-----------------------------------------------------
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-Starting Coordinator instance gpdb7 directory /opt/greenplum/data/master/gpseg-1 
20230721:16:45:06:001025 gpstart:gpdb7:gpadmin-[INFO]:-CoordinatorStart pg_ctl cmd is env GPSESSID=0000000000 GPERA=cbcbcc7d30fa4b35_230721164501 $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
20230721:16:45:10:001025 gpstart:gpdb7:gpadmin-[INFO]:-Command pg_ctl reports Coordinator gpdb7 instance active
20230721:16:45:10:001025 gpstart:gpdb7:gpadmin-[INFO]:-Connecting to db template1 on host localhost
20230721:16:45:10:001025 gpstart:gpdb7:gpadmin-[INFO]:-Starting standby coordinator
20230721:16:45:10:001025 gpstart:gpdb7:gpadmin-[INFO]:-Checking if standby coordinator is running on host: gpdb7  in directory: /opt/greenplum/data/master_standby/gpseg-1
20230721:16:45:10:001025 gpstart:gpdb7:gpadmin-[INFO]:-CoordinatorStart pg_ctl cmd is env GPSESSID=0000000000 GPERA=cbcbcc7d30fa4b35_230721164501 $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
20230721:16:45:12:001025 gpstart:gpdb7:gpadmin-[INFO]:-Database successfully started

[gpadmin@gpdb7 ~]$ gpstate -e
20230721:16:55:56:005067 gpstate:gpdb7:gpadmin-[INFO]:-Starting gpstate with args: -e
20230721:16:55:56:005067 gpstate:gpdb7:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 7.0.0-beta.4 build commit:f3782c6dd89c9b6565a84518174ed4dd448f3293 Open Source'
20230721:16:55:56:005067 gpstate:gpdb7:gpadmin-[INFO]:-coordinator Greenplum Version: 'PostgreSQL 12.12 (Greenplum Database 7.0.0-beta.4 build commit:f3782c6dd89c9b6565a84518174ed4dd448f3293 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 Jun 15 2023 01:11:10 Bhuvnesh C.'
20230721:16:55:56:005067 gpstate:gpdb7:gpadmin-[INFO]:-Obtaining Segment details from coordinator...
20230721:16:55:56:005067 gpstate:gpdb7:gpadmin-[INFO]:-Gathering data from segments...
20230721:16:55:56:005067 gpstate:gpdb7:gpadmin-[INFO]:-----------------------------------------------------
20230721:16:55:56:005067 gpstate:gpdb7:gpadmin-[INFO]:-Segment Mirroring Status Report
20230721:16:55:57:005067 gpstate:gpdb7:gpadmin-[INFO]:-----------------------------------------------------
20230721:16:55:57:005067 gpstate:gpdb7:gpadmin-[INFO]:-All segments are running normally
[gpadmin@gpdb7 ~]$ 

GreenPlum使用

代码语言:javascript复制
[gpadmin@gpdb7 ~]$ psql
psql (12.12)
Type "help" for help.

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=# select version();
                                                                                                                          version                                                                                                                          
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 12.12 (Greenplum Database 7.0.0-beta.4 build commit:f3782c6dd89c9b6565a84518174ed4dd448f3293 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 Jun 15 2023 01:11:10 Bhuvnesh C.
(1 row)

postgres=# q

总结

1、需要rhel8

2、需要python 3.9

3、gpcc 6.9版本不支持GP7

参考

https://www.xmmup.com/greenplum7danjianzhuang.html

https://www.xmmup.com/greenplum-6-danjianzhuang.html

https://www.xmmup.com/yitiaominglingkuaisuqidonggreenplum.html

https://www.xmmup.com/mppjiagouzhigreenplumdeanzhuangpeizhigaojiban.html

https://www.xmmup.com/greenplumguanfangjiankonggongjugpccjianjiejishiyong.html

https://www.xmmup.com/greenplumguanfangjiankonggongjugpcc-6deanzhuanghexiezai.html

0 人点赞