日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

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

發布時間:2023/12/14 数据库 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 GreenPlum 数据库启动关闭及数据库状态检查 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

本篇文章主要記錄GreenPlum數據庫的啟動、關閉及狀態查詢。GreenPlum數據庫提供gpstart和gpstop腳本來啟動和關閉數據庫,可以通過—help參數來查看這些腳本的幫助信息。

view source
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數據庫的啟動過程。

view source
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腳本來查看數據庫的狀態信息,該命令的幫助信息如下:

view source
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查詢的數據庫狀態信息。

view source
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命令的幫助信息。

view source
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數據庫的相關信息。

view source
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

總結

以上是生活随笔為你收集整理的GreenPlum 数据库启动关闭及数据库状态检查的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。