gpstart -a => 快速启动|
gpstart -d => 指定数据目录(默认值:$MASTER_DATA_DIRECTORY)
gpstart -q => 在安静模式下运行。命令输出不显示在屏幕,但仍然写入日志文件。
gpstart -m => 以维护模式连接到Master进行目录维护。例如:$ PGOPTIONS='-c gp_session_role=utility' psql postgres
gpstart -R => 管理员连接
gpstart -v => 显示详细启动信息
[gpadmin@mdw ~]$ gpstart -a 20200419:01:04:39:002525 gpstart:mdw:gpadmin-[INFO]:-Starting gpstart with args: -a 20200419:01:04:39:002525 gpstart:mdw:gpadmin-[INFO]:-Gathering information and validating the environment... 20200419:01:04:39:002525 gpstart:mdw:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 5.10.2 build commit:b3c02f3acd880e2d676dacea36be015e4a3826d4' 20200419:01:04:39:002525 gpstart:mdw:gpadmin-[INFO]:-Greenplum Catalog Version: '301705051' 20200419:01:04:39:002525 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance in admin mode 20200419:01:04:40:002525 gpstart:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information 20200419:01:04:40:002525 gpstart:mdw:gpadmin-[INFO]:-Obtaining Segment details from master... 20200419:01:04:40:002525 gpstart:mdw:gpadmin-[INFO]:-Setting new master era 20200419:01:04:40:002525 gpstart:mdw:gpadmin-[INFO]:-Master Started... 20200419:01:04:40:002525 gpstart:mdw:gpadmin-[INFO]:-Shutting down master 20200419:01:04:41:002525 gpstart:mdw:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait... .. 20200419:01:04:43:002525 gpstart:mdw:gpadmin-[INFO]:-Process results... 20200419:01:04:43:002525 gpstart:mdw:gpadmin-[INFO]:----------------------------------------------------- 20200419:01:04:43:002525 gpstart:mdw:gpadmin-[INFO]:- Successful segment starts = 12 20200419:01:04:43:002525 gpstart:mdw:gpadmin-[INFO]:- Failed segment starts = 0 20200419:01:04:43:002525 gpstart:mdw:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) = 0 20200419:01:04:43:002525 gpstart:mdw:gpadmin-[INFO]:----------------------------------------------------- 20200419:01:04:43:002525 gpstart:mdw:gpadmin-[INFO]:-Successfully started 12 of 12 segment instances 20200419:01:04:43:002525 gpstart:mdw:gpadmin-[INFO]:----------------------------------------------------- 20200419:01:04:43:002525 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /greenplum/gpdata/master/gpseg-1 20200419:01:04:44:002525 gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active 20200419:01:04:45:002525 gpstart:mdw:gpadmin-[INFO]:-Starting standby master 20200419:01:04:45:002525 gpstart:mdw:gpadmin-[INFO]:-Checking if standby master is running on host: smdw in directory: /greenplum/gpdata/master/gpseg-1 20200419:01:04:45:002525 gpstart:mdw:gpadmin-[WARNING]:-Unable to cleanup previously started standby: 'Warning: the ECDSA host key for 'smdw' differs from the key for the IP address '10.102.254.26' Offending key for IP in /home/gpadmin/.ssh/known_hosts:1 Matching host key in /home/gpadmin/.ssh/known_hosts:9 ' 20200419:01:04:46:002525 gpstart:mdw:gpadmin-[INFO]:-Database successfully started |
gpstop
命令 参数 作用
gpstop -a => 快速停止
gpstop -d => 指定数据目录(默认值:$MASTER_DATA_DIRECTORY)
gpstop -m => 维护模式
gpstop -q => 在安静模式下运行。命令输出不显示在屏幕,但仍然写入日志文件。
gpstop -r => 停止所有实例,然后重启系统
gpstop -u => 重新加载配置文件 postgresql.conf 和 pg_hba.conf
gpstop -v => 显示详细启动信息
gpstop -M fast => 快速关闭。正在进行的任何事务都被中断。然后滚回去。
gpstop -M immediate => 立即关闭。正在进行的任何事务都被中止。不推荐这种关闭模式,并且在某些情况下可能导致数据库损坏需要手动恢复。
gpstop -M smart => 智能关闭。如果存在活动连接,则此命令在警告时失败。这是默认的关机模式。
gpstop --host hostname => 停用segments数据节点,不能与-m、-r、-u、-y同时使用
[gpadmin@mdw ~]$ gpstop -a 20200419:01:03:34:002356 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -a 20200419:01:03:34:002356 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment... 20200419:01:03:34:002356 gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information 20200419:01:03:34:002356 gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master... 20200419:01:03:34:002356 gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 5.10.2 build commit:b3c02f3acd880e2d676dacea36be015e4a3826d4' 20200419:01:03:34:002356 gpstop:mdw:gpadmin-[INFO]:-There are 0 connections to the database 20200419:01:03:34:002356 gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart' 20200419:01:03:34:002356 gpstop:mdw:gpadmin-[INFO]:-Master host=mdw 20200419:01:03:34:002356 gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=smart 20200419:01:03:34:002356 gpstop:mdw:gpadmin-[INFO]:-Master segment instance directory=/greenplum/gpdata/master/gpseg-1 20200419:01:03:35:002356 gpstop:mdw:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process 20200419:01:03:35:002356 gpstop:mdw:gpadmin-[INFO]:-Terminating processes for segment /greenplum/gpdata/master/gpseg-1 20200419:01:03:35:002356 gpstop:mdw:gpadmin-[INFO]:-Stopping master standby host smdw mode=fast 20200419:01:03:36:002356 gpstop:mdw:gpadmin-[INFO]:-Successfully shutdown standby process on smdw 20200419:01:03:36:002356 gpstop:mdw:gpadmin-[INFO]:-Targeting dbid [2, 8, 3, 9, 4, 10, 5, 11, 6, 12, 7, 13] for shutdown 20200419:01:03:36:002356 gpstop:mdw:gpadmin-[INFO]:-Commencing parallel primary segment instance shutdown, please wait... 20200419:01:03:36:002356 gpstop:mdw:gpadmin-[INFO]:-0.00% of jobs completed 20200419:01:03:38:002356 gpstop:mdw:gpadmin-[INFO]:-100.00% of jobs completed 20200419:01:03:38:002356 gpstop:mdw:gpadmin-[INFO]:-Commencing parallel mirror segment instance shutdown, please wait... 20200419:01:03:38:002356 gpstop:mdw:gpadmin-[INFO]:-0.00% of jobs completed 20200419:01:03:39:002356 gpstop:mdw:gpadmin-[INFO]:-100.00% of jobs completed 20200419:01:03:39:002356 gpstop:mdw:gpadmin-[INFO]:----------------------------------------------------- 20200419:01:03:39:002356 gpstop:mdw:gpadmin-[INFO]:- Segments stopped successfully = 12 20200419:01:03:39:002356 gpstop:mdw:gpadmin-[INFO]:- Segments with errors during stop = 0 20200419:01:03:39:002356 gpstop:mdw:gpadmin-[INFO]:----------------------------------------------------- 20200419:01:03:39:002356 gpstop:mdw:gpadmin-[INFO]:-Successfully shutdown 12 of 12 segment instances 20200419:01:03:39:002356 gpstop:mdw:gpadmin-[INFO]:-Database successfully shutdown with no errors reported 20200419:01:03:39:002356 gpstop:mdw:gpadmin-[INFO]:-Cleaning up leftover gpmmon process 20200419:01:03:39:002356 gpstop:mdw:gpadmin-[INFO]:-No leftover gpmmon process found 20200419:01:03:39:002356 gpstop:mdw:gpadmin-[INFO]:-Cleaning up leftover gpsmon processes 20200419:01:03:40:002356 gpstop:mdw:gpadmin-[INFO]:-No leftover gpsmon processes on some hosts. not attempting forceful termination on these hosts 20200419:01:03:40:002356 gpstop:mdw:gpadmin-[INFO]:-Cleaning up leftover shared memory
|