原 GreenPlum删除mirror,需要删除gpseg目录,否则不能启动GP
现象
GP切换后,pg_clog堆积,导致磁盘目录满了
此时,可以只启动master,然后查看哪些是mirror实例,可以在主机上删除mirror,但是需要删除gpseg目录,否则不能启动
1 2 3 4 5 6 7 8 9 10 11 12 13 | 20241030:14:53:15:2254326 gpstop:openeuler22:gpadmin-[CRITICAL]:-Error occurred: non-zero rc: 2 Command was: '$GPHOME/bin/gpstart -a -d /opt/greenplum/data/master/gpseg-1' rc=2, stdout='20241030:14:53:07:2259500 gpstart:openeuler22:gpadmin-[INFO]:-Starting gpstart with args: -a -d /opt/greenplum/data/master/gpseg-1 20241030:14:53:11:2260323 gpsegstart.py_openeuler22:gpadmin:openeuler22:gpadmin-[CRITICAL]:-Error occurred: non-zero rc: 2 Command was: '$GPHOME/bin/pg_controldata /opt/greenplum/data/mirror/gpseg1' rc=2, stdout='', stderr='pg_controldata: could not open file "/opt/greenplum/data/mirror/gpseg1/global/pg_control" for reading: No such file or directory ' ' stderr=''' 20241030:14:53:11:2259500 gpstart:openeuler22:gpadmin-[INFO]:-DBID:4 FAILED host:'openeuler22' datadir:'/opt/greenplum/data/mirror/gpseg0' with reason:'cmd had rc=2 completed=True halted=False stdout='20241030:14:53:10:2260323 gpsegstart.py_openeuler22:gpadmin:openeuler22:gpadmin-[INFO]:-Starting gpsegstart.py with args: -M quiescent -V postgres (Greenplum Database) 6.28.0 build commit:dc1f64048a6b086d2a139a5b610ea2b04ec7b6c4 -n 2 --era 6fcbc4f9265ff2fb_241030145308 -t 600 --master-checksum-version 1 -p KGRwMApTJ2Ric0J5UG9ydCcKcDEKKGRwMgpJNjAwMAooZHAzClMndGFyZ2V0TW9kZScKcDQKUydwcmltYXJ5JwpwNQpzUydmdWxsUmVzeW5jRmxhZycKcDYKSTAwCnNTJ2hvc3ROYW1lJwpwNwpTJ29wZW5ldWxlcjIyJwpwOApzUydwZWVyTmFtZScKcDkKUydvcGVuZXVsZXIyMicKcDEwCnNTJ3BlZXJQTVBvcnQnCnAxMQpJNzAwMApzUydtb2RlJwpwMTIKUydzJwpwMTMKc1MnZGJpZCcKcDE0CkkyCnNzSTcwMDAKKGRwMTUKZzQKUydtaXJyb3InCnAxNgpzZzYKSTAwCnNnNwpnMTAKc2c5Cmc4CnNnMTEKSTYwMDAKc2cxMgpnMTMKc2cxNApJNApzc0k3MDAxCihkcDE3Cmc0CmcxNgpzZzYKSTAwCnNnNwpTJ29wZW5ldWxlcjIyJwpwMTgKc2c5ClMnb3BlbmV1bGVyMjInCnAxOQpzZzExCkk2MDAxCnNnMTIKZzEzCnNnMTQKSTUKc3NJNjAwMQooZHAyMApnNApnNQpzZzYKSTAwCnNnNwpnMTkKc2c5CmcxOApzZzExCkk3MDAxCnNnMTIKZzEzCnNnMTQKSTMKc3NzLg== -D 2|0|p|p|s|u|openeuler22|openeuler22|6000|/opt/greenplum/data/primary/gpseg0 -D 4|0|m|m|s|u|openeuler22|openeuler22|7000|/opt/greenplum/data/mirror/gpseg0 -D 3|1|p|p|s|u|openeuler22|openeuler22|6001|/opt/greenplum/data/primary/gpseg1 -D 5|1|m|m|s|u|openeuler22|openeuler22|7001|/opt/greenplum/data/mirror/gpseg1 -b 64 |
实验
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 | [root@openeuler22 /]# su - gpadmin Last login: Wed Oct 30 14:10:52 CST 2024 on pts/6 Welcome to 3.10.0-1160.95.1.el7.x86_64 System information as of time: Wed Oct 30 02:52:14 PM CST 2024 System load: 4.01 Processes: 94 Memory used: 29.8% Swap used: 34.3% Usage On: 57% IP address: 192.92.0.68 Users online: 0 To run a command as administrator(user "root"),use "sudo <command>". [gpadmin@openeuler22 ~]$ psql psql (9.4.26) Type "help" for help. postgres=# select * from gp_segment_configuration ; dbid | content | role | preferred_role | mode | status | port | hostname | address | datadir ------+---------+------+----------------+------+--------+------+-------------+-------------+-------------------------------------------- 1 | -1 | p | p | n | u | 5432 | openeuler22 | openeuler22 | /opt/greenplum/data/master/gpseg-1 2 | 0 | p | p | s | u | 6000 | openeuler22 | openeuler22 | /opt/greenplum/data/primary/gpseg0 4 | 0 | m | m | s | u | 7000 | openeuler22 | openeuler22 | /opt/greenplum/data/mirror/gpseg0 3 | 1 | p | p | s | u | 6001 | openeuler22 | openeuler22 | /opt/greenplum/data/primary/gpseg1 5 | 1 | m | m | s | u | 7001 | openeuler22 | openeuler22 | /opt/greenplum/data/mirror/gpseg1 6 | -1 | m | m | s | u | 5433 | openeuler22 | openeuler22 | /opt/greenplum/data/master_standby/gpseg-1 (6 rows) postgres=# \q [gpadmin@openeuler22 ~]$ [gpadmin@openeuler22 ~]$ [gpadmin@openeuler22 ~]$ cd /opt/greenplum/data/mirror/ [gpadmin@openeuler22 mirror]$ ll total 8 drwx------ 21 gpadmin gpadmin 4096 Oct 30 14:17 gpseg0 drwx------ 21 gpadmin gpadmin 4096 Oct 30 14:17 gpseg1 [gpadmin@openeuler22 mirror]$ rm -rf gpseg*/* [gpadmin@openeuler22 mirror]$ ll total 0 drwx------ 2 gpadmin gpadmin 6 Oct 30 14:52 gpseg0 drwx------ 2 gpadmin gpadmin 6 Oct 30 14:52 gpseg1 [gpadmin@openeuler22 mirror]$ du -sh . 0 . |