环境:greenplum 6.10.1 on centos7.6
参考文献:https://postgres.fun/20190808152100.html
正常关闭gp
[gpadmin@node1 ~]$ gpstop -M fast 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:-Starting gpstop with args: -M fast 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:-Gathering information and validating the environment... 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:-Obtaining Segment details from master... 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 6.10.1 build commit:efba04ce26ebb29b535a255a5e95d1f5ebfde94e Open Source' 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:--------------------------------------------- 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:-Master instance parameters 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:--------------------------------------------- 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- Master Greenplum instance process active PID = 327482 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- Database = template1 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- Master port = 5432 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- Master directory = /pgdata/master/gpseg-1 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- Shutdown mode = fast 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- Timeout = 120 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- Shutdown Master standby host = Off 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:--------------------------------------------- 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:-Segment instances that will be shutdown: 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:--------------------------------------------- 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- Host Datadir Port Status 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- node3 /pgdata/primary/gpseg0 6000 u 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- node4 /pgdata/mirror/gpseg0 7000 u 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- node3 /pgdata/primary/gpseg1 6001 u 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- node4 /pgdata/mirror/gpseg1 7001 u 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- node4 /pgdata/primary/gpseg2 6000 u 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- node3 /pgdata/mirror/gpseg2 7000 u 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- node4 /pgdata/primary/gpseg3 6001 u 20201016:15:31:22:119514 gpstop:node1:gpadmin-[INFO]:- node3 /pgdata/mirror/gpseg3 7001 u Continue with Greenplum instance shutdown Yy|Nn (default=N): > YY Invalid input: 'YY' Continue with Greenplum instance shutdown Yy|Nn (default=N): > y 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='fast' 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-Master segment instance directory=/pgdata/master/gpseg-1 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-Terminating processes for segment /pgdata/master/gpseg-1 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-No standby master host configured 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-Targeting dbid [2, 6, 3, 7, 4, 8, 5, 9] for shutdown 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-Commencing parallel primary segment instance shutdown, please wait... 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-0.00% of jobs completed 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-100.00% of jobs completed 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-Commencing parallel mirror segment instance shutdown, please wait... 20201016:15:31:26:119514 gpstop:node1:gpadmin-[INFO]:-0.00% of jobs completed 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:-100.00% of jobs completed 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:----------------------------------------------------- 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:- Segments stopped successfully = 8 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:- Segments with errors during stop = 0 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:----------------------------------------------------- 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:-Successfully shutdown 8 of 8 segment instances 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:-Database successfully shutdown with no errors reported 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:-Cleaning up leftover gpmmon process 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:-No leftover gpmmon process found 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:-Cleaning up leftover gpsmon processes 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:-No leftover gpsmon processes on some hosts. not attempting forceful termination on these hosts 20201016:15:31:27:119514 gpstop:node1:gpadmin-[INFO]:-Cleaning up leftover shared memory
再启动后报错:
[gpadmin@node1 ~]$ gpstart 20201016:15:32:01:119719 gpstart:node1:gpadmin-[INFO]:-Starting gpstart with args: 20201016:15:32:01:119719 gpstart:node1:gpadmin-[INFO]:-Gathering information and validating the environment... 20201016:15:32:01:119719 gpstart:node1:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 6.10.1 build commit:efba04ce26ebb29b535a255a5e95d1f5ebfde94e Open Source' 20201016:15:32:01:119719 gpstart:node1:gpadmin-[INFO]:-Greenplum Catalog Version: '301908232' 20201016:15:32:01:119719 gpstart:node1:gpadmin-[INFO]:-Starting Master instance in admin mode 20201016:15:32:01:119719 gpstart:node1:gpadmin-[CRITICAL]:-Failed to start Master instance in admin mode 20201016:15:32:01:119719 gpstart:node1:gpadmin-[CRITICAL]:-Error occurred: non-zero rc: 1 Command was: 'env GPSESSID=0000000000 GPERA=None $GPHOME/bin/pg_ctl -D /pgdata/master/gpseg-1 -l /pgdata/master/gpseg-1/pg_log/startup.log -w -t 600 -o " -p 5432 -c gp_role=utility " start' rc=1, stdout='waiting for server to start.... stopped waiting ', stderr='pg_ctl: could not start server Examine the log output. '
查找错误原因
[gpadmin@node1 pg_log]$ pwd /pgdata/master/gpseg-1/pg_log sterBackgroundWorker","bgworker.c",774, 2020-10-13 14:16:49.533063 CST,,,p327482,th1345067136,,,,0,,,seg-1,,,,,"LOG","00000","registering background worker ""sweeper process""",,,,,,,,"RegisterBackgroundWorker","bgworker.c",774, 2020-10-13 14:16:49.633791 CST,,,p327482,th1345067136,,,,0,,,seg-1,,,,,"LOG","00000","redirecting log output to logging collector process",,"Future log output will appear in directory ""pg_log"".",,,,,,"SysLogger_Start","syslogger.c",989, ŠœÓ€ˆ”tcfÿÿÿÿÿÿÿÿtt~”ÿÿÿÿÿÿÿÿÿÿÿÿLOG00000postgres: max_wal_senders must be less than max_connections Š±Ó€è’tcf`ÿÿÿÿÿÿÿÿÿttÿÿÿÿÿÿÿÿÿÿÿÿLOG00000postgres: max_wal_senders must be less than max_connections Š*Û ÝtcfÝ!ÿÿÿÿÿÿÿÿttÚÿÿÿÿÿÿÿÿÿÿÿÿLOG00000postgres: max_wal_senders must be less than max_connections ŠuÛ€h, tcf XÿÿÿÿÿÿÿÿttÿÿÿÿÿÿÿÿÿÿÿÿLOG00000postgres: max_wal_senders must be less than max_connections Š…Û€è_’tcf’¦ÿÿÿÿÿÿÿÿttÿÿÿÿÿÿÿÿÿÿÿÿLOG00000postgres: max_wal_senders must be less than max_connections ŠéÛ€ÈuîtcfÿÿÿÿÿÿÿÿttWîÿÿÿÿÿÿÿÿÿÿÿÿLOG00000postgres: max_wal_senders must be less than max_connections ŠÃÞ€¸|îtcfîÿÿÿÿÿÿÿÿttÿÿÿÿÿÿÿÿÿÿÿÿLOG00000postgres: max_wal_senders must be less than max_connections
报错信息很明确。postgres的参数max_wal_senders 比 max_connections
解决措施,修改postgres的参数文件,并重启:
[gpadmin@node1 gpseg-1]$ vi postgresql.conf max_connections=20
[gpadmin@node1 gpseg-1]$ gpstart
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Starting gpstart with args:
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Gathering information and validating the environment...
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 6.10.1 build commit:efba04ce26ebb29b535a255a5e95d1f5ebfde94e Open Source'
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Greenplum Catalog Version: '301908232'
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Starting Master instance in admin mode
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Obtaining Segment details from master...
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Setting new master era
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Master Started...
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Shutting down master
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:---------------------------
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Master instance parameters
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:---------------------------
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Database = template1
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Master Port = 5432
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Master directory = /pgdata/master/gpseg-1
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Timeout = 600 seconds
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Master standby = Off
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:---------------------------------------
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:-Segment instances that will be started
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:---------------------------------------
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:- Host Datadir Port Role
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:- node3 /pgdata/primary/gpseg0 6000 Primary
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:- node4 /pgdata/mirror/gpseg0 7000 Mirror
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:- node3 /pgdata/primary/gpseg1 6001 Primary
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:- node4 /pgdata/mirror/gpseg1 7001 Mirror
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:- node4 /pgdata/primary/gpseg2 6000 Primary
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:- node3 /pgdata/mirror/gpseg2 7000 Mirror
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:- node4 /pgdata/primary/gpseg3 6001 Primary
20201016:16:19:57:122788 gpstart:node1:gpadmin-[INFO]:- node3 /pgdata/mirror/gpseg3 7001 Mirror
Continue with Greenplum instance startup Yy|Nn (default=N):
> y
20201016:16:20:03:122788 gpstart:node1:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait...
20201016:16:20:03:122788 gpstart:node1:gpadmin-[INFO]:-Process results...
20201016:16:20:03:122788 gpstart:node1:gpadmin-[INFO]:-----------------------------------------------------
20201016:16:20:03:122788 gpstart:node1:gpadmin-[INFO]:- Successful segment starts = 8
20201016:16:20:03:122788 gpstart:node1:gpadmin-[INFO]:- Failed segment starts = 0
20201016:16:20:03:122788 gpstart:node1:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) = 0
20201016:16:20:03:122788 gpstart:node1:gpadmin-[INFO]:-----------------------------------------------------
20201016:16:20:03:122788 gpstart:node1:gpadmin-[INFO]:-Successfully started 8 of 8 segment instances
20201016:16:20:03:122788 gpstart:node1:gpadmin-[INFO]:-----------------------------------------------------
20201016:16:20:03:122788 gpstart:node1:gpadmin-[INFO]:-Starting Master instance node1 directory /pgdata/master/gpseg-1
20201016:16:20:04:122788 gpstart:node1:gpadmin-[INFO]:-Command pg_ctl reports Master node1 instance active
20201016:16:20:04:122788 gpstart:node1:gpadmin-[INFO]:-Connecting to dbname='template1' connect_timeout=15
20201016:16:20:04:122788 gpstart:node1:gpadmin-[INFO]:-No standby master configured. skipping...
20201016:16:20:04:122788 gpstart:node1:gpadmin-[INFO]:-Database successfully started
[gpadmin@node1 gpseg-1]$