在某些情况下,特别是在前期没规划好的情况下,后期运行过程中会遇到需要修改hostname&ip的情况,现状遇到的情况是需要调整hostname,对于某些已经投产或者的集群类的环境,修改这些信息尤为麻烦。
大体步骤:
0. 维护模式打开数据库,修改配置表 gp_segment_configuration 的hostname和address字段为新主机名称;
1、停库,关闭维护模式;
2、修改/etc/sysconf/network和/etc/hosts文件,使用新的主机名称,重启主机;
3、打开数据库并检查。
以下是记录:
[gpadmin@gtlions101 ~]$ gpstart -ay
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Starting gpstart with args: -ay
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Catalog Version: '201109210'
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[WARNING]:-postmaster.pid file exists on Master, checking if recovery startup required
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Commencing recovery startup checks
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-No socket connection or lock file in /tmp found for port=5432
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-No Master instance process, entering recovery startup mode
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Clearing Master instance pid file
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Starting Master instance in admin mode
20131225:15:00:29:001873 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:00:29:001873 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:00:29:001873 gpstart:gtlions101:gpadmin-[INFO]:-Setting new master era
20131225:15:00:29:001873 gpstart:gtlions101:gpadmin-[INFO]:-Commencing forced instance shutdown
20131225:15:00:31:001873 gpstart:gtlions101:gpadmin-[INFO]:-Starting Master instance in admin mode
20131225:15:00:32:001873 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:00:32:001873 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:00:32:001873 gpstart:gtlions101:gpadmin-[INFO]:-Setting new master era
20131225:15:00:32:001873 gpstart:gtlions101:gpadmin-[INFO]:-Master Started...
20131225:15:00:32:001873 gpstart:gtlions101:gpadmin-[INFO]:-Shutting down master
20131225:15:00:34:001873 gpstart:gtlions101:gpadmin-[INFO]:-No standby master configured. skipping...
20131225:15:00:34:001873 gpstart:gtlions101:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...
.....
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-Process results...
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:- Successful segment starts = 4
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:- Failed segment starts = 0
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) = 0
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-Successfully started 4 of 4 segment instances
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-Starting Master instance gtlions101 directory /data/master/gpseg-1
20131225:15:00:40:001873 gpstart:gtlions101:gpadmin-[INFO]:-Command pg_ctl reports Master gtlions101 instance active
20131225:15:00:40:001873 gpstart:gtlions101:gpadmin-[INFO]:-Database successfully started
[gpadmin@gtlions101 ~]$ gpstate
20131225:15:00:51:001992 gpstate:gtlions101:gpadmin-[INFO]:-Starting gpstate with args:
20131225:15:00:51:001992 gpstate:gtlions101:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:00:51:001992 gpstate:gtlions101:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.2.15 (Greenplum Database 4.2.5.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on May 16 2013 23:35:01'
20131225:15:00:51:001992 gpstate:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:00:51:001992 gpstate:gtlions101:gpadmin-[INFO]:-Gathering data from segments...
..
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-Greenplum instance status summary
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Master instance = Active
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Master standby = No master standby configured
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total segment instance count from metadata = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Primary Segment Status
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total primary segments = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total primary segment valid (at master) = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total primary segment failures (at master) = 0
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of postmaster.pid files missing = 0
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of postmaster.pid files found = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of postmaster.pid PIDs missing = 0
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of postmaster.pid PIDs found = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of /tmp lock files missing = 0
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of /tmp lock files found = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number postmaster processes missing = 0
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number postmaster processes found = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Mirror Segment Status
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Mirrors not configured on this array
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
[gpadmin@gtlions101 ~]$ gpstop -M fast
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Starting gpstop with args: -M fast
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:---------------------------------------------
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Master instance parameters
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:---------------------------------------------
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Master Greenplum instance process active PID = 1971
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Database = template1
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Master port = 5432
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Master directory = /data/master/gpseg-1
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Shutdown mode = fast
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Timeout = 600
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Shutdown Master standby host = Off
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:---------------------------------------------
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Segment instances that will be shutdown:
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:---------------------------------------------
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Host Datadir Port Status
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- gtlions102 /data/primary/gpseg0 40000 u
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- gtlions102 /data/primary/gpseg1 40001 u
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- gtlions103 /data/primary/gpseg2 40000 u
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- gtlions103 /data/primary/gpseg3 40001 u
Continue with Greenplum instance shutdown Yy|Nn (default=N):
> y
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-There are 0 connections to the database
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='fast'
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Master host=gtlions101
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Detected 0 connections to database
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Using standard WAIT mode of 600 seconds
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=fast
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Master segment instance directory=/data/master/gpseg-1
20131225:15:04:56:002168 gpstop:gtlions101:gpadmin-[INFO]:-No standby master host configured
20131225:15:04:56:002168 gpstop:gtlions101:gpadmin-[INFO]:-Commencing parallel segment instance shutdown, please wait...
...
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:- Segments stopped successfully = 4
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:- Segments with errors during stop = 0
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:-Successfully shutdown 4 of 4 segment instances
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:-Database successfully shutdown with no errors reported
[gpadmin@gtlions101 ~]$ gpstart -m
20131225:15:05:06:002190 gpstart:gtlions101:gpadmin-[INFO]:-Starting gpstart with args: -m
20131225:15:05:06:002190 gpstart:gtlions101:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:05:06:002190 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:05:06:002190 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Catalog Version: '201109210'
20131225:15:05:06:002190 gpstart:gtlions101:gpadmin-[INFO]:-Master-only start requested in configuration without a standby master.
Continue with master-only startup Yy|Nn (default=N):
> y
20131225:15:05:07:002190 gpstart:gtlions101:gpadmin-[INFO]:-Starting Master instance in admin mode
20131225:15:05:08:002190 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:05:08:002190 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:05:08:002190 gpstart:gtlions101:gpadmin-[INFO]:-Setting new master era
20131225:15:05:08:002190 gpstart:gtlions101:gpadmin-[INFO]:-Master Started...
[gpadmin@gtlions101 ~]$ cd $MASTER_DATA_DIRECTORY
[gpadmin@gtlions101 gpseg-1]$ vi postgresql.conf
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
# values can be found in the PostgreSQL documentation.
#
# The commented-out settings shown in this file represent the default values.
# Re-commenting a setting is NOT sufficient to revert it to the default value;
# you need to reload the server.
#
# This file is read on server startup and when the server receives a SIGHUP
# signal. If you edit the file on a running system, you have to SIGHUP the
# server for the changes to take effect, or use "pg_ctl reload". Some
# parameters, which are marked below, require a server shutdown and restart to
# take effect.
#
# Any parameter can also be given as a command-line option to the server, e.g.,
# "postgres -c log_connections=on". Some parameters can be changed at run time
# with the "SET" SQL command.
#
# Memory units: kB = kilobytes Time units: ms = milliseconds
# MB = megabytes s = seconds
# GB = gigabytes min = minutes
# h = hours
# d = days
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
# (change requires restart)
# each segment has its own port number.
# note: Port numbers for the Greenplum system must also be changed in the
# gp_configuration catalog. See the Greenplum Database Administrator Guide
# for instructions!
# - Previous PostgreSQL Versions -
#add_missing_from = off
#array_nulls = on
#backslash_quote = safe_encoding # on, off, or safe_encoding
#escape_string_warning = on
#regex_flavor = advanced # advanced, extended, or basic
#standard_conforming_strings = off
# - Other Platforms and Clients -
#transform_null_equals = off
#---------------------------------------------------------------------------
# GREENPLUM ARRAY CONFIGURATION
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# GREENPLUM ARRAY TUNING
#---------------------------------------------------------------------------
# - Interconnect -
#gp_max_packet_size = 8192
gp_interconnect_type=udpifc
# - Worker Process Creation -
gp_connections_per_thread = 64
gp_segment_connect_timeout = 600s
#gp_enable_delete_as_truncate = off
# - Resource limits -
gp_vmem_protect_limit = 8192 #Virtual memory limit (in MB).
#gp_vmem_idle_resource_timeout = 18000 # idle-time before gang-release, in milliseconds (zero disables release).
#------------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#------------------------------------------------------------------------------
#custom_variable_classes = '' # list of custom variable class names
gp_backup_directIO = off # enable\disable dump with direct IO
gp_backup_directIO_read_chunk_mb = 20 # Size of read Chunk buffer in directIO dump (in MB)
gp_crash_handler_async = on
#Greenplum specific configuration parameters for Master instance database
#------------------------------------------------------------------------
log_statement=all
checkpoint_segments=8
checkpoint_segments=8
"postgresql.conf" 524L, 19361C 宸插啓鍏?
[gpadmin@gtlions101 gpseg-1]$ gpstart -m
20131225:15:38:17:002484 gpstart:gtlions101:gpadmin-[INFO]:-Starting gpstart with args: -m
20131225:15:38:17:002484 gpstart:gtlions101:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:38:17:002484 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:38:17:002484 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Catalog Version: '201109210'
20131225:15:38:17:002484 gpstart:gtlions101:gpadmin-[INFO]:-Master-only start requested in configuration without a standby master.
Continue with master-only startup Yy|Nn (default=N):
> y
20131225:15:38:19:002484 gpstart:gtlions101:gpadmin-[INFO]:-Starting Master instance in admin mode
20131225:15:38:20:002484 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:38:20:002484 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:38:20:002484 gpstart:gtlions101:gpadmin-[INFO]:-Setting new master era
20131225:15:38:20:002484 gpstart:gtlions101:gpadmin-[INFO]:-Master Started...
[gpadmin@gtlions101 gpseg-1]$ PGOPTIONS='-c gp_session_role=utility' psql -U gpadmin postgres
psql (8.2.15)
Type "help" for help.
postgres=# update gp_segment_configuration set hostname='gtlions103-1' where address='gtlions103';
UPDATE 2
postgres=# update gp_segment_configuration set hostname='gtlions101-1' where address='gtlions101';
UPDATE 1
postgres=# update gp_segment_configuration set hostname='gtlions102-1' where address='gtlions102';
UPDATE 2
postgres=# select * from gp_segment_configuration;
dbid | content | role | preferred_role | mode | status | port | hostname | address | replication_port | san_mounts
------+---------+------+----------------+------+--------+-------+--------------+------------+------------------+------------
4 | 2 | p | p | s | u | 40000 | gtlions103-1 | gtlions103 | |
5 | 3 | p | p | s | u | 40001 | gtlions103-1 | gtlions103 | |
1 | -1 | p | p | s | u | 5432 | gtlions101-1 | gtlions101 | |
2 | 0 | p | p | s | u | 40000 | gtlions102-1 | gtlions102 | |
3 | 1 | p | p | s | u | 40001 | gtlions102-1 | gtlions102 | |
(5 rows)
postgres=# update gp_segment_configuration set address=hostname;
UPDATE 5
postgres=# select * from gp_segment_configuration;
dbid | content | role | preferred_role | mode | status | port | hostname | address | replication_port | san_mounts
------+---------+------+----------------+------+--------+-------+--------------+--------------+------------------+------------
4 | 2 | p | p | s | u | 40000 | gtlions103-1 | gtlions103-1 | |
5 | 3 | p | p | s | u | 40001 | gtlions103-1 | gtlions103-1 | |
1 | -1 | p | p | s | u | 5432 | gtlions101-1 | gtlions101-1 | |
2 | 0 | p | p | s | u | 40000 | gtlions102-1 | gtlions102-1 | |
3 | 1 | p | p | s | u | 40001 | gtlions102-1 | gtlions102-1 | |
(5 rows)
postgres=# \q
[gpadmin@gtlions101 gpseg-1]$ gpstop -m
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Starting gpstop with args: -m
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-There are 0 connections to the database
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart'
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Master host=gtlions101-1
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=smart
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Master segment instance directory=/data/master/gpseg-1
[gpadmin@gtlions101-1 ~]$ gpssh-exkeys -f gp/hostfile_exkeys
[STEP 1 of 5] create local ID and authorize on local host
... /home/gpadmin/.ssh/id_rsa file exists ... key generation skipped
[STEP 2 of 5] keyscan all hosts and update known_hosts file
[STEP 3 of 5] authorize current user on remote hosts
... send to gtlions102-1
... send to gtlions103-1
[STEP 4 of 5] determine common authentication file content
[STEP 5 of 5] copy authentication files to all remote hosts
... finished key exchange with gtlions102-1
... finished key exchange with gtlions103-1
[INFO] completed successfully
[gpadmin@gtlions101-1 ~]$ gpstart
20131225:15:45:30:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Starting gpstart with args:
20131225:15:45:30:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:45:30:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:45:31:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Greenplum Catalog Version: '201109210'
20131225:15:45:31:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Starting Master instance in admin mode
20131225:15:45:32:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:45:32:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:45:32:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Setting new master era
20131225:15:45:32:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Master Started...
20131225:15:45:32:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Shutting down master
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:---------------------------
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Master instance parameters
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:---------------------------
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Database = template1
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Master Port = 5432
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Master directory = /data/master/gpseg-1
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Timeout = 600 seconds
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Master standby = Off
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:---------------------------------------
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Segment instances that will be started
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:---------------------------------------
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- Host Datadir Port
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- gtlions102-1 /data/primary/gpseg0 40000
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- gtlions102-1 /data/primary/gpseg1 40001
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- gtlions103-1 /data/primary/gpseg2 40000
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- gtlions103-1 /data/primary/gpseg3 40001
Continue with Greenplum instance startup Yy|Nn (default=N):
> y
20131225:15:45:36:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-No standby master configured. skipping...
20131225:15:45:36:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...
....
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Process results...
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- Successful segment starts = 4
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- Failed segment starts = 0
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) = 0
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Successfully started 4 of 4 segment instances
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Starting Master instance gtlions101-1 directory /data/master/gpseg-1
20131225:15:45:41:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Command pg_ctl reports Master gtlions101-1 instance active
20131225:15:45:41:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Database successfully started
[gpadmin@gtlions101-1 ~]$ gpstate
20131225:15:45:46:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-Starting gpstate with args:
20131225:15:45:46:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:45:46:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.2.15 (Greenplum Database 4.2.5.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on May 16 2013 23:35:01'
20131225:15:45:46:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:45:46:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-Gathering data from segments...
..
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-Greenplum instance status summary
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Master instance = Active
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Master standby = No master standby configured
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total segment instance count from metadata = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Primary Segment Status
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total primary segments = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total primary segment valid (at master) = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total primary segment failures (at master) = 0
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of postmaster.pid files missing = 0
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of postmaster.pid files found = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of postmaster.pid PIDs missing = 0
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of postmaster.pid PIDs found = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of /tmp lock files missing = 0
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of /tmp lock files found = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number postmaster processes missing = 0
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number postmaster processes found = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Mirror Segment Status
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Mirrors not configured on this array
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
[gpadmin@gtlions101-1 ~]$ psql -l
List of databases
Name | Owner | Encoding | Access privileges
-----------+---------+----------+---------------------
postgres | gpadmin | UTF8 |
template0 | gpadmin | UTF8 | =c/gpadmin
: gpadmin=CTc/gpadmin
template1 | gpadmin | UTF8 | =c/gpadmin
: gpadmin=CTc/gpadmin
(3 rows)
[gpadmin@gtlions101-1 ~]$ psql postgres
psql (8.2.15)
Type "help" for help.
postgres=# select * from gp_segment_configuration;
dbid | content | role | preferred_role | mode | status | port | hostname | address | replication_port | san_mounts
------+---------+------+----------------+------+--------+-------+--------------+--------------+------------------+------------
4 | 2 | p | p | s | u | 40000 | gtlions103-1 | gtlions103-1 | |
5 | 3 | p | p | s | u | 40001 | gtlions103-1 | gtlions103-1 | |
1 | -1 | p | p | s | u | 5432 | gtlions101-1 | gtlions101-1 | |
2 | 0 | p | p | s | u | 40000 | gtlions102-1 | gtlions102-1 | |
3 | 1 | p | p | s | u | 40001 | gtlions102-1 | gtlions102-1 | |
(5 rows)
postgres=# \q
-EOF-
大体步骤:
0. 维护模式打开数据库,修改配置表 gp_segment_configuration 的hostname和address字段为新主机名称;
1、停库,关闭维护模式;
2、修改/etc/sysconf/network和/etc/hosts文件,使用新的主机名称,重启主机;
3、打开数据库并检查。
以下是记录:
[gpadmin@gtlions101 ~]$ gpstart -ay
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Starting gpstart with args: -ay
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Catalog Version: '201109210'
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[WARNING]:-postmaster.pid file exists on Master, checking if recovery startup required
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Commencing recovery startup checks
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-No socket connection or lock file in /tmp found for port=5432
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-No Master instance process, entering recovery startup mode
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Clearing Master instance pid file
20131225:15:00:27:001873 gpstart:gtlions101:gpadmin-[INFO]:-Starting Master instance in admin mode
20131225:15:00:29:001873 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:00:29:001873 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:00:29:001873 gpstart:gtlions101:gpadmin-[INFO]:-Setting new master era
20131225:15:00:29:001873 gpstart:gtlions101:gpadmin-[INFO]:-Commencing forced instance shutdown
20131225:15:00:31:001873 gpstart:gtlions101:gpadmin-[INFO]:-Starting Master instance in admin mode
20131225:15:00:32:001873 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:00:32:001873 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:00:32:001873 gpstart:gtlions101:gpadmin-[INFO]:-Setting new master era
20131225:15:00:32:001873 gpstart:gtlions101:gpadmin-[INFO]:-Master Started...
20131225:15:00:32:001873 gpstart:gtlions101:gpadmin-[INFO]:-Shutting down master
20131225:15:00:34:001873 gpstart:gtlions101:gpadmin-[INFO]:-No standby master configured. skipping...
20131225:15:00:34:001873 gpstart:gtlions101:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...
.....
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-Process results...
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:- Successful segment starts = 4
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:- Failed segment starts = 0
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) = 0
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-Successfully started 4 of 4 segment instances
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:39:001873 gpstart:gtlions101:gpadmin-[INFO]:-Starting Master instance gtlions101 directory /data/master/gpseg-1
20131225:15:00:40:001873 gpstart:gtlions101:gpadmin-[INFO]:-Command pg_ctl reports Master gtlions101 instance active
20131225:15:00:40:001873 gpstart:gtlions101:gpadmin-[INFO]:-Database successfully started
[gpadmin@gtlions101 ~]$ gpstate
20131225:15:00:51:001992 gpstate:gtlions101:gpadmin-[INFO]:-Starting gpstate with args:
20131225:15:00:51:001992 gpstate:gtlions101:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:00:51:001992 gpstate:gtlions101:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.2.15 (Greenplum Database 4.2.5.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on May 16 2013 23:35:01'
20131225:15:00:51:001992 gpstate:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:00:51:001992 gpstate:gtlions101:gpadmin-[INFO]:-Gathering data from segments...
..
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-Greenplum instance status summary
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Master instance = Active
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Master standby = No master standby configured
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total segment instance count from metadata = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Primary Segment Status
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total primary segments = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total primary segment valid (at master) = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total primary segment failures (at master) = 0
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of postmaster.pid files missing = 0
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of postmaster.pid files found = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of postmaster.pid PIDs missing = 0
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of postmaster.pid PIDs found = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of /tmp lock files missing = 0
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number of /tmp lock files found = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number postmaster processes missing = 0
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Total number postmaster processes found = 4
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Mirror Segment Status
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:- Mirrors not configured on this array
20131225:15:00:53:001992 gpstate:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
[gpadmin@gtlions101 ~]$ gpstop -M fast
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Starting gpstop with args: -M fast
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:---------------------------------------------
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Master instance parameters
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:---------------------------------------------
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Master Greenplum instance process active PID = 1971
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Database = template1
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Master port = 5432
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Master directory = /data/master/gpseg-1
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Shutdown mode = fast
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Timeout = 600
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Shutdown Master standby host = Off
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:---------------------------------------------
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:-Segment instances that will be shutdown:
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:---------------------------------------------
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- Host Datadir Port Status
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- gtlions102 /data/primary/gpseg0 40000 u
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- gtlions102 /data/primary/gpseg1 40001 u
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- gtlions103 /data/primary/gpseg2 40000 u
20131225:15:04:53:002168 gpstop:gtlions101:gpadmin-[INFO]:- gtlions103 /data/primary/gpseg3 40001 u
Continue with Greenplum instance shutdown Yy|Nn (default=N):
> y
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-There are 0 connections to the database
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='fast'
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Master host=gtlions101
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Detected 0 connections to database
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Using standard WAIT mode of 600 seconds
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=fast
20131225:15:04:55:002168 gpstop:gtlions101:gpadmin-[INFO]:-Master segment instance directory=/data/master/gpseg-1
20131225:15:04:56:002168 gpstop:gtlions101:gpadmin-[INFO]:-No standby master host configured
20131225:15:04:56:002168 gpstop:gtlions101:gpadmin-[INFO]:-Commencing parallel segment instance shutdown, please wait...
...
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:- Segments stopped successfully = 4
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:- Segments with errors during stop = 0
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:-Successfully shutdown 4 of 4 segment instances
20131225:15:04:59:002168 gpstop:gtlions101:gpadmin-[INFO]:-Database successfully shutdown with no errors reported
[gpadmin@gtlions101 ~]$ gpstart -m
20131225:15:05:06:002190 gpstart:gtlions101:gpadmin-[INFO]:-Starting gpstart with args: -m
20131225:15:05:06:002190 gpstart:gtlions101:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:05:06:002190 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:05:06:002190 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Catalog Version: '201109210'
20131225:15:05:06:002190 gpstart:gtlions101:gpadmin-[INFO]:-Master-only start requested in configuration without a standby master.
Continue with master-only startup Yy|Nn (default=N):
> y
20131225:15:05:07:002190 gpstart:gtlions101:gpadmin-[INFO]:-Starting Master instance in admin mode
20131225:15:05:08:002190 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:05:08:002190 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:05:08:002190 gpstart:gtlions101:gpadmin-[INFO]:-Setting new master era
20131225:15:05:08:002190 gpstart:gtlions101:gpadmin-[INFO]:-Master Started...
[gpadmin@gtlions101 ~]$ cd $MASTER_DATA_DIRECTORY
[gpadmin@gtlions101 gpseg-1]$ vi postgresql.conf
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
# values can be found in the PostgreSQL documentation.
#
# The commented-out settings shown in this file represent the default values.
# Re-commenting a setting is NOT sufficient to revert it to the default value;
# you need to reload the server.
#
# This file is read on server startup and when the server receives a SIGHUP
# signal. If you edit the file on a running system, you have to SIGHUP the
# server for the changes to take effect, or use "pg_ctl reload". Some
# parameters, which are marked below, require a server shutdown and restart to
# take effect.
#
# Any parameter can also be given as a command-line option to the server, e.g.,
# "postgres -c log_connections=on". Some parameters can be changed at run time
# with the "SET" SQL command.
#
# Memory units: kB = kilobytes Time units: ms = milliseconds
# MB = megabytes s = seconds
# GB = gigabytes min = minutes
# h = hours
# d = days
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
# (change requires restart)
# each segment has its own port number.
# note: Port numbers for the Greenplum system must also be changed in the
# gp_configuration catalog. See the Greenplum Database Administrator Guide
# for instructions!
# - Previous PostgreSQL Versions -
#add_missing_from = off
#array_nulls = on
#backslash_quote = safe_encoding # on, off, or safe_encoding
#escape_string_warning = on
#regex_flavor = advanced # advanced, extended, or basic
#standard_conforming_strings = off
# - Other Platforms and Clients -
#transform_null_equals = off
#---------------------------------------------------------------------------
# GREENPLUM ARRAY CONFIGURATION
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# GREENPLUM ARRAY TUNING
#---------------------------------------------------------------------------
# - Interconnect -
#gp_max_packet_size = 8192
gp_interconnect_type=udpifc
# - Worker Process Creation -
gp_connections_per_thread = 64
gp_segment_connect_timeout = 600s
#gp_enable_delete_as_truncate = off
# - Resource limits -
gp_vmem_protect_limit = 8192 #Virtual memory limit (in MB).
#gp_vmem_idle_resource_timeout = 18000 # idle-time before gang-release, in milliseconds (zero disables release).
#------------------------------------------------------------------------------
# CUSTOMIZED OPTIONS
#------------------------------------------------------------------------------
#custom_variable_classes = '' # list of custom variable class names
gp_backup_directIO = off # enable\disable dump with direct IO
gp_backup_directIO_read_chunk_mb = 20 # Size of read Chunk buffer in directIO dump (in MB)
gp_crash_handler_async = on
#Greenplum specific configuration parameters for Master instance database
#------------------------------------------------------------------------
log_statement=all
checkpoint_segments=8
checkpoint_segments=8
"postgresql.conf" 524L, 19361C 宸插啓鍏?
[gpadmin@gtlions101 gpseg-1]$ gpstart -m
20131225:15:38:17:002484 gpstart:gtlions101:gpadmin-[INFO]:-Starting gpstart with args: -m
20131225:15:38:17:002484 gpstart:gtlions101:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:38:17:002484 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:38:17:002484 gpstart:gtlions101:gpadmin-[INFO]:-Greenplum Catalog Version: '201109210'
20131225:15:38:17:002484 gpstart:gtlions101:gpadmin-[INFO]:-Master-only start requested in configuration without a standby master.
Continue with master-only startup Yy|Nn (default=N):
> y
20131225:15:38:19:002484 gpstart:gtlions101:gpadmin-[INFO]:-Starting Master instance in admin mode
20131225:15:38:20:002484 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:38:20:002484 gpstart:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:38:20:002484 gpstart:gtlions101:gpadmin-[INFO]:-Setting new master era
20131225:15:38:20:002484 gpstart:gtlions101:gpadmin-[INFO]:-Master Started...
[gpadmin@gtlions101 gpseg-1]$ PGOPTIONS='-c gp_session_role=utility' psql -U gpadmin postgres
psql (8.2.15)
Type "help" for help.
postgres=# update gp_segment_configuration set hostname='gtlions103-1' where address='gtlions103';
UPDATE 2
postgres=# update gp_segment_configuration set hostname='gtlions101-1' where address='gtlions101';
UPDATE 1
postgres=# update gp_segment_configuration set hostname='gtlions102-1' where address='gtlions102';
UPDATE 2
postgres=# select * from gp_segment_configuration;
dbid | content | role | preferred_role | mode | status | port | hostname | address | replication_port | san_mounts
------+---------+------+----------------+------+--------+-------+--------------+------------+------------------+------------
4 | 2 | p | p | s | u | 40000 | gtlions103-1 | gtlions103 | |
5 | 3 | p | p | s | u | 40001 | gtlions103-1 | gtlions103 | |
1 | -1 | p | p | s | u | 5432 | gtlions101-1 | gtlions101 | |
2 | 0 | p | p | s | u | 40000 | gtlions102-1 | gtlions102 | |
3 | 1 | p | p | s | u | 40001 | gtlions102-1 | gtlions102 | |
(5 rows)
postgres=# update gp_segment_configuration set address=hostname;
UPDATE 5
postgres=# select * from gp_segment_configuration;
dbid | content | role | preferred_role | mode | status | port | hostname | address | replication_port | san_mounts
------+---------+------+----------------+------+--------+-------+--------------+--------------+------------------+------------
4 | 2 | p | p | s | u | 40000 | gtlions103-1 | gtlions103-1 | |
5 | 3 | p | p | s | u | 40001 | gtlions103-1 | gtlions103-1 | |
1 | -1 | p | p | s | u | 5432 | gtlions101-1 | gtlions101-1 | |
2 | 0 | p | p | s | u | 40000 | gtlions102-1 | gtlions102-1 | |
3 | 1 | p | p | s | u | 40001 | gtlions102-1 | gtlions102-1 | |
(5 rows)
postgres=# \q
[gpadmin@gtlions101 gpseg-1]$ gpstop -m
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Starting gpstop with args: -m
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-There are 0 connections to the database
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart'
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Master host=gtlions101-1
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=smart
20131225:15:39:15:002513 gpstop:gtlions101:gpadmin-[INFO]:-Master segment instance directory=/data/master/gpseg-1
[gpadmin@gtlions101-1 ~]$ gpssh-exkeys -f gp/hostfile_exkeys
[STEP 1 of 5] create local ID and authorize on local host
... /home/gpadmin/.ssh/id_rsa file exists ... key generation skipped
[STEP 2 of 5] keyscan all hosts and update known_hosts file
[STEP 3 of 5] authorize current user on remote hosts
... send to gtlions102-1
... send to gtlions103-1
[STEP 4 of 5] determine common authentication file content
[STEP 5 of 5] copy authentication files to all remote hosts
... finished key exchange with gtlions102-1
... finished key exchange with gtlions103-1
[INFO] completed successfully
[gpadmin@gtlions101-1 ~]$ gpstart
20131225:15:45:30:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Starting gpstart with args:
20131225:15:45:30:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Gathering information and validating the environment...
20131225:15:45:30:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:45:31:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Greenplum Catalog Version: '201109210'
20131225:15:45:31:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Starting Master instance in admin mode
20131225:15:45:32:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20131225:15:45:32:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:45:32:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Setting new master era
20131225:15:45:32:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Master Started...
20131225:15:45:32:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Shutting down master
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:---------------------------
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Master instance parameters
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:---------------------------
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Database = template1
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Master Port = 5432
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Master directory = /data/master/gpseg-1
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Timeout = 600 seconds
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Master standby = Off
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:---------------------------------------
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Segment instances that will be started
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:---------------------------------------
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- Host Datadir Port
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- gtlions102-1 /data/primary/gpseg0 40000
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- gtlions102-1 /data/primary/gpseg1 40001
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- gtlions103-1 /data/primary/gpseg2 40000
20131225:15:45:33:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- gtlions103-1 /data/primary/gpseg3 40001
Continue with Greenplum instance startup Yy|Nn (default=N):
> y
20131225:15:45:36:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-No standby master configured. skipping...
20131225:15:45:36:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...
....
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Process results...
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- Successful segment starts = 4
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- Failed segment starts = 0
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:- Skipped segment starts (segments are marked down in configuration) = 0
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Successfully started 4 of 4 segment instances
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:40:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Starting Master instance gtlions101-1 directory /data/master/gpseg-1
20131225:15:45:41:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Command pg_ctl reports Master gtlions101-1 instance active
20131225:15:45:41:001758 gpstart:gtlions101-1:gpadmin-[INFO]:-Database successfully started
[gpadmin@gtlions101-1 ~]$ gpstate
20131225:15:45:46:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-Starting gpstate with args:
20131225:15:45:46:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.2.5.2 build 1'
20131225:15:45:46:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-master Greenplum Version: 'PostgreSQL 8.2.15 (Greenplum Database 4.2.5.2 build 1) on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on May 16 2013 23:35:01'
20131225:15:45:46:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-Obtaining Segment details from master...
20131225:15:45:46:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-Gathering data from segments...
..
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-Greenplum instance status summary
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Master instance = Active
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Master standby = No master standby configured
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total segment instance count from metadata = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Primary Segment Status
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total primary segments = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total primary segment valid (at master) = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total primary segment failures (at master) = 0
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of postmaster.pid files missing = 0
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of postmaster.pid files found = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of postmaster.pid PIDs missing = 0
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of postmaster.pid PIDs found = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of /tmp lock files missing = 0
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number of /tmp lock files found = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number postmaster processes missing = 0
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Total number postmaster processes found = 4
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Mirror Segment Status
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:- Mirrors not configured on this array
20131225:15:45:48:001852 gpstate:gtlions101-1:gpadmin-[INFO]:-----------------------------------------------------
[gpadmin@gtlions101-1 ~]$ psql -l
List of databases
Name | Owner | Encoding | Access privileges
-----------+---------+----------+---------------------
postgres | gpadmin | UTF8 |
template0 | gpadmin | UTF8 | =c/gpadmin
: gpadmin=CTc/gpadmin
template1 | gpadmin | UTF8 | =c/gpadmin
: gpadmin=CTc/gpadmin
(3 rows)
[gpadmin@gtlions101-1 ~]$ psql postgres
psql (8.2.15)
Type "help" for help.
postgres=# select * from gp_segment_configuration;
dbid | content | role | preferred_role | mode | status | port | hostname | address | replication_port | san_mounts
------+---------+------+----------------+------+--------+-------+--------------+--------------+------------------+------------
4 | 2 | p | p | s | u | 40000 | gtlions103-1 | gtlions103-1 | |
5 | 3 | p | p | s | u | 40001 | gtlions103-1 | gtlions103-1 | |
1 | -1 | p | p | s | u | 5432 | gtlions101-1 | gtlions101-1 | |
2 | 0 | p | p | s | u | 40000 | gtlions102-1 | gtlions102-1 | |
3 | 1 | p | p | s | u | 40001 | gtlions102-1 | gtlions102-1 | |
(5 rows)
postgres=# \q
-EOF-