GreenPlum 数据库启动关闭及数据库状态检查

本篇文章主要记录GreenPlum数据库的启动、关闭及状态查询。GreenPlum数据库提供gpstart和gpstop脚本来启动和关闭数据库,可以通过—help参数来查看这些脚本的帮助信息。

01[gpadmin@mdw master]$ gpstart --help
02COMMAND NAME: gpstart
03Starts a Greenplum Database system.
04*****************************************************
05SYNOPSIS
06*****************************************************
07gpstart [-d <master_data_directory>] [-B <parallel_processes>]
08        [-R] [-m] [-y] [-a] [-t <timeout_seconds>]
09        [-l logfile_directory] [-v | -q]
10gpstart -? | -h | --help
11gpstart --version
12*****************************************************
13DESCRIPTION
14*****************************************************
15The gpstart utility is used to start the Greenplum Database server
16processes. When you start a Greenplum Database system, you are
17actually starting several postgres database server listener processes
18at once (the master and all of the segment instances). The gpstart utility
19handles the startup of the individual instances. Each instance is started
20in parallel.
21The first time an administrator runs gpstart, the utility creates a hosts
22cache file named .gphostcache in the user's home directory. Subsequently,
23the utility uses this list of hosts to start the system more efficiently.
24If new hosts are added to the system, you must manually remove this file
25from the gpadmin user's home directory. The utility will create a new hosts
26cache file at the next startup.
27Before you can start a Greenplum Database system, you must have initialized
28the system using gpinitsystem first.
29*****************************************************
30OPTIONS
31*****************************************************
32-a (do not prompt)
33  Do not prompt the user for confirmation.
34-B <parallel_processes>
35  The number of segments to start in parallel. If not specified,
36  the utility will start up to 64 parallel processes depending on
37  how many segment instances it needs to start.
38-d <master_data_directory>
39  Optional. The master host data directory. If not specified,
40  the value set for $MASTER_DATA_DIRECTORY will be used.
41-l <logfile_directory>
42  The directory to write the log file. Defaults to ~/gpAdminLogs.
43-m (master only)
44  Optional. Starts the master instance only, which may be necessary
45  for maintenance tasks. This mode only allows connections to the master
46  in utility mode. For example:
47  PGOPTIONS='-c gp_session_role=utility' psql
48  Note that starting the system in master-only mode is only advisable
49  under supervision of Greenplum support.  Improper use of this option
50  may lead to a split-brain condition and possible data loss.
51-q (no screen output)
52  Run in quiet mode. Command output is not displayed on the screen,
53  but is still written to the log file.
54-R (restricted mode)
55  Starts Greenplum Database in restricted mode (only database superusers
56  are allowed to connect).
57-t | --timeout <number_of_seconds>
58  Specifies a timeout in seconds to wait for a segment instance to
59  start up. If a segment instance was shutdown abnormally (due to
60  power failure or killing its postgres database listener process,
61  for example), it may take longer to start up due to the database
62  recovery and validation process. If not specified, the default timeout
63  is 60 seconds.
64-v (verbose output)
65  Displays detailed status, progress and error messages output by the utility.
66-y (do not start standby master)
67  Optional. Do not start the standby master host. The default is to start
68  the standby master host and synchronization process.
69-? | -h | --help (help)
70  Displays the online help.
71--version (show utility version)
72  Displays the version of this utility.
73*****************************************************
74EXAMPLES
75*****************************************************
76Start a Greenplum Database system:
77gpstart
78Start a Greenplum Database system in restricted mode
79(only allow superuser connections):
80gpstart -R
81Start the Greenplum master instance only and connect in utility mode:
82gpstart -m
83PGOPTIONS='-c gp_session_role=utility' psql
84Display the online help for the gpstart utility:
85gpstart -?
86*****************************************************
87SEE ALSO
88*****************************************************
89gpinitsystem, gpstop

常用的启动参数有以下几个参数:

-a,该模式不需要在启动过程中输入Y进行确认,将直接启动数据库。

-m,只启动Master节点,不启动Segment节点,通常在维护的时候使用。

-y,只启动Master的primary节点,不启动standby节点。

如下为GreenPlum数据库的启动过程。

01[gpadmin@mdw gpdb]$ gpstart -a
0220160114:10:56:18:013983 gpstart:mdw:gpadmin-[INFO]:-Starting gpstart with args: -a
0320160114:10:56:18:013983 gpstart:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
0420160114:10:56:18:013983 gpstart:mdw:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.3.6.2 build 1'
0520160114:10:56:18:013983 gpstart:mdw:gpadmin-[INFO]:-Greenplum Catalog Version: '201310150'
0620160114:10:56:18:013983 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance in admin mode
0720160114:10:56:19:013983 gpstart:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
0820160114:10:56:19:013983 gpstart:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
0920160114:10:56:19:013983 gpstart:mdw:gpadmin-[INFO]:-Setting new master era
1020160114:10:56:19:013983 gpstart:mdw:gpadmin-[INFO]:-Master Started...
1120160114:10:56:19:013983 gpstart:mdw:gpadmin-[INFO]:-Shutting down master
1220160114:10:56:21:013983 gpstart:mdw:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait
1320160114:10:56:23:013983 gpstart:mdw:gpadmin-[INFO]:-Process results...
1420160114:10:56:23:013983 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
1520160114:10:56:23:013983 gpstart:mdw:gpadmin-[INFO]:-   Successful segment starts      = 3
1620160114:10:56:23:013983 gpstart:mdw:gpadmin-[INFO]:-   Failed segment starts          = 0
1720160114:10:56:23:013983 gpstart:mdw:gpadmin-[INFO]:-   Skipped segment starts (segments are marked down in configuration)   = 0
1820160114:10:56:23:013983 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
1920160114:10:56:23:013983 gpstart:mdw:gpadmin-[INFO]:-
2020160114:10:56:23:013983 gpstart:mdw:gpadmin-[INFO]:-Successfully started 3 of 3 segment instances
2120160114:10:56:23:013983 gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
2220160114:10:56:23:013983 gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /gpdb/gpdata/master/gpseg-1
2320160114:10:56:24:013983 gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active
2420160114:10:56:24:013983 gpstart:mdw:gpadmin-[INFO]:-No standby master configured.  skipping...
2520160114:10:56:24:013983 gpstart:mdw:gpadmin-[INFO]:-Database successfully started

可以通过gpstate脚本来查看数据库的状态信息,该命令的帮助信息如下:

001[gpadmin@mdw master]$ gpstate --help
002\COMMAND NAME: gpstate
003Shows the status of a running Greenplum Database system.
004*****************************************************
005SYNOPSIS
006*****************************************************
007gpstate [-d <master_data_directory>] [-B <parallel_processes>]
008        [-s | -b | -Q | -e] [-m | -c] [-p] [-i] [-f]
009        [-v | -q] [-l <log_directory>]
010gpstate -? | -h | --help
011*****************************************************
012DESCRIPTION
013*****************************************************
014The gpstate utility displays information about a running
015Greenplum Database instance. There is additional information
016you may want to know about a Greenplum Database system, since
017it is comprised of multiple PostgreSQL database instances (segments)
018spanning multiple machines. The gpstate utility provides
019additional status information for a Greenplum Database system,
020such as:
021* Which segments are down.
022* Master and segment configuration information (hosts,
023  data directories, etc.).
024* The ports used by the system.
025* A mapping of primary segments to their corresponding
026  mirror segments.
027*****************************************************
028OPTIONS
029*****************************************************
030-b (brief status)
031  Optional. Display a brief summary of the state of the
032  Greenplum Database system. This is the default option.
033-B <parallel_processes>
034  The number of segments to check in parallel. If not specified,
035  the utility will start up to 60 parallel processes depending on
036  how many segment instances it needs to check.
037-c (show primary to mirror mappings)
038  Optional. Display mapping of primary segments to their
039  corresponding mirror segments.
040-d <master_data_directory>
041  Optional. The master data directory. If not specified, the
042  value set for $MASTER_DATA_DIRECTORY will be used.
043-e (show segments with mirror status issues)
044  Show details on primary/mirror segment pairs that have
045  potential issues such as 1) the active segment is running in
046  change tracking mode, meaning a segment is down 2) the active
047  segment is in resynchronization mode, meaning it is catching
048  up changes to the mirror 3) a segment is not in its preferred role,
049  for example a segment that was a primary at system initialization
050  time is now acting as a mirror, meaning you may have one or more
051  segment hosts with unbalanced processing load.
052-f (show standby master details)
053  Display details of the standby master host if configured.
054-i (show Greenplum Database version)
055  Display the Greenplum Database software version information
056  for each instance.
057-l <logfile_directory>
058  The directory to write the log file. Defaults to ~/gpAdminLogs.
059-m (list mirrors)
060   Optional. List the mirror segment instances in the system,
061  their current role, and synchronization status.
062-p (show ports)
063  List the port numbers used throughout the Greenplum Database
064  system.
065-q (no screen output)
066  Optional. Run in quiet mode. Except for warning messages, command
067  output is not displayed on the screen. However, this information
068  is still written to the log file.
069-Q (quick status)
070  Optional. Checks segment status in the system catalog on
071  the master host. Does not poll the segments for status.
072-s (detailed status)
073  Optional. Displays detailed status information for the
074  Greenplum Database system.
075-v (verbose output)
076  Optional. Displays error messages and outputs detailed status
077  and progress information.
078-? | -h | --help (help)
079  Displays the online help.
080*****************************************************
081OUTPUT DEFINITIONS FOR DETAIL VIEW
082*****************************************************
083+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
084MASTER OUTPUT DATA
085+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
086* Master host - host name of the master
087* Master postgres process ID - PID of the master postgres database
088                               listener process
089* Master data directory - file system location of the master data directory
090* Master port - port of the master database listener process
091* Master current role - dispatch = regular operating mode
092                        utility = maintenance mode
093* Greenplum array configuration type - Standard = one NIC per host
094                                       Multi-Home = multiple NICs per host
095* Greenplum initsystem version - version of Greenplum Database when
096                                 system was first initialized
097* Greenplum current version - current version of Greenplum Database
098* Postgres version - version of PostgreSQL that Greenplum Database
099                     is based on
100* Greenplum mirroring status - physical mirroring, SAN or none
101* Master standby - host name of the standby master
102* Standby master state - status of the standby master: active or passive
103+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
104SEGMENT OUTPUT DATA
105+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
106* Hostname - system-configured host name
107* Address - network address host name (NIC name)
108* Datadir - file system location of segment data directory
109* Port - port number of segment postgres database listener process
110* Current Role - current role of a segment: Mirror or Primary
111* Preferred Role - role at system initialization time: Mirror or Primary
112* Mirror Status - status of a primary/mirror segment pair:
113                Synchronized = data is up to date on both
114                Resynchronizing = data is currently being copied from one to the other
115                Change Tracking = segment down and active segment is logging changes
116* Change tracking data size - when in Change Tracking mode, the size of the change
117                            log file (may grow and shrink as compression is applied)
118* Estimated total data to synchronize - when in Resynchronization mode, the estimated
119                                      size of data left to syncronize
120* Data synchronized - when in Resynchronization mode, the estimated size of data
121                    that has already been syncronized
122* Estimated resync progress with mirror - when in Resynchronization mode, the
123                                        estimated percentage of completion
124* Estimated resync end time - when in Resynchronization mode, the estimated
125                            time to complete
126* File postmaster.pid - status of postmaster.pid lock file: Found or Missing
127* PID from postmaster.pid file - PID found in the postmaster.pid file
128* Lock files in /tmp - a segment port lock file for its postgres process is
129                       created in /tmp (file is removed when a segment shuts down)
130* Active PID - active process ID of a segment
131* Master reports status as - segment status as reported in the system catalog:
132                           Up or Down
133Database status - status of Greenplum Database to incoming requests:
134                Up, Down, or Suspended. A Suspended state means database
135                activity is temporarily paused while a segment transitions from
136                one state to another.
137*****************************************************
138EXAMPLES
139*****************************************************
140Show detailed status information of a Greenplum Database system:
141   gpstate -s
142Do a quick check for down segments in the master host system catalog:
143   gpstate -Q
144Show information about mirror segment instances:
145   gpstate -m
146Show information about the standby master configuration:
147   gpstate -f
148Display the Greenplum software version information:
149   gpstate -i
150*****************************************************
151SEE ALSO
152*****************************************************
153\

常用的参数如下:

-s,详细信息。

-m,Mirror信息。

-f,Master的Standby信息。

-e,Segment的Mirror信息。

-i,版本信息。

如下为数据库启动状态通过gpstate –s查询的数据库状态信息。

01[gpadmin@mdw gpdb]$ gpstate -s
0220160114:10:56:40:014082 gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args: -s
0320160114:10:56:40:014082 gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.3.6.2 build 1'
0420160114:10:56:40:014082 gpstate:mdw:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.2.15 (Greenplum Database 4.3.6.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Nov 12 2015 23:50:28'
0520160114:10:56:40:014082 gpstate:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
0620160114:10:56:40:014082 gpstate:mdw:gpadmin-[INFO]:-Gathering data from segments...
07.
0820160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
0920160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:--Master Configuration & Status
1020160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
1120160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Master host                    = mdw
1220160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Master postgres process ID     = 14042
1320160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Master data directory          = /gpdb/gpdata/master/gpseg-1
1420160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Master port                    = 5432
1520160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Master current role            = dispatch
1620160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Greenplum initsystem version   = 4.3.6.2 build 1
1720160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Greenplum current version      = PostgreSQL 8.2.15 (Greenplum Database 4.3.6.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Nov 12 2015 23:50:28
1820160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Postgres version               = 8.2.15
1920160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Master standby                 = No master standby configured
2020160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
2120160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-Segment Instance Status Report
2220160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
2320160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Segment Info
2420160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Hostname                          = sdw1
2520160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Address                           = sdw1
2620160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Datadir                           = /gpdb/gpdata/primary/gpseg0
2720160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Port                              = 40000
2820160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Status
2920160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      PID                               = 17195
3020160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Configuration reports status as   = Up
3120160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Database status                   = Up
3220160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
3320160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Segment Info
3420160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Hostname                          = sdw2
3520160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Address                           = sdw2
3620160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Datadir                           = /gpdb/gpdata/primary/gpseg1
3720160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Port                              = 40000
3820160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Status
3920160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      PID                               = 17111
4020160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Configuration reports status as   = Up
4120160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Database status                   = Up
4220160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
4320160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Segment Info
4420160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Hostname                          = sdw3
4520160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Address                           = sdw3
4620160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Datadir                           = /gpdb/gpdata/primary/gpseg2
4720160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Port                              = 40000
4820160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-   Status
4920160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      PID                               = 23033
5020160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Configuration reports status as   = Up
5120160114:10:56:41:014082 gpstate:mdw:gpadmin-[INFO]:-      Database status                   = Up

gpstop脚本用来关闭、重启、加载新修改的参数以至生效等功能,下面是gpstop命令的帮助信息。

001[gpadmin@mdw master]$ gpstop --help
002COMMAND NAME: gpstop
003Stops or restarts a Greenplum Database system.
004*****************************************************
005SYNOPSIS
006*****************************************************
007gpstop [-d <master_data_directory>] [-B <parallel_processes>]
008       [-M smart | fast | immediate] [-t <timeout_seconds>]
009       [-r] [-y] [-a] [-l <logfile_directory>] [-v | -q]
010gpstop -m [-d <master_data_directory>] [-y] [-l <logfile_directory>]
011       [-v | -q]
012gpstop -u [-d <master_data_directory>] [-l <logfile_directory>]
013          [-v | -q]
014gpstop --version
015gpstop -? | -h | --help
016*****************************************************
017DESCRIPTION
018*****************************************************
019The gpstop utility is used to stop the database servers that
020comprise a Greenplum Database system. When you stop a Greenplum
021Database system, you are actually stopping several postgres
022database server processes at once (the master and all of the
023segment instances). The gpstop utility handles the shutdown
024of the individual instances. Each instance is shutdown in parallel.
025By default, you are not allowed to shut down Greenplum Database
026if there are any client connections to the database. Use
027the -M fast option to roll back and terminate any connections
028before shutting down. If there are any transactions in progress,
029the default behavior is to wait for them to commit before
030shutting down. Use the -M fast option to roll back open
031transactions.
032With the -u option, the utility uploads changes made to the
033master pg_hba.conf file or to runtime configuration parameters
034in the master postgresql.conf file without interruption of
035service. Note that any active sessions will not pickup the
036changes until they reconnect to the database.
037*****************************************************
038OPTIONS
039*****************************************************
040-a (do not prompt)
041 Do not prompt the user for confirmation.
042-B <parallel_processes>
043 The number of segments to stop in parallel. If not specified,
044 the utility will start up to 64 parallel processes depending
045 on how many segment instances it needs to stop.
046-d <master_data_directory>
047 Optional. The master host data directory. If not specified,
048 the value set for $MASTER_DATA_DIRECTORY will be used.
049-l <logfile_directory>
050 The directory to write the log file. Defaults to ~/gpAdminLogs.
051-m (master only)
052 Optional. Shuts down a Greenplum master instance that was
053 started in maintenance mode.
054-M fast (fast shutdown - rollback)
055 Fast shut down. Any transactions in progress are interrupted  and rolled back.
056-M immediate (immediate shutdown - abort)
057 Immediate shut down. Any transactions in progress are aborted. This
058 shutdown mode is not recommended, and in some circumstances can cause
059 database corruption requiring manual recovery.
060 This mode kills all postgres processes without allowing the database
061 server to complete transaction processing or clean up any temporary or
062 in-process work files.
063-M smart (smart shutdown - warn)
064  Smart shut down. If there are active connections, this command
065 fails with a warning. This is the default shutdown mode.
066-q (no screen output)
067 Run in quiet mode. Command output is not displayed on the
068 screen, but is still written to the log file.
069-r (restart)
070 Restart after shutdown is complete.
071-t <timeout_seconds>
072 Specifies a timeout threshold (in seconds) to wait for a
073 segment instance to shutdown. If a segment instance does not
074 shutdown in the specified number of seconds, gpstop displays
075 a message indicating that one or more segments are still in
076 the process of shutting down and that you cannot restart
077 Greenplum Database until the segment instance(s) are stopped.
078 This option is useful in situations where gpstop is executed
079 and there are very large transactions that need to rollback.
080 These large transactions can take over a minute to rollback
081 and surpass the default timeout period of 600 seconds.
082-u (reload pg_hba.conf and postgresql.conf files only)
083 This option reloads the pg_hba.conf files of the master and
084 segments and the runtime parameters of the postgresql.conf files
085 but does not shutdown the Greenplum Database array. Use this
086 option to make new configuration settings active after editing
087 postgresql.conf or pg_hba.conf. Note that this only applies to
088 configuration parameters that are designated as runtime parameters.
089-v (verbose output)
090 Displays detailed status, progress and error messages output
091 by the utility.
092--version (show utility version)
093 Displays the version of this utility.
094-y (do not stop standby master)
095 Do not stop the standby master process. The default is to stop  the standby master.
096-? | -h | --help (help)
097 Displays the online help.
098*****************************************************
099EXAMPLES
100*****************************************************
101Stop a Greenplum Database system in smart mode:
102  gpstop
103Stop a Greenplum Database system in fast mode:
104  gpstop -M fast
105Stop all segment instances and then restart the system:
106  gpstop -r
107Stop a master instance that was started in maintenance mode:
108  gpstop -m
109Reload the postgresql.conf and pg_hba.conf files after
110making runtime configuration parameter changes but do not
111shutdown the Greenplum Database array:
112  gpstop -u
113*****************************************************
114SEE ALSO
115*****************************************************
116gpstart

常用的参数如下:

-a,不需要输入Y确认是否关闭,将直接关闭数据库。

-m,只关闭Master节点。

-r,重启数据库。

-u,加载参数文件,使修改的参数生效。

-M,设置关闭数据库的级别,有三种级别,fast、immediate和smart,gpstop –M fast,所有连接将中断并且回滚。gpstop –M immediate,强制关闭数据库,这种方式是不一致的关闭模式,不建议使用。Immediate smart,这是默认的关闭级别,所有连接的会话会收到关闭警告,不允许新链接访问数据库。下面是默认级别关闭GreenPlum数据库的相关信息。

01[gpadmin@mdw gpdb]$ gpstop -a
0220160114:10:55:17:013853 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -a
0320160114:10:55:17:013853 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
0420160114:10:55:17:013853 gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
0520160114:10:55:17:013853 gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
0620160114:10:55:17:013853 gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.3.6.2 build 1'
0720160114:10:55:17:013853 gpstop:mdw:gpadmin-[INFO]:-There are 0 connections to the database
0820160114:10:55:17:013853 gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart'
0920160114:10:55:17:013853 gpstop:mdw:gpadmin-[INFO]:-Master host=mdw
1020160114:10:55:17:013853 gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=smart
1120160114:10:55:17:013853 gpstop:mdw:gpadmin-[INFO]:-Master segment instance directory=/gpdb/gpdata/master/gpseg-1
1220160114:10:55:18:013853 gpstop:mdw:gpadmin-[INFO]:-Attempting forceful termination of any leftover master process
1320160114:10:55:18:013853 gpstop:mdw:gpadmin-[INFO]:-Terminating processes for segment /gpdb/gpdata/master/gpseg-1
1420160114:10:55:18:013853 gpstop:mdw:gpadmin-[INFO]:-No standby master host configured
1520160114:10:55:18:013853 gpstop:mdw:gpadmin-[INFO]:-Commencing parallel segment instance shutdown, please wait...
1620160114:10:55:18:013853 gpstop:mdw:gpadmin-[INFO]:-0.00% of jobs completed
1720160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-100.00% of jobs completed
1820160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-----------------------------------------------------
1920160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-   Segments stopped successfully      = 3
2020160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-   Segments with errors during stop   = 0
2120160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-----------------------------------------------------
2220160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-Successfully shutdown 3 of 3 segment instances
2320160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-Database successfully shutdown with no errors reported
2420160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-Cleaning up leftover gpmmon process
2520160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-No leftover gpmmon process found
2620160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-Cleaning up leftover gpsmon processes
2720160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-No leftover gpsmon processes on some hosts. not attempting forceful termination on these hosts
2820160114:10:55:28:013853 gpstop:mdw:gpadmin-[INFO]:-Cleaning up leftover shared memory

 

本文固定链接: http://www.dbdream.com.cn/2016/01/greenplum%e6%95%b0%e6%8d%ae%e5%ba%93%e5%90%af%e5%8a%a8%e5%85%b3%e9%97%ad%e5%8f%8a%e6%95%b0%e6%8d%ae%e5%ba%93%e7%8a%b6%e6%80%81%e6%a3%80%e6%9f%a5/ | 信春哥,系统稳,闭眼上线不回滚!

转载于:https://www.cnblogs.com/xibuhaohao/p/11131117.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值