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.
操作实例
gpstart -m
只启动master
gpstart -a -y
正常启动不提示确定信息,同时不启动master standy
执行过程
1)获取环境变量,如GPHOME, MASTER_DATA_DIRECTORY等信息。 2)检查Greenplum的版本,如果gpstart脚本的版本与数据目录的Greenplum版本不一致,则报错退出。 3)通过Master的postgresql.conf配置文件,获取端口等信息,并通过这个端口检查 Master是否已经启动,主要检查"/tmp/s.PGSQL.端口号”这个文件,还要通过netstat检查端口是否存在,如果Master正常运行,则报错退出。如果Master端口已经停止但仍有残留文件,那么删除相关文件,启动Master并停止。 4)通过utility模式启动Master,然后通过gp segment configuration表获取Segment和 Standy Master的信息,检查子节点是否有被标记为Down的情况 . 5)停止Master,并启动Standy Master (如果有)。 6)通过ping命令检查每个Segment所在机器的网络连接是否正常,然后并行启动 Segment进程(启动Segment通过ssh命令,调用SGPHOME/sbin/gpsegstart.py命令启动,启动的环境变量跟Master一致),并行度可以设置,默认是64个并发。 7)检查Segment启动情况,确定是否满足集群启动条件(所有的主备Segment至少有一个可以启动),如果有一个Segment的主备无法启动,则所有的Segment都会被停止,然后报错退出。 8)前面步骤都正常则开始启动Master,检查Master的运行状态(pg ctl status获取状态信息,同时尝试连接Master并释放) (注意,如果GP由于异常关闭,进入recovery模式,则连接Master消耗时间会长一些)。 9) Greenplum启动成功。
02,停止gpstop
参数说明
COMMAND NAME: gpstop Stops or restarts a Greenplum Database system. *****************************************************
SYNOPSIS
***************************************************** gpstop [-d <master_data_directory>] [-B <parallel_processes>]
[-M smart | fast | immediate] [-t <timeout_seconds>]
[-r] [-y] [-a] [-l <logfile_directory>] [-v | -q] gpstop -m [-d <master_data_directory>] [-y] [-l <logfile_directory>]
[-v | -q] gpstop -u [-d <master_data_directory>] [-l <logfile_directory>]
[-v | -q] gpstop --host <segment_host_name> [-d <master_data_directory>]
[-l <logfile_directory>] [-t <timeout_seconds>] [-a]
[-v | -q] gpstop --version gpstop -? | -h | --help *****************************************************
DESCRIPTION
***************************************************** The gpstop utility is used to stop the database servers that
comprise a Greenplum Database system. When you stop a Greenplum
Database system, you are actually stopping several postgres
database server processes at once (the master and all of the
segment instances). The gpstop utility handles the shutdown
of the individual instances. Each instance is shutdown in parallel. By default, you are not allowed to shut down Greenplum Database
if there are any client connections to the database. Use
the -M fast option to roll back and terminate any connections
before shutting down. If there are any transactions in progress,
the default behavior is to wait for them to commit before
shutting down. Use the -M fast option to roll back open
transactions. With the -u option, the utility uploads changes made to the
master pg_hba.conf file or to runtime configuration parameters
in the master postgresql.conf file without interruption of
service. Note that any active sessions will not pickup the
changes until they reconnect to the database. *****************************************************
OPTIONS
***************************************************** -a Do not prompt the user for confirmation. -B <parallel_processes> The number of segments to stop in parallel. If not specified,
the utility will start up to 64 parallel processes depending
on how many segment instances it needs to stop. -d <master_data_directory> Optional. The master host data directory. If not specified,
the value set for $MASTER_DATA_DIRECTORY will be used. --host <segment_host_name> Stop all segments on this host. Specify segment_host_name as
it is displayed in gp_segment_configuration. This cannot be used together with `-m`, `-r`, `-u`, or
`-y` options. This will only complete if failover segments are available.
This will fail if the system doesn't have mirrors. It will also
fail if the specified host has a master or standby master on
it. It will also fail if the specified host has both a primary
and its corresponding mirror on it, the same host. -l <logfile_directory> The directory to write the log file. Defaults to ~/gpAdminLogs. -m Optional. Shuts down a Greenplum master instance that was
started in maintenance mode. -M fast Fast shut down. Any transactions in progress are interrupted
and rolled back. -M immediate Immediate shut down. Any transactions in progress are aborted. This
shutdown mode is not recommended, and in some circumstances can cause
database corruption requiring manual recovery. This mode kills all postgres processes without allowing the database
server to complete transaction processing or clean up any temporary or
in-process work files. -M smart Smart shut down. If there are active connections, this command
fails with a warning. This is the default shutdown mode. -q Run in quiet mode. Command output is not displayed on the
screen, but is still written to the log file. -r Restart after shutdown is complete. -t <timeout_seconds> Specifies a timeout threshold (in seconds) to wait for a
segment instance to shutdown. If a segment instance does not
shutdown in the specified number of seconds, gpstop displays
a message indicating that one or more segments are still in
the process of shutting down and that you cannot restart
Greenplum Database until the segment instance(s) are stopped.
This option is useful in situations where gpstop is executed
and there are very large transactions that need to rollback.
These large transactions can take over a minute to rollback
and surpass the default timeout period of 600 seconds. -u This option reloads the pg_hba.conf files of the master and
segments and the runtime parameters of the postgresql.conf files
but does not shutdown the Greenplum Database array. Use this
option to make new configuration settings active after editing
postgresql.conf or pg_hba.conf. Note that this only applies to
configuration parameters that are designated as runtime parameters. -v Displays detailed status, progress and error messages output
by the utility. --version Displays the version of this utility. -y Do not stop the standby master process. The default is to stop
the standby master. -? | -h | --help Displays the online help.
操作实例
智能模式下停止Greenplum数据库系统: gpstop 在快速模式下停止一个Greenplum数据库系统: gpstop - M fast 停止所有segment实例,然后重启系统: gpstop - r 停止在维护模式下启动的主实例: gpstop - m 在保持的同时,停止特定主机上的所有段 其他主机: gpstop --host sdw1 重新加载配置 gpstop -u 重启数据库 gpstop -af
执行过程
1)还是何前面一样检查环境变量和数据库版本
2)在master获取segment信息,然后单独停止停止master.
3)停止备份Master.
4)也检查网络是否正常,然后并行通过$GPHOME/sbin/gpsegstop py脚本停止所有的segments,停止primary segment,然后停止mirror Segment.
5)停止数据库成功,打印出简单的报告。
03,初始化系统脚本gpinitsystem
参数说明
OMMAND NAME: gpinitsystem Initializes a Greenplum Database system by using configuration
parameters specified in a configuration file (gp_init_config). *****************************************************
SYNOPSIS
***************************************************** gpinitsystem -c <gpinitsystem_config>
[-h <hostfile_gpinitsystem>]
[-B <parallel_processes>]
[-p <postgresql_conf_param_file>]
[-s <standby_master_host>
[-P <standby_master_port>] [-F <standby_master_filespaces>]]
[--max_connections=<number>] [--shared_buffers=<size>]
[--locale=<locale>] [--lc-collate=<locale>]
[--lc-ctype=<locale>] [--lc-messages=<locale>]
[--lc-monetary=<locale>] [--lc-numeric=<locale>]
[--lc-time=<locale>] [--su_password=<password>]
[-S] [-a] [-q] [-l <logfile_directory>] [-D] *****************************************************
OPTIONS
***************************************************** -a Do not prompt the user for confirmation. -B <parallel_processes> The number of segments to create in parallel. If not specified,
the utility will start up to 4 parallel processes at a time. -c <gpinitsystem_config> Required. The full path and filename of the configuration file, which
contains all of the defined parameters to configure and initialize a
new Greenplum system. See INITIALIZATION CONFIGURATION FILE FORMAT below. -D Sets log output level to debug. -h <hostfile_gpinitsystem> Optional. The full path and file name of a file that contains the host
addresses of your segment hosts. If not specified on the command line,
you can specify the host file using the MACHINE_LIST_FILE parameter
in the gpinitsystem_config file. --locale=<locale> | -n <locale> Sets the default locale used by Greenplum Database. If not specified,
the LC_ALL, LC_COLLATE, or LANG environment variable of the master
host determines the locale. If these are not set, the default locale
is C (POSIX). A locale identifier consists of a language identifier
and a region identifier, and optionally a character set encoding.
For example, sv_SE is Swedish as spoken in Sweden, en_US is U.S.
English, and fr_CA is French Canadian. If more than one character
set can be useful for a locale, then the specifications look like
this: en_US.UTF-8 (locale specification and character set encoding).
On most systems, the command locale will show the locale environment
settings and locale -a will show a list of all available locales. --lc-collate=<locale> Similar to --locale, but sets the locale used for collation (sorting data).
The sort order cannot be changed after Greenplum Database is initialized,
so it is important to choose a collation locale that is compatible with
the character set encodings that you plan to use for your data. There is a
special collation name of C or POSIX (byte-order sorting as opposed to
dictionary-order sorting). The C collation can be used with any
character encoding. --lc-ctype=<locale> Similar to --locale, but sets the locale used for character classification
(what character sequences are valid and how they are interpreted). This
cannot be changed after Greenplum Database is initialized, so it is
important to choose a character classification locale that is compatible
with the data you plan to store in Greenplum Database. --lc-messages=<locale> Similar to --locale, but sets the locale used for messages output by
Greenplum Database. The current version of Greenplum Database does not
support multiple locales for output messages (all messages are in English),
so changing this setting will not have any effect. --lc-monetary=<locale> Similar to --locale, but sets the locale used for formatting currency amounts. --lc-numeric=<locale> Similar to --locale, but sets the locale used for formatting numbers. --lc-time=<locale> Similar to --locale, but sets the locale used for formatting dates and times. -l <logfile_directory> The directory to write the log file. Defaults to ~/gpAdminLogs. --max_connections=<number> | -m <number> Sets the maximum number of client connections allowed to the master.
The default is 25. -p <postgresql_conf_param_file> Optional. The name of a file that contains postgresql.conf parameter
settings that you want to set for Greenplum Database. These settings
will be used when the individual master and segment instances are
initialized. You can also set parameters after initialization using
the gpconfig utility. -q Run in quiet mode. Command output is not displayed on the screen,
but is still written to the log file. --shared_buffers=<size> | -b <size> Sets the amount of memory a Greenplum server instance uses for shared
memory buffers. You can specify sizing in kilobytes (kB), megabytes (MB)
or gigabytes (GB). The default is 125MB. -s <standby_master_host> Optional. If you wish to configure a backup master host, specify the
host name using this option. The Greenplum Database software must
already be installed and configured on this host. -P <standby_master_port> Optional and effective only when specified with -s. This option can
specify the port to be used by the standby master. The default value
is the same as the primary master. -F <standby_master_filespace> Optional and effective only when specified with -s. This option can
specify the filespace mappings. --su_password=<superuser_password> | -e <superuser_password> The password to set for the Greenplum Database superuser. Defaults
to 'gparray'. You can always change the superuser password at a
later time using the ALTER ROLE command. Client connections over
the network require a password login for the database superuser
account (for example, the gpadmin user). Best practises: Always use passwords, do not use default passwords,
change default passwords immediately after installation. -S If mirroring parameters are specified, spreads the mirror segments
across the available hosts. The default is to group the set of mirror
segments together on an alternate host from their primary segment set.
Mirror spreading will place each mirror on a different host within the
Greenplum Database array. Spreading is only allowed if there is a
sufficient number of hosts in the array (number of hosts is greater
than the number of segment instances). -v | --version Displays the version of this utility. --help 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
gpssh { -f <hostfile_gpssh> | -h <hostname> [-h <hostname> ...] }
[-u userid] [-s] [-v] [-e] [-d seconds] [-t multiplier] [<bash_command>] *****************************************************
OPTIONS
***************************************************** <bash_command> A bash shell command to execute on all hosts involved in this
session (optionally enclosed in quotes). If not specified, gpssh
will start an interactive session. -d (delay) seconds Optional. Specifies the time, in seconds, to wait at the start of a
gpssh interaction with ssh. Default is 0.05. This option overrides the
delaybeforesend value that is specified in the gpssh.conf configuration
file. Increasing this value can cause a long wait time during gpssh startup. -e (echo) Optional. Echoes the commands passed to each host and their
resulting output while running in non-interactive mode. -f <hostfile_gpssh> Specifies the name of a file that contains a list of hosts that
will participate in this SSH session. The host name is required.
The syntax of the host file is one host per line as follows: <hostname> -h <hostname> Specifies a single host name that will participate in this SSH session.
You can use the -h option multiple times to specify multiple host names. -s Optional. If specified, before executing any commands on the target
host, gpssh sources the file greenplum_path.sh in the directory
specified by the $GPHOME environment variable. This option is valid for both interactive mode and single command mode. -t multiplier Optional. A decimal number greater than 0 (zero) that is the multiplier
for the timeout that gpssh uses when validating the ssh prompt. Default
is 1. This option overrides the prompt_validation_timeout value that is
specified in the gpssh.conf configuration file. Increasing this value has a small impact during gpssh startup. -u <userid> Specifies the userid for this SSH session. -v (verbose mode) Optional. Reports additional messages in addition to the command
output when running in non-interactive mode. --version Displays the version of this utility. -? (help) Displays the online help.
-c 结果显示执行的命令
-f hostname 配置文件
-h 指定host,单台执行
<bash_command> 后面接执行的命令
*****************************************************
EXAMPLES
***************************************************** Start an interactive group SSH session with all hosts listed
in the file hostfile_gpssh: $ gpssh -f hostfile_gpssh At the gpssh interactive command prompt, run a shell command
on all the hosts involved in this session. => ls -a /data/primary/* Exit an interactive session: => exit Start a non-interactive group SSH session with the hosts named
sdw1 and sdw2 and pass a file containing several commands
named command_file to gpssh: $ gpssh -h sdw1 -h sdw2 -v -e < command_file Execute single commands in non-interactive mode on hosts
sdw2 and localhost: $ gpssh -h sdw2 -h localhost -v -e 'ls -a /data/primary/*' $ gpssh -h sdw2 -h localhost -v -e 'echo $GPHOME' $ gpssh -h sdw2 -h localhost -v -e 'ls -1 | wc -l'
gpscp
gpscp { -f <hostfile_gpssh> | -h <hostname> [-h <hostname> ...] }
[-J <character>] [-v] [[<user>@]<hostname>:]<file_to_copy> [...]
[[<user>@]<hostname>:]<copy_to_path> *****************************************************
OPTIONS
***************************************************** -f <hostfile_gpssh> Specifies the name of a file that contains a list of hosts
that will participate in this SCP session. The syntax of the
host file is one host per line as follows: <hostname> -h <hostname> Specifies a single host name that will participate in this
SCP session. You can use the -h option multiple times to
specify multiple host names. -J <character> The -J option allows you to specify a single character to
substitute for the hostname in the copy from and to destination
strings. If -J is not specified, the default substitution
character is an equal sign (=). -v (verbose mode) Optional. Reports additional messages in addition to the
SCP command output. <file_to_copy> Required. The file name (or absolute path) of a file that
you want to copy to other hosts (or file locations). This
can be either a file on the local host or on another named
host. <copy_to_path> Required. The path where you want the file(s) to be copied
on the named hosts. If an absolute path is not used, the
file will be copied relative to $HOME of the session user. You
can also use the equal sign '=' (or another character that you
specify with the -J option) in place of a hostname. This will
then substitute in each host name as specified in the supplied
host file (-f) or with the -h option. -? (help) Displays the online help. --version 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恢复后,数据的恢复进度
参数说明
COMMAND NAME: gpstate Shows the status of a running Greenplum Database system. *****************************************************
SYNOPSIS
***************************************************** gpstate [-d <master_data_directory>] [-B <parallel_processes>]
[-s | -b | -Q | -e] [-m | -c] [-p] [-i] [-f]
[-v | -q] [-l <log_directory>] gpstate -? | -h | --help *****************************************************
DESCRIPTION
***************************************************** The gpstate utility displays information about a running
Greenplum Database instance. There is additional information
you may want to know about a Greenplum Database system, since
it is comprised of multiple PostgreSQL database instances (segments)
spanning multiple machines. The gpstate utility provides
additional status information for a Greenplum Database system,
such as:
* Which segments are down.
* Master and segment configuration information (hosts,
data directories, etc.).
* The ports used by the system.
* A mapping of primary segments to their corresponding
mirror segments. *****************************************************
OPTIONS
***************************************************** -b (brief status) Optional. Display a brief summary of the state of the
Greenplum Database system. This is the default option. -B <parallel_processes> The number of segments to check in parallel. If not specified,
the utility will start up to 60 parallel processes depending on
how many segment instances it needs to check. -c (show primary to mirror mappings) Optional. Display mapping of primary segments to their
corresponding mirror segments. -d <master_data_directory> Optional. The master data directory. If not specified, the
value set for $MASTER_DATA_DIRECTORY will be used. -e (show segments with mirror status issues) Show details on primary/mirror segment pairs that have
potential issues such as 1) the active segment is running in
change tracking mode, meaning a segment is down 2) the active
segment is in resynchronization mode, meaning it is catching
up changes to the mirror 3) a segment is not in its preferred role,
for example a segment that was a primary at system initialization
time is now acting as a mirror, meaning you may have one or more
segment hosts with unbalanced processing load. -f (show standby master details) Display details of the standby master host if configured. -i (show Greenplum Database version) Display the Greenplum Database software version information
for each instance. -l <logfile_directory> The directory to write the log file. Defaults to ~/gpAdminLogs. -m (list mirrors) Optional. List the mirror segment instances in the system,
their current role, and synchronization status. -p (show ports) List the port numbers used throughout the Greenplum Database
system. -q (no screen output) Optional. Run in quiet mode. Except for warning messages, command
output is not displayed on the screen. However, this information
is still written to the log file. -Q (quick status) Optional. Checks segment status in the system catalog on
the master host. Does not poll the segments for status. -s (detailed status) Optional. Displays detailed status information for the
Greenplum Database system. -v (verbose output) Optional. Displays error messages and outputs detailed status
and progress information. -? | -h | --help (help) Displays the online help. *****************************************************
OUTPUT DEFINITIONS FOR DETAIL VIEW
*****************************************************
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
MASTER OUTPUT DATA
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * Master host - host name of the master * Master postgres process ID - PID of the master postgres database
listener process * Master data directory - file system location of the master data directory * Master port - port of the master database listener process * Master current role - dispatch = regular operating mode
utility = maintenance mode * Greenplum array configuration type - Standard = one NIC per host
Multi-Home = multiple NICs per host * Greenplum initsystem version - version of Greenplum Database when
system was first initialized * Greenplum current version - current version of Greenplum Database * Postgres version - version of PostgreSQL that Greenplum Database
is based on * Greenplum mirroring status - physical mirroring, SAN or none * Master standby - host name of the standby master * Standby master state - status of the standby master: active or passive +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SEGMENT OUTPUT DATA
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * Hostname - system-configured host name * Address - network address host name (NIC name) * Datadir - file system location of segment data directory * Port - port number of segment postgres database listener process * Current Role - current role of a segment: Mirror or Primary * Preferred Role - role at system initialization time: Mirror or Primary * Mirror Status - status of a primary/mirror segment pair:
Synchronized = data is up to date on both
Resynchronizing = data is currently being copied from one to the other
Change Tracking = segment down and active segment is logging changes * Change tracking data size - when in Change Tracking mode, the size of the change
log file (may grow and shrink as compression is applied) * Estimated total data to synchronize - when in Resynchronization mode, the estimated
size of data left to syncronize * Data synchronized - when in Resynchronization mode, the estimated size of data
that has already been syncronized * Estimated resync progress with mirror - when in Resynchronization mode, the
estimated percentage of completion * Estimated resync end time - when in Resynchronization mode, the estimated
time to complete * File postmaster.pid - status of postmaster.pid lock file: Found or Missing * PID from postmaster.pid file - PID found in the postmaster.pid file * Lock files in /tmp - a segment port lock file for its postgres process is
created in /tmp (file is removed when a segment shuts down) * Active PID - active process ID of a segment * Master reports status as - segment status as reported in the system catalog:
Up or Down Database status - status of Greenplum Database to incoming requests:
Up, Down, or Suspended. A Suspended state means database
activity is temporarily paused while a segment transitions from
one state to another.
实例说明:
显示一个Greenplum数据库系统的详细状态信息:
gpstate -s
快速检查master节点中down了的segments:
gpstate -Q
显示有关mirror segment 实例的信息:
gpstate -m
显示有关备用主配置的信息:
gpstate -f
显示Greenplum软件版本信息:
gpstate -i
操作结果:
[gpadmin@greenplum01 ~]$ gpstate -s
20190321:11:03:40:013465 gpstate:greenplum01:gpadmin-[INFO]:-Starting gpstate with args: -s
20190321:11:03:40:013465 gpstate:greenplum01:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 5.16.0build commit:23cec7df0406d69d6552a4bbb77035dba4d7dd44'
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'
20190321:11:03:40:013465 gpstate:greenplum01:gpadmin-[INFO]:-Obtaining Segment details from master...
20190321:11:03:40:013465 gpstate:greenplum01:gpadmin-[INFO]:-Gathering data from segments...
..
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:--Master Configuration & Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master host = greenplum01
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master postgres process ID = 5730
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master data directory = /greenplum/data/master/gpseg-1
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master port = 5432
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master current role = dispatch
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Greenplum initsystem version = 5.16.0 build commit:23cec7df0406d69d6552a4bbb77035dba4d7dd44
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
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Postgres version = 8.3.23
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Master standby = No master standby configured
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-Segment Instance Status Report
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/primary/gpseg0
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6000
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16347
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/mirror/gpseg0
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43000
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16624
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/primary/gpseg1
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6001
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16341
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/mirror/gpseg1
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43001
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16628
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/primary/gpseg2
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6002
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16352
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/mirror/gpseg2
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43002
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16623
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/primary/gpseg3
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6003
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16348
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/mirror/gpseg3
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43003
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16620
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/primary/gpseg4
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6000
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16626
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/mirror/gpseg4
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43000
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16350
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/primary/gpseg5
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6001
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16622
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data/mirror/gpseg5
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43001
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16353
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/primary/gpseg6
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6002
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16627
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/mirror/gpseg6
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43002
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16346
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum03
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/primary/gpseg7
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 6003
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Primary
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16619
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Database status = Up
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:-----------------------------------------------------
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Segment Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Hostname = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Address = greenplum02
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Datadir = /greenplum/data2/mirror/gpseg7
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Port = 43003
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirroring Info
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Current role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Preferred role = Mirror
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Mirror status = Synchronized
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Status
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- PID = 16351
20190321:11:03:43:013465 gpstate:greenplum01:gpadmin-[INFO]:- Configuration reports status as = Up
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)通知所有数据库用户升级过程中数据库不可用
....
GreenPlum 大数据平台--运维(三)的更多相关文章
- GreenPlum 大数据平台--运维(二)
.如何获取查询运行时和已用时间. 例子: Select tstart, tfinish, (tfinish-tstart) as total_time, trim(query_text) from q ...
- GreenPlum 大数据平台--运维(一)
.最后分析或真空或创建表或等... Select * from pg_stat_operations where schemaname='SCHEMA NAME ' and actionname in ...
- GreenPlum 大数据平台--外部表(三)
一,外部表介绍 Greenplum 在数据加载上有一个明显的优势,就是支持数据的并发加载,gpfdisk是并发加载的工具,数据库中对应的就是外部表 所谓外部表,就是在数据库中只有表定义.没有数据,数据 ...
- GreenPlum 大数据平台--介绍
一,GreenPlum 01,介绍: Greenplum是一种基于PostgreSQL的分布式数据库,其采用shared-nothing架构,主机.操作系统.内存.存储都是自我控制的,不存在共享. 官 ...
- IT职业技能图谱:架构师、H5、DBA、移动、大数据、运维...
转载 作者:StuQ 文章收藏自微信:InfoQ 时隔近5个月,StuQ的小伙伴们再次出品了IT职业技能图谱更新版.这回除更新之前版本外,还添加了架构师.HTML 5.DBA等新的职业技能图谱.正 ...
- GreenPlum 大数据平台--监控
数据库状态监控活动 活动 过程 纠正措施 列出当前状态为down的Segment.如果有任何行被返回,就会生成一个警告或者告警. 推荐频率:每5到10分钟 重要度: IMPORTANT 在postgr ...
- GreenPlum 大数据平台--非并行备份(六)
一,非并行备份(pg_dump) 1) GP依然支持常规的PostgreSQL备份命令pg_dump和pg_dumpall 2) 备份将在Master主机上创建一个包含所有Segment数据的大的备份 ...
- GreenPlum 大数据平台--并行备份(四)
01,并行备份(gp_dump) 1) GP同时备份Master和所有活动的Segment实例 2) 备份消耗的时间与系统中实例的数量没有关系 3) 在Master主机上备份所有DDL文件和GP相关的 ...
- GreenPlum 大数据平台--基础使用(一)
一,操作语法 01,创建数据库 --创建用户-- [gpadmin@greenplum01 ~]$ export PGDATABASE=testDB --指定数据库名字 [gpadmin@greenp ...
随机推荐
- 编写高质量代码改善C#程序的157个建议——建议49:在Dispose模式中应提取一个受保护的虚方法
建议49:在Dispose模式中应提取一个受保护的虚方法 在标准的Dispose模式中,真正的IDisposable接口的Dispose方法并没有做实际的清理工作,它其实是调用了下面的这个带bool参 ...
- 编写高质量代码改善C#程序的157个建议——建议25:谨慎集合属性的可写操作
建议25:谨慎集合属性的可写操作 如果类型的属性中有集合属性,那么应该保证属性对象是由类型本身产生的.如果将属性设置为可写,则会增加抛出异常的几率.一般情况下,如果集合属性没有值,则它返回的Count ...
- vmware ubuntu安装vmware tools
vmware tools可以说是其平台虚拟机必不可少的工具,可以使母机(你的电脑)通过复制粘贴向虚拟机中传递文件信息,对我们虚拟机的使用由非常大的帮助,当然也可以通过使用共享硬盘来共享文件,但操作起来 ...
- MongoDB整理笔记のGUI操作
值得幸运的是,其实MongoDB也有像类似于PL/SQL一样的界面操作工具操作MongoDB. 下面就来介绍几款不同的界面工具,大家各取所需! MongoVUE 主页:http://www.mongo ...
- windows phone制作引导页
适用于WP7 WP8+ 源码下载撸这里 制作动画gif小软件下载 小技巧 ①图片是纯色背景:将页面设置跟图片背景一样颜色 ②图片是渐变or其他,切图时候:单独切背景(页面设置这个为背景)跟图片里面元素 ...
- C#中的Linq使用
First()与FirstOrDefault() 如何结合Expression 如何拼接以避免复杂的switch语句
- [转]解读Unity中的CG编写Shader系列二
上一篇文章的例子中我们可以看到顶点着色器的输出参数可以说是直接作为了片段着色器的形参传递过来,那么不由得一个问题浮现出来,顶点着色器的形参是从何处传递过来的? 顶点着色器的形参是gameObject ...
- Unity性能优化专题---腾讯牛人分享经验
这里从三个纬度来分享下内存的优化经验:代码层面.贴图层面.框架设计层面. 一.代码层面. 1.foreach. Mono下的foreach使用需谨慎.频繁调用容易触及堆上限,导致GC过早触发,出现卡顿 ...
- PS基本操作汇总(持续更新)
一.放大缩小图片:ctrl+/- 二.缩小gif:ps时打开后,web格式保存,里面点出优化面板,选gif格式,颜色数减小,如128,损耗30,图片大小也可调整,比如调整为50%,点击预览,可在浏览器 ...
- ORA-03113 : end-of-file on communication channel
现象一: 数据库startup时,出现数据库无法正常mount,并报ORA-03113错误. SQL> startup ORACLE instance started. Total System ...