GreenPlum 大数据平台--运维(三)

一,操作命令

  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.
View Code

   

    操作实例

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.
View Code

    操作实例

 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.
View Code

    操作实例

*****************************************************
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
View Code

    执行过程

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.
View Code
-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'
View Code

  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.
View Code

文件复制到另一台服务器

操作命令与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.
View Code

  实例说明:

显示一个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
View Code

  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)通知所有数据库用户升级过程中数据库不可用

....

 

 

 

 

posted on 2019-03-21 11:28  kingle-l  阅读(1378)  评论(0编辑  收藏  举报

levels of contents