在Docker中快速体验GreenPlum 7.0.0和gpcc 7.0.0

2023-11-16 12:23:52 浏览数 (2)

简介

GreenPlum 7.0.0正式版已于2023.09.29发布,基于PG 12.12内核版本。

一个月后,在2023.10.30日发布了gpcc 7.0.0版本,可以用来监控GreenPlum 7.0.0的数据库。

相关新特性请参考:https://www.xmmup.com/greenplum-7-xintexingzhengli.html

环境配置

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

代码语言:javascript复制
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.

示例:

代码语言: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
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使用

代码语言:javascript复制
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使用

http://192.168.8.8/28080

gpmon/lhr

总结

1、需要rhel8

2、需要python 3.9

3、gpcc 6.9版本不支持GP7,需要使用gpcc 7的版本才能监控gpdb 7

4、gpdb 7.0.0不要使用GitHub的版本,应该直接安装官方的版本,否则没有gppkg程序,从安装包上来说,少了将近70M的,没有仔细比对到底少了啥

代码语言:javascript复制
[root@lhrdb greenplum]# ll -h *7.0.0*
-rw-r--r-- 1 root root  78M Nov 13 10:56 greenplum-cc-web-7.0.0-gp7-el8-x86_64.zip
-rw-r--r-- 1 root root 124M Nov 13 13:09 greenplum-db-7.0.0-el8-x86_64.rpm
-rw-r--r-- 1 root root  53M Oct  9 11:05 open-source-greenplum-db-7.0.0-el8-x86_64.rpm

参考

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 人点赞