原 在Docker中快速体验GreenPlum 6.23.1和gpcc监控工具
Tags: 原创GreenPlumDockergpcc体验快速
环境配置
地址:https://hub.docker.com/repository/docker/lhrbest/greenplum_gpcc/tags?page=1&ordering=last_updated
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | docker rm -f gpdb6 docker run -itd --name gpdb6 -h gpdb6 \ -p 5431:5432 -p 28088:28080 \ -v /sys/fs/cgroup:/sys/fs/cgroup \ --privileged=true lhrbest/greenplum_gpcc:6.23.1 \ /usr/sbin/init docker exec -it gpdb6 bash su - gpadmin gpstart -a gpcc start gpcc status gpstate |
此docker包括1个master,1个standby master,2个segment,2个mirror实例。
示例:
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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | [root@lhrdb ~]# docker exec -it gpdb6 bash [root@gpdb6 /]# su - gpadmin Last login: Fri Mar 10 10:53:49 CST 2023 on pts/2 [gpadmin@gpdb6 ~]$ gpstart -a 20230310:11:42:41:000281 gpstart:gpdb6:gpadmin-[INFO]:-Starting gpstart with args: -a 20230310:11:42:41:000281 gpstart:gpdb6:gpadmin-[INFO]:-Gathering information and validating the environment... 20230310:11:42:41:000281 gpstart:gpdb6:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 6.23.1 build commit:2731a45ecb364317207c560730cf9e2cbf17d7e4 Open Source' 20230310:11:42:41:000281 gpstart:gpdb6:gpadmin-[INFO]:-Greenplum Catalog Version: '301908232' 20230310:11:42:41:000281 gpstart:gpdb6:gpadmin-[INFO]:-Starting Master instance in admin mode 20230310:11:42:42:000281 gpstart:gpdb6:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information 20230310:11:42:42:000281 gpstart:gpdb6:gpadmin-[INFO]:-Obtaining Segment details from master... 20230310:11:42:42:000281 gpstart:gpdb6:gpadmin-[INFO]:-Setting new master era 20230310:11:42:42:000281 gpstart:gpdb6:gpadmin-[INFO]:-Master Started... 20230310:11:42:42:000281 gpstart:gpdb6:gpadmin-[INFO]:-Shutting down master 20230310:11:42:42:000281 gpstart:gpdb6:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait... . 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:-Process results... 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:----------------------------------------------------- 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:- Successful segment starts = 4 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:- Failed segment starts = 0 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) = 0 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:----------------------------------------------------- 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:-Successfully started 4 of 4 segment instances 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:----------------------------------------------------- 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:-Starting Master instance gpdb6 directory /opt/greenplum/data/master/gpseg-1 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:-Command pg_ctl reports Master gpdb6 instance active 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:-Connecting to dbname='template1' connect_timeout=15 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:-Starting standby master 20230310:11:42:44:000281 gpstart:gpdb6:gpadmin-[INFO]:-Checking if standby master is running on host: gpdb6 in directory: /opt/greenplum/data/master_standby/gpseg-1 20230310:11:42:45:000281 gpstart:gpdb6:gpadmin-[INFO]:-Database successfully started [gpadmin@gpdb6 ~]$ gpcc start 2023-03-10 11:42:50 Starting the gpcc agents and webserver... 2023-03-10 11:42:53 Agent successfully started on 1/1 hosts 2023-03-10 11:42:53 View Greenplum Command Center at http://gpdb6:28080 [gpadmin@gpdb6 ~]$ gpcc status 2023-03-10 11:42:57 GPCC webserver: running 2023-03-10 11:42:58 GPCC agents: 1/1 agents running [gpadmin@gpdb6 ~]$ gpstate 20230310:11:43:09:001214 gpstate:gpdb6:gpadmin-[INFO]:-Starting gpstate with args: 20230310:11:43:09:001214 gpstate:gpdb6:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 6.23.1 build commit:2731a45ecb364317207c560730cf9e2cbf17d7e4 Open Source' 20230310:11:43:09:001214 gpstate:gpdb6:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 9.4.26 (Greenplum Database 6.23.1 build commit:2731a45ecb364317207c560730cf9e2cbf17d7e4 Open Source) on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 6.4.0, 64-bit compiled on Feb 7 2023 22:54:40' 20230310:11:43:09:001214 gpstate:gpdb6:gpadmin-[INFO]:-Obtaining Segment details from master... 20230310:11:43:09:001214 gpstate:gpdb6:gpadmin-[INFO]:-Gathering data from segments... 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:-Greenplum instance status summary 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:----------------------------------------------------- 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Master instance = Active 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Master standby = gpdb6 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Standby master state = Standby host passive 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total segment instance count from metadata = 4 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:----------------------------------------------------- 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Primary Segment Status 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:----------------------------------------------------- 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total primary segments = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total primary segment valid (at master) = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total primary segment failures (at master) = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of postmaster.pid files missing = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of postmaster.pid files found = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of postmaster.pid PIDs missing = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of postmaster.pid PIDs found = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of /tmp lock files missing = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of /tmp lock files found = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number postmaster processes missing = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number postmaster processes found = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:----------------------------------------------------- 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Mirror Segment Status 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:----------------------------------------------------- 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total mirror segments = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total mirror segment valid (at master) = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total mirror segment failures (at master) = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of postmaster.pid files missing = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of postmaster.pid files found = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of postmaster.pid PIDs missing = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of postmaster.pid PIDs found = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of /tmp lock files missing = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number of /tmp lock files found = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number postmaster processes missing = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number postmaster processes found = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number mirror segments acting as primary segments = 0 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:- Total number mirror segments acting as mirror segments = 2 20230310:11:43:10:001214 gpstate:gpdb6:gpadmin-[INFO]:----------------------------------------------------- [gpadmin@gpdb6 ~]$ |
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 | [gpadmin@gpdb6 ~]$ psql psql (9.4.26) Type "help" for help. postgres=# \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+---------+----------+------------+------------+--------------------- gpperfmon | gpadmin | UTF8 | en_US.utf8 | en_US.utf8 | lhrgpdb | gpadmin | UTF8 | en_US.utf8 | en_US.utf8 | postgres | gpadmin | UTF8 | en_US.utf8 | en_US.utf8 | template0 | gpadmin | UTF8 | en_US.utf8 | en_US.utf8 | =c/gpadmin + | | | | | gpadmin=CTc/gpadmin template1 | gpadmin | UTF8 | en_US.utf8 | en_US.utf8 | =c/gpadmin + | | | | | gpadmin=CTc/gpadmin (5 rows) postgres=# select * from gp_segment_configuration ; dbid | content | role | preferred_role | mode | status | port | hostname | address | datadir ------+---------+------+----------------+------+--------+------+----------+---------+-------------------------------------------- 1 | -1 | p | p | n | u | 5432 | gpdb6 | gpdb6 | /opt/greenplum/data/master/gpseg-1 2 | 0 | p | p | s | u | 6000 | gpdb6 | gpdb6 | /opt/greenplum/data/primary/gpseg0 4 | 0 | m | m | s | u | 7000 | gpdb6 | gpdb6 | /opt/greenplum/data/mirror/gpseg0 3 | 1 | p | p | s | u | 6001 | gpdb6 | gpdb6 | /opt/greenplum/data/primary/gpseg1 5 | 1 | m | m | s | u | 7001 | gpdb6 | gpdb6 | /opt/greenplum/data/mirror/gpseg1 6 | -1 | m | m | s | u | 5433 | gpdb6 | gpdb6 | /opt/greenplum/data/master_standby/gpseg-1 (6 rows) postgres=# postgres=# select pg_sleep(9999); |
gpcc使用
http://172.18.0.14:28088 gpmon/lhr