一,操作命令
01,啟動gpstart
參數說明

COMMAND NAME: gpstart Starts a Greenplum Database system. ***************************************************** SYNOPSIS ***************************************************** gpstart [-d <master_data_directory>] [-B <parallel_processes>] [-R] [-m] [-y] [-a] [-t <timeout_seconds>] [-l logfile_directory] [-v | -q] gpstart -? | -h | --help gpstart --version ***************************************************** DESCRIPTION ***************************************************** The gpstart utility is used to start the Greenplum Database server processes. When you start a Greenplum Database system, you are actually starting several postgres database server listener processes at once (the master and all of the segment instances). The gpstart utility handles the startup of the individual instances. Each instance is started in parallel. The first time an administrator runs gpstart, the utility creates a hosts cache file named .gphostcache in the user's home directory. Subsequently, the utility uses this list of hosts to start the system more efficiently. If new hosts are added to the system, you must manually remove this file from the gpadmin user's home directory. The utility will create a new hosts cache file at the next startup. Before you can start a Greenplum Database system, you must have initialized the system using gpinitsystem first. ***************************************************** OPTIONS ***************************************************** -a Do not prompt the user for confirmation. -B <parallel_processes> The number of segments to start in parallel. If not specified, the utility will start up to 64 parallel processes depending on how many segment instances it needs to start. -d <master_data_directory> Optional. The master host data directory. If not specified, the value set for $MASTER_DATA_DIRECTORY will be used. -l <logfile_directory> The directory to write the log file. Defaults to ~/gpAdminLogs. -m Optional. Starts the master instance only, which may be necessary for maintenance tasks. This mode only allows connections to the master in utility mode. For example: PGOPTIONS='-c gp_session_role=utility' psql Note that starting the system in master-only mode is only advisable under supervision of Greenplum support. Improper use of this option may lead to a split-brain condition and possible data loss. -q Run in quiet mode. Command output is not displayed on the screen, but is still written to the log file. -R Starts Greenplum Database in restricted mode (only database superusers are allowed to connect). -t | --timeout <number_of_seconds> Specifies a timeout in seconds to wait for a segment instance to start up. If a segment instance was shutdown abnormally (due to power failure or killing its postgres database listener process, for example), it may take longer to start up due to the database recovery and validation process. If not specified, the default timeout is 60 seconds. -v Displays detailed status, progress and error messages output by the utility. -y Optional. Do not start the standby master host. The default is to start the standby master host and synchronization process. -? | -h | --help Displays the online help. --version Displays the version of this utility.
操作實例
gpstart -m 只啟動master gpstart -a -y 正常啟動不提示確定信息,同時不啟動master standy
執行過程
1 1)獲取環境變量,如GPHOME, MASTER_DATA_DIRECTORY等信息。 2 3 2)檢查Greenplum的版本,如果gpstart腳本的版本與數據目錄的Greenplum版本不一致,則報錯退出。 4 5 3)通過Master的postgresql.conf配置文件,獲取端口等信息,並通過這個端口檢查 Master是否已經啟動,主要檢查"/tmp/s.PGSQL.端口號”這個文件,還要通過netstat檢查端口是否存在,如果Master正常運行,則報錯退出。如果Master端口已經停止但仍有殘留文件,那么刪除相關文件,啟動Master並停止。 6 7 4)通過utility模式啟動Master,然后通過gp segment configuration表獲取Segment和 Standy Master的信息,檢查子節點是否有被標記為Down的情況 . 8 9 5)停止Master,並啟動Standy Master (如果有)。 10 11 6)通過ping命令檢查每個Segment所在機器的網絡連接是否正常,然后並行啟動 Segment進程(啟動Segment通過ssh命令,調用SGPHOME/sbin/gpsegstart.py命令啟動,啟動的環境變量跟Master一致),並行度可以設置,默認是64個並發。 12 13 7)檢查Segment啟動情況,確定是否滿足集群啟動條件(所有的主備Segment至少有一個可以啟動),如果有一個Segment的主備無法啟動,則所有的Segment都會被停止,然后報錯退出。 14 15 8)前面步驟都正常則開始啟動Master,檢查Master的運行狀態(pg ctl status獲取狀態信息,同時嘗試連接Master並釋放) (注意,如果GP由於異常關閉,進入recovery模式,則連接Master消耗時間會長一些)。 16 17 9) Greenplum啟動成功。
02,停止gpstop
參數說明

1 COMMAND NAME: gpstop 2 3 Stops or restarts a Greenplum Database system. 4 5 6 ***************************************************** 7 SYNOPSIS 8 ***************************************************** 9 10 gpstop [-d <master_data_directory>] [-B <parallel_processes>] 11 [-M smart | fast | immediate] [-t <timeout_seconds>] 12 [-r] [-y] [-a] [-l <logfile_directory>] [-v | -q] 13 14 gpstop -m [-d <master_data_directory>] [-y] [-l <logfile_directory>] 15 [-v | -q] 16 17 gpstop -u [-d <master_data_directory>] [-l <logfile_directory>] 18 [-v | -q] 19 20 gpstop --host <segment_host_name> [-d <master_data_directory>] 21 [-l <logfile_directory>] [-t <timeout_seconds>] [-a] 22 [-v | -q] 23 24 gpstop --version 25 26 gpstop -? | -h | --help 27 28 29 ***************************************************** 30 DESCRIPTION 31 ***************************************************** 32 33 The gpstop utility is used to stop the database servers that 34 comprise a Greenplum Database system. When you stop a Greenplum 35 Database system, you are actually stopping several postgres 36 database server processes at once (the master and all of the 37 segment instances). The gpstop utility handles the shutdown 38 of the individual instances. Each instance is shutdown in parallel. 39 40 By default, you are not allowed to shut down Greenplum Database 41 if there are any client connections to the database. Use 42 the -M fast option to roll back and terminate any connections 43 before shutting down. If there are any transactions in progress, 44 the default behavior is to wait for them to commit before 45 shutting down. Use the -M fast option to roll back open 46 transactions. 47 48 With the -u option, the utility uploads changes made to the 49 master pg_hba.conf file or to runtime configuration parameters 50 in the master postgresql.conf file without interruption of 51 service. Note that any active sessions will not pickup the 52 changes until they reconnect to the database. 53 54 ***************************************************** 55 OPTIONS 56 ***************************************************** 57 58 -a 59 60 Do not prompt the user for confirmation. 61 62 63 -B <parallel_processes> 64 65 The number of segments to stop in parallel. If not specified, 66 the utility will start up to 64 parallel processes depending 67 on how many segment instances it needs to stop. 68 69 70 -d <master_data_directory> 71 72 Optional. The master host data directory. If not specified, 73 the value set for $MASTER_DATA_DIRECTORY will be used. 74 75 76 --host <segment_host_name> 77 78 Stop all segments on this host. Specify segment_host_name as 79 it is displayed in gp_segment_configuration. 80 81 This cannot be used together with `-m`, `-r`, `-u`, or 82 `-y` options. 83 84 This will only complete if failover segments are available. 85 This will fail if the system doesn't have mirrors. It will also 86 fail if the specified host has a master or standby master on 87 it. It will also fail if the specified host has both a primary 88 and its corresponding mirror on it, the same host. 89 90 91 -l <logfile_directory> 92 93 The directory to write the log file. Defaults to ~/gpAdminLogs. 94 95 96 -m 97 98 Optional. Shuts down a Greenplum master instance that was 99 started in maintenance mode. 100 101 102 -M fast 103 104 Fast shut down. Any transactions in progress are interrupted 105 and rolled back. 106 107 108 -M immediate 109 110 Immediate shut down. Any transactions in progress are aborted. This 111 shutdown mode is not recommended, and in some circumstances can cause 112 database corruption requiring manual recovery. 113 114 This mode kills all postgres processes without allowing the database 115 server to complete transaction processing or clean up any temporary or 116 in-process work files. 117 118 119 -M smart 120 121 Smart shut down. If there are active connections, this command 122 fails with a warning. This is the default shutdown mode. 123 124 125 -q 126 127 Run in quiet mode. Command output is not displayed on the 128 screen, but is still written to the log file. 129 130 131 -r 132 133 Restart after shutdown is complete. 134 135 -t <timeout_seconds> 136 137 Specifies a timeout threshold (in seconds) to wait for a 138 segment instance to shutdown. If a segment instance does not 139 shutdown in the specified number of seconds, gpstop displays 140 a message indicating that one or more segments are still in 141 the process of shutting down and that you cannot restart 142 Greenplum Database until the segment instance(s) are stopped. 143 This option is useful in situations where gpstop is executed 144 and there are very large transactions that need to rollback. 145 These large transactions can take over a minute to rollback 146 and surpass the default timeout period of 600 seconds. 147 148 149 -u 150 151 This option reloads the pg_hba.conf files of the master and 152 segments and the runtime parameters of the postgresql.conf files 153 but does not shutdown the Greenplum Database array. Use this 154 option to make new configuration settings active after editing 155 postgresql.conf or pg_hba.conf. Note that this only applies to 156 configuration parameters that are designated as runtime parameters. 157 158 159 -v 160 161 Displays detailed status, progress and error messages output 162 by the utility. 163 164 165 --version 166 167 Displays the version of this utility. 168 169 170 -y 171 172 Do not stop the standby master process. The default is to stop 173 the standby master. 174 175 176 -? | -h | --help 177 178 Displays the online help.
操作實例
1 智能模式下停止Greenplum數據庫系統: 2 3 gpstop 4 5 在快速模式下停止一個Greenplum數據庫系統: 6 7 gpstop - M fast 8 9 停止所有segment實例,然后重啟系統: 10 11 gpstop - r 12 13 停止在維護模式下啟動的主實例: 14 15 gpstop - m 16 17 在保持的同時,停止特定主機上的所有段 18 19 其他主機: 20 21 gpstop --host sdw1 22 23 重新加載配置 24 25 gpstop -u 26 27 重啟數據庫 28 29 gpstop -af
執行過程
1)還是何前面一樣檢查環境變量和數據庫版本 2)在master獲取segment信息,然后單獨停止停止master. 3)停止備份Master. 4)也檢查網絡是否正常,然后並行通過$GPHOME/sbin/gpsegstop py腳本停止所有的segments,停止primary segment,然后停止mirror Segment. 5)停止數據庫成功,打印出簡單的報告。
03,初始化系統腳本gpinitsystem
參數說明

1 OMMAND NAME: gpinitsystem 2 3 Initializes a Greenplum Database system by using configuration 4 parameters specified in a configuration file (gp_init_config). 5 6 7 ***************************************************** 8 SYNOPSIS 9 ***************************************************** 10 11 gpinitsystem -c <gpinitsystem_config> 12 [-h <hostfile_gpinitsystem>] 13 [-B <parallel_processes>] 14 [-p <postgresql_conf_param_file>] 15 [-s <standby_master_host> 16 [-P <standby_master_port>] [-F <standby_master_filespaces>]] 17 [--max_connections=<number>] [--shared_buffers=<size>] 18 [--locale=<locale>] [--lc-collate=<locale>] 19 [--lc-ctype=<locale>] [--lc-messages=<locale>] 20 [--lc-monetary=<locale>] [--lc-numeric=<locale>] 21 [--lc-time=<locale>] [--su_password=<password>] 22 [-S] [-a] [-q] [-l <logfile_directory>] [-D] 23 24 ***************************************************** 25 OPTIONS 26 ***************************************************** 27 28 -a 29 30 Do not prompt the user for confirmation. 31 32 33 -B <parallel_processes> 34 35 The number of segments to create in parallel. If not specified, 36 the utility will start up to 4 parallel processes at a time. 37 38 39 -c <gpinitsystem_config> 40 41 Required. The full path and filename of the configuration file, which 42 contains all of the defined parameters to configure and initialize a 43 new Greenplum system. See INITIALIZATION CONFIGURATION FILE FORMAT below. 44 45 -D 46 47 Sets log output level to debug. 48 49 50 -h <hostfile_gpinitsystem> 51 52 Optional. The full path and file name of a file that contains the host 53 addresses of your segment hosts. If not specified on the command line, 54 you can specify the host file using the MACHINE_LIST_FILE parameter 55 in the gpinitsystem_config file. 56 57 58 --locale=<locale> | -n <locale> 59 60 Sets the default locale used by Greenplum Database. If not specified, 61 the LC_ALL, LC_COLLATE, or LANG environment variable of the master 62 host determines the locale. If these are not set, the default locale 63 is C (POSIX). A locale identifier consists of a language identifier 64 and a region identifier, and optionally a character set encoding. 65 For example, sv_SE is Swedish as spoken in Sweden, en_US is U.S. 66 English, and fr_CA is French Canadian. If more than one character 67 set can be useful for a locale, then the specifications look like 68 this: en_US.UTF-8 (locale specification and character set encoding). 69 On most systems, the command locale will show the locale environment 70 settings and locale -a will show a list of all available locales. 71 72 73 --lc-collate=<locale> 74 75 Similar to --locale, but sets the locale used for collation (sorting data). 76 The sort order cannot be changed after Greenplum Database is initialized, 77 so it is important to choose a collation locale that is compatible with 78 the character set encodings that you plan to use for your data. There is a 79 special collation name of C or POSIX (byte-order sorting as opposed to 80 dictionary-order sorting). The C collation can be used with any 81 character encoding. 82 83 84 --lc-ctype=<locale> 85 86 Similar to --locale, but sets the locale used for character classification 87 (what character sequences are valid and how they are interpreted). This 88 cannot be changed after Greenplum Database is initialized, so it is 89 important to choose a character classification locale that is compatible 90 with the data you plan to store in Greenplum Database. 91 92 93 --lc-messages=<locale> 94 95 Similar to --locale, but sets the locale used for messages output by 96 Greenplum Database. The current version of Greenplum Database does not 97 support multiple locales for output messages (all messages are in English), 98 so changing this setting will not have any effect. 99 100 101 --lc-monetary=<locale> 102 103 Similar to --locale, but sets the locale used for formatting currency amounts. 104 105 106 --lc-numeric=<locale> 107 108 Similar to --locale, but sets the locale used for formatting numbers. 109 110 111 --lc-time=<locale> 112 113 Similar to --locale, but sets the locale used for formatting dates and times. 114 115 116 -l <logfile_directory> 117 118 The directory to write the log file. Defaults to ~/gpAdminLogs. 119 120 121 --max_connections=<number> | -m <number> 122 123 Sets the maximum number of client connections allowed to the master. 124 The default is 25. 125 126 127 -p <postgresql_conf_param_file> 128 129 Optional. The name of a file that contains postgresql.conf parameter 130 settings that you want to set for Greenplum Database. These settings 131 will be used when the individual master and segment instances are 132 initialized. You can also set parameters after initialization using 133 the gpconfig utility. 134 135 136 -q 137 138 Run in quiet mode. Command output is not displayed on the screen, 139 but is still written to the log file. 140 141 142 --shared_buffers=<size> | -b <size> 143 144 Sets the amount of memory a Greenplum server instance uses for shared 145 memory buffers. You can specify sizing in kilobytes (kB), megabytes (MB) 146 or gigabytes (GB). The default is 125MB. 147 148 149 -s <standby_master_host> 150 151 Optional. If you wish to configure a backup master host, specify the 152 host name using this option. The Greenplum Database software must 153 already be installed and configured on this host. 154 155 156 -P <standby_master_port> 157 158 Optional and effective only when specified with -s. This option can 159 specify the port to be used by the standby master. The default value 160 is the same as the primary master. 161 162 163 -F <standby_master_filespace> 164 165 Optional and effective only when specified with -s. This option can 166 specify the filespace mappings. 167 168 169 --su_password=<superuser_password> | -e <superuser_password> 170 171 The password to set for the Greenplum Database superuser. Defaults 172 to 'gparray'. You can always change the superuser password at a 173 later time using the ALTER ROLE command. Client connections over 174 the network require a password login for the database superuser 175 account (for example, the gpadmin user). 176 177 Best practises: Always use passwords, do not use default passwords, 178 change default passwords immediately after installation. 179 180 181 -S 182 183 If mirroring parameters are specified, spreads the mirror segments 184 across the available hosts. The default is to group the set of mirror 185 segments together on an alternate host from their primary segment set. 186 Mirror spreading will place each mirror on a different host within the 187 Greenplum Database array. Spreading is only allowed if there is a 188 sufficient number of hosts in the array (number of hosts is greater 189 than the number of segment instances). 190 191 192 -v | --version 193 194 Displays the version of this utility. 195 196 197 --help 198 199 Displays the online help.
操作實例

***************************************************** EXAMPLES ***************************************************** 通過提供配置文件初始化Greenplum數據庫數組和segment主機地址文件,並設置一個擴展鏡像(-S) 配置:: $ gpinitsystem -c gpinitsystem_config -h hostfile_gpinitsystem -S 初始化一個Greenplum數據庫數組並設置超級用戶遠程密碼: $ gpinitsystem -c gpinitsystem_config -h hostfile_gpinitsystem --su-password=mypass word 用一個可選的備用主主機初始化一個Greenplum數據庫數組: $ gpinitsystem -c gpinitsystem_config -h hostfile_gpinitsystem -s host09
執行過程
1)讀取配置信息,檢查所有機器上的端口是否被占用,數據目錄是否存在等,並且初始化系統的配置信息。 2)調用initdb命令創建Master數據庫。 3)使用utility模式啟動Master,修改postgresq.conf文件,更新響應的配置信息。 4)在Master上初始化集群配置信息表,如gp segment configuration, gp_filespace_ entry等。 5)並行創建Primary Segment,之后並行創建Mirror Segment (也是使用initdb命令)。 6)初始化Standy Master.7)停止Master並啟動數據庫。 8)安裝gp toolkit工具箱。 9)修改超級用戶密碼(用戶名默認是操作系統用戶名)。
04,集群操作命令gpssh和gpscp
表層意思已經很明白了
gpssh

1 gpssh { -f <hostfile_gpssh> | -h <hostname> [-h <hostname> ...] } 2 [-u userid] [-s] [-v] [-e] [-d seconds] [-t multiplier] [<bash_command>] 3 4 5 ***************************************************** 6 OPTIONS 7 ***************************************************** 8 9 <bash_command> 10 11 A bash shell command to execute on all hosts involved in this 12 session (optionally enclosed in quotes). If not specified, gpssh 13 will start an interactive session. 14 15 16 -d (delay) seconds 17 18 Optional. Specifies the time, in seconds, to wait at the start of a 19 gpssh interaction with ssh. Default is 0.05. This option overrides the 20 delaybeforesend value that is specified in the gpssh.conf configuration 21 file. 22 23 Increasing this value can cause a long wait time during gpssh startup. 24 25 26 -e (echo) 27 28 Optional. Echoes the commands passed to each host and their 29 resulting output while running in non-interactive mode. 30 31 32 -f <hostfile_gpssh> 33 34 Specifies the name of a file that contains a list of hosts that 35 will participate in this SSH session. The host name is required. 36 The syntax of the host file is one host per line as follows: 37 38 <hostname> 39 40 41 -h <hostname> 42 43 Specifies a single host name that will participate in this SSH session. 44 You can use the -h option multiple times to specify multiple host names. 45 46 47 -s 48 49 Optional. If specified, before executing any commands on the target 50 host, gpssh sources the file greenplum_path.sh in the directory 51 specified by the $GPHOME environment variable. 52 53 This option is valid for both interactive mode and single command mode. 54 55 56 -t multiplier 57 58 Optional. A decimal number greater than 0 (zero) that is the multiplier 59 for the timeout that gpssh uses when validating the ssh prompt. Default 60 is 1. This option overrides the prompt_validation_timeout value that is 61 specified in the gpssh.conf configuration file. 62 63 Increasing this value has a small impact during gpssh startup. 64 65 66 -u <userid> 67 68 Specifies the userid for this SSH session. 69 70 71 -v (verbose mode) 72 73 Optional. Reports additional messages in addition to the command 74 output when running in non-interactive mode. 75 76 77 --version 78 79 Displays the version of this utility. 80 81 82 -? (help) 83 84 Displays the online help.
-c 結果顯示執行的命令 -f hostname 配置文件 -h 指定host,單台執行 <bash_command> 后面接執行的命令

1 ***************************************************** 2 EXAMPLES 3 ***************************************************** 4 5 Start an interactive group SSH session with all hosts listed 6 in the file hostfile_gpssh: 7 8 $ gpssh -f hostfile_gpssh 9 10 11 At the gpssh interactive command prompt, run a shell command 12 on all the hosts involved in this session. 13 14 => ls -a /data/primary/* 15 16 Exit an interactive session: 17 18 => exit 19 20 21 Start a non-interactive group SSH session with the hosts named 22 sdw1 and sdw2 and pass a file containing several commands 23 named command_file to gpssh: 24 25 $ gpssh -h sdw1 -h sdw2 -v -e < command_file 26 27 28 Execute single commands in non-interactive mode on hosts 29 sdw2 and localhost: 30 31 $ gpssh -h sdw2 -h localhost -v -e 'ls -a /data/primary/*' 32 33 $ gpssh -h sdw2 -h localhost -v -e 'echo $GPHOME' 34 35 $ gpssh -h sdw2 -h localhost -v -e 'ls -1 | wc -l'
gpscp

1 gpscp { -f <hostfile_gpssh> | -h <hostname> [-h <hostname> ...] } 2 [-J <character>] [-v] [[<user>@]<hostname>:]<file_to_copy> [...] 3 [[<user>@]<hostname>:]<copy_to_path> 4 5 6 7 ***************************************************** 8 OPTIONS 9 ***************************************************** 10 11 12 -f <hostfile_gpssh> 13 14 Specifies the name of a file that contains a list of hosts 15 that will participate in this SCP session. The syntax of the 16 host file is one host per line as follows: 17 18 <hostname> 19 20 -h <hostname> 21 22 Specifies a single host name that will participate in this 23 SCP session. You can use the -h option multiple times to 24 specify multiple host names. 25 26 27 -J <character> 28 29 The -J option allows you to specify a single character to 30 substitute for the hostname in the copy from and to destination 31 strings. If -J is not specified, the default substitution 32 character is an equal sign (=). 33 34 -v (verbose mode) 35 36 Optional. Reports additional messages in addition to the 37 SCP command output. 38 39 <file_to_copy> 40 41 Required. The file name (or absolute path) of a file that 42 you want to copy to other hosts (or file locations). This 43 can be either a file on the local host or on another named 44 host. 45 46 <copy_to_path> 47 48 Required. The path where you want the file(s) to be copied 49 on the named hosts. If an absolute path is not used, the 50 file will be copied relative to $HOME of the session user. You 51 can also use the equal sign '=' (or another character that you 52 specify with the -J option) in place of a hostname. This will 53 then substitute in each host name as specified in the supplied 54 host file (-f) or with the -h option. 55 56 -? (help) 57 58 Displays the online help. 59 60 --version 61 62 Displays the version of this utility.
文件復制到另一台服務器
操作命令與gpssh 參數相似
***************************************************** EXAMPLES ***************************************************** Copy the file named installer.tar to / on all the hosts in the file host_file. gpscp -f host_file installer.tar =:/ Copy the file named myfuncs.so to the specified location on the hosts named sdw1 and sdw2: gpscp -h sdw1 -h sdw2 myfuncs.so \ =:/usr/local/greenplum-db/lib
04,數據庫狀態檢查gpstate
顯示正在運行的實例運行狀態.比如:
哪些數據庫失敗
master與segment 的配置信息
數據庫使用的端口
主segment與備segmengt的對應關系
在Gprecovery恢復后,數據的恢復進度
參數說明

1 COMMAND NAME: gpstate 2 3 Shows the status of a running Greenplum Database system. 4 5 6 ***************************************************** 7 SYNOPSIS 8 ***************************************************** 9 10 gpstate [-d <master_data_directory>] [-B <parallel_processes>] 11 [-s | -b | -Q | -e] [-m | -c] [-p] [-i] [-f] 12 [-v | -q] [-l <log_directory>] 13 14 15 gpstate -? | -h | --help 16 17 ***************************************************** 18 DESCRIPTION 19 ***************************************************** 20 21 The gpstate utility displays information about a running 22 Greenplum Database instance. There is additional information 23 you may want to know about a Greenplum Database system, since 24 it is comprised of multiple PostgreSQL database instances (segments) 25 spanning multiple machines. The gpstate utility provides 26 additional status information for a Greenplum Database system, 27 such as: 28 * Which segments are down. 29 * Master and segment configuration information (hosts, 30 data directories, etc.). 31 * The ports used by the system. 32 * A mapping of primary segments to their corresponding 33 mirror segments. 34 35 ***************************************************** 36 OPTIONS 37 ***************************************************** 38 39 -b (brief status) 40 41 Optional. Display a brief summary of the state of the 42 Greenplum Database system. This is the default option. 43 44 45 -B <parallel_processes> 46 47 The number of segments to check in parallel. If not specified, 48 the utility will start up to 60 parallel processes depending on 49 how many segment instances it needs to check. 50 51 52 -c (show primary to mirror mappings) 53 54 Optional. Display mapping of primary segments to their 55 corresponding mirror segments. 56 57 58 -d <master_data_directory> 59 60 Optional. The master data directory. If not specified, the 61 value set for $MASTER_DATA_DIRECTORY will be used. 62 63 64 -e (show segments with mirror status issues) 65 66 Show details on primary/mirror segment pairs that have 67 potential issues such as 1) the active segment is running in 68 change tracking mode, meaning a segment is down 2) the active 69 segment is in resynchronization mode, meaning it is catching 70 up changes to the mirror 3) a segment is not in its preferred role, 71 for example a segment that was a primary at system initialization 72 time is now acting as a mirror, meaning you may have one or more 73 segment hosts with unbalanced processing load. 74 75 76 -f (show standby master details) 77 78 Display details of the standby master host if configured. 79 80 81 -i (show Greenplum Database version) 82 83 Display the Greenplum Database software version information 84 for each instance. 85 86 87 -l <logfile_directory> 88 89 The directory to write the log file. Defaults to ~/gpAdminLogs. 90 91 92 -m (list mirrors) 93 94 Optional. List the mirror segment instances in the system, 95 their current role, and synchronization status. 96 97 98 -p (show ports) 99 100 List the port numbers used throughout the Greenplum Database 101 system. 102 103 104 -q (no screen output) 105 106 Optional. Run in quiet mode. Except for warning messages, command 107 output is not displayed on the screen. However, this information 108 is still written to the log file. 109 110 111 -Q (quick status) 112 113 Optional. Checks segment status in the system catalog on 114 the master host. Does not poll the segments for status. 115 116 117 -s (detailed status) 118 119 Optional. Displays detailed status information for the 120 Greenplum Database system. 121 122 123 -v (verbose output) 124 125 Optional. Displays error messages and outputs detailed status 126 and progress information. 127 128 129 -? | -h | --help (help) 130 131 Displays the online help. 132 133 134 ***************************************************** 135 OUTPUT DEFINITIONS FOR DETAIL VIEW 136 ***************************************************** 137 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 138 MASTER OUTPUT DATA 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 140 141 * Master host - host name of the master 142 143 * Master postgres process ID - PID of the master postgres database 144 listener process 145 146 * Master data directory - file system location of the master data directory 147 148 * Master port - port of the master database listener process 149 150 * Master current role - dispatch = regular operating mode 151 utility = maintenance mode 152 153 * Greenplum array configuration type - Standard = one NIC per host 154 Multi-Home = multiple NICs per host 155 156 * Greenplum initsystem version - version of Greenplum Database when 157 system was first initialized 158 159 * Greenplum current version - current version of Greenplum Database 160 161 * Postgres version - version of PostgreSQL that Greenplum Database 162 is based on 163 164 * Greenplum mirroring status - physical mirroring, SAN or none 165 166 * Master standby - host name of the standby master 167 168 * Standby master state - status of the standby master: active or passive 169 170 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 171 SEGMENT OUTPUT DATA 172 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 173 174 * Hostname - system-configured host name 175 176 * Address - network address host name (NIC name) 177 178 * Datadir - file system location of segment data directory 179 180 * Port - port number of segment postgres database listener process 181 182 * Current Role - current role of a segment: Mirror or Primary 183 184 * Preferred Role - role at system initialization time: Mirror or Primary 185 186 * Mirror Status - status of a primary/mirror segment pair: 187 Synchronized = data is up to date on both 188 Resynchronizing = data is currently being copied from one to the other 189 Change Tracking = segment down and active segment is logging changes 190 191 * Change tracking data size - when in Change Tracking mode, the size of the change 192 log file (may grow and shrink as compression is applied) 193 194 * Estimated total data to synchronize - when in Resynchronization mode, the estimated 195 size of data left to syncronize 196 197 * Data synchronized - when in Resynchronization mode, the estimated size of data 198 that has already been syncronized 199 200 * Estimated resync progress with mirror - when in Resynchronization mode, the 201 estimated percentage of completion 202 203 * Estimated resync end time - when in Resynchronization mode, the estimated 204 time to complete 205 206 * File postmaster.pid - status of postmaster.pid lock file: Found or Missing 207 208 * PID from postmaster.pid file - PID found in the postmaster.pid file 209 210 * Lock files in /tmp - a segment port lock file for its postgres process is 211 created in /tmp (file is removed when a segment shuts down) 212 213 * Active PID - active process ID of a segment 214 215 * Master reports status as - segment status as reported in the system catalog: 216 Up or Down 217 218 Database status - status of Greenplum Database to incoming requests: 219 Up, Down, or Suspended. A Suspended state means database 220 activity is temporarily paused while a segment transitions from 221 one state to another.
實例說明:
顯示一個Greenplum數據庫系統的詳細狀態信息: gpstate -s 快速檢查master節點中down了的segments: gpstate -Q 顯示有關mirror segment 實例的信息: gpstate -m 顯示有關備用主配置的信息: gpstate -f 顯示Greenplum軟件版本信息: gpstate -i
操作結果:

1 [gpadmin@greenplum01 ~]$ gpstate -s 2 20190321:11:03:40:013465 gpstate:greenplum01:gpadmin-[INFO]:-Starting gpstate with args: -s 3 20190321:11:03:40:013465 gpstate:greenplum01:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 5.16.0build commit:23cec7df0406d69d6552a4bbb77035dba4d7dd44' 4 20190321:11:03:40:013465 gpstate:greenplum01:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.3.23 (Greenplum Database 5.16.0 build commit:23cec7df0406d69d6552a4bbb77035dba4d7dd44) on x86_64-pc-linux-gnu, compiled by GCC gcc (GCC) 6.2.0, 64-bit compiled on Jan 16 2019 02:32:15' 5 20190321:11:03:40:013465 gpstate:greenplum01:gpadmin-[INFO]:-Obtaining Segment details from master... 6 20190321:11:03:40:013465 gpstate:greenplum01:gpadmin-[INFO]:-Gathering data from segments... 7 .. 8 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 9 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:--Master Configuration & Status 10 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 11 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master host = greenplum01 12 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master postgres process ID = 5730 13 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master data directory = /greenplum/data/master/gpseg-1 14 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master port = 5432 15 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master current role = dispatch 16 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Greenplum initsystem version = 5.16.0 build commit:23cec7df0406d69d6552a4bbb77035dba4d7dd44 17 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Greenplum current version = PostgreSQL 8.3.23 (Greenplum Database 5.16.0 build commit:23cec7df0406d69d6552a4bbb77035dba4d7dd44) on x86_64-pc-linux-gnu, compiled by GCC gcc (GCC) 6.2.0, 64-bit compiled on Jan 16 2019 02:32:15 18 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Postgres version = 8.3.23 19 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master standby = No master standby configured 20 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 21 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-Segment Instance Status Report 22 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 23 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 24 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02 25 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02 26 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/primary/gpseg0 27 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6000 28 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 29 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary 30 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary 31 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 32 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 33 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16347 34 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 35 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up 36 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 37 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 38 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03 39 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03 40 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/mirror/gpseg0 41 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43000 42 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 43 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror 44 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror 45 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 46 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 47 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16624 48 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 49 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up 50 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 51 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 52 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02 53 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02 54 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/primary/gpseg1 55 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6001 56 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 57 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary 58 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary 59 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 60 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 61 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16341 62 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 63 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up 64 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 65 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 66 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03 67 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03 68 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/mirror/gpseg1 69 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43001 70 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 71 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror 72 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror 73 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 74 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 75 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16628 76 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 77 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up 78 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 79 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 80 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02 81 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02 82 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/primary/gpseg2 83 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6002 84 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 85 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary 86 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary 87 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 88 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 89 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16352 90 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 91 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up 92 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 93 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 94 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03 95 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03 96 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/mirror/gpseg2 97 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43002 98 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 99 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror 100 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror 101 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 102 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 103 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16623 104 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 105 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up 106 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 107 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 108 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02 109 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02 110 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/primary/gpseg3 111 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6003 112 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 113 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary 114 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary 115 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 116 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 117 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16348 118 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 119 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up 120 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 121 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 122 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03 123 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03 124 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/mirror/gpseg3 125 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43003 126 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 127 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror 128 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror 129 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 130 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 131 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16620 132 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 133 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up 134 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 135 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 136 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03 137 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03 138 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/primary/gpseg4 139 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6000 140 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 141 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary 142 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary 143 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 144 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 145 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16626 146 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 147 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up 148 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 149 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 150 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02 151 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02 152 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/mirror/gpseg4 153 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43000 154 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 155 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror 156 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror 157 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 158 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 159 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16350 160 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 161 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up 162 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 163 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 164 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03 165 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03 166 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/primary/gpseg5 167 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6001 168 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 169 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary 170 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary 171 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 172 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 173 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16622 174 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 175 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up 176 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 177 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 178 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02 179 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02 180 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/mirror/gpseg5 181 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43001 182 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 183 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror 184 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror 185 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 186 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 187 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16353 188 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 189 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up 190 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 191 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 192 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03 193 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03 194 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/primary/gpseg6 195 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6002 196 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 197 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary 198 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary 199 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 200 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 201 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16627 202 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 203 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up 204 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 205 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 206 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02 207 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02 208 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/mirror/gpseg6 209 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43002 210 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 211 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror 212 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror 213 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 214 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 215 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16346 216 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 217 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up 218 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 219 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 220 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03 221 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03 222 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/primary/gpseg7 223 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6003 224 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 225 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary 226 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary 227 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 228 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 229 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16619 230 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 231 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up 232 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:----------------------------------------------------- 233 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info 234 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02 235 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02 236 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/mirror/gpseg7 237 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43003 238 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info 239 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror 240 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror 241 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized 242 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status 243 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16351 244 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up 245 20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up
05,升級gpmigeate
必備條件:
1)保證登錄到gpmaster節點,並且是gp superuser (gpadmin)。 2)在所有Greenplum節點上安裝Greenplum 4.0的bin文件。 3)把用戶自定義的模塊(如一些函數、包等)復制到Greenplum 4.0的相應目錄下。 4)把一些額外增加的文件或文件夾復制或保存,因為只有Greenplum需要的文件才會被gpmigrator這個命令保存 5)在所有的數據庫中運行vacuum,並且刪除所有的日志文件,這是非必需的,只是為了節省空間。 6)如果存在gp jetpack的schema,將其刪除,不要在系統中用pg_或gp前綴的 schema,如果存在,將其重命名。 7)在Greenplum 3.x版本中建表(分區表、列存儲)時,如果使用了OIDS-TRUE,將其修改為OIDS-FALSE,因為前者在Greenplum4.0中不會被支持。 8)使用gpcheckcat命令檢驗系統目錄的完整性 9)備份原有的數據(gpcondump或ZFS快照)。 10)刪除master standy節點(gpinitstandby -r)。 11)關閉現有系統(gpstop)。 12)把環境升級為Greenplum 4.0,修改~/.bash profile 13)通知所有數據庫用戶升級過程中數據庫不可用
....