Pivotal Knowledge Base

Follow

How to use gpexpand (working with one host)

Environment

Product Version
Pivotal Greenplum All Versions

Goal

The below document gives an example on how to expand the segments using one host and also explains a balanced and in-balance method of expanding the cluster/segments.

Solution

Explained below is the example on how to do about.

-- Scenario 1 / In-balance method.

Here I have two segment servers in the configuration ( sdw1 / 2 ) Using gpexpand, I added a third host (sdw3) to the segments and the mirror of sdw3 was passed on to sdw1 ( making sdw1 overloaded which is a in-balance state )

  • My current configuration.
    template1=# select * from gp_segment_configuration ;
     dbid | content | role | preferred_role | mode | status | port  | hostname | address | replication_port | san_mounts
    ------+---------+------+----------------+------+--------+-------+----------+---------+------------------+------------
        1 |      -1 | p    | p              | s    | u      | 15432 | mdw      | mdw     |                  |
        2 |       0 | p    | p              | s    | u      | 50030 | sdw1     | sdw1    |            41600 |
        3 |       1 | p    | p              | s    | u      | 50030 | sdw2     | sdw2    |            41600 |
        4 |       0 | m    | m              | s    | u      | 52000 | sdw2     | sdw2    |            51600 |
        5 |       1 | m    | m              | s    | u      | 52000 | sdw1     | sdw1    |            51600 |
    (5 rows)
     
    Time: 0.935 ms
    template1=# 
    template1=# select * from pg_filespace_entry ;
     fsefsoid | fsedbid |         fselocation
    ----------+---------+-----------------------------
         3052 |       1 | /data/master_test1/gpseg-1
         3052 |       2 | /data1/primary_test1/gpseg0
         3052 |       3 | /data1/primary_test1/gpseg1
         3052 |       4 | /data1/mirror_test1/gpseg0
         3052 |       5 | /data1/mirror_test1/gpseg1
    (5 rows)
     
    Time: 0.745 ms
    template1=# 
  • Expanded the mirror using
    sdw3:sdw3-1:50030:/data1/primary_test1:6:2:p:41610
    sdw1:sdw1-1:52100:/data1/mirror_test2:7:2:m:51610
  • ran the gpexpand
    gpadmin:Fullrack@mdw $ gpexpand -D gpadmin -i expand
    20130401:10:25:46:gpexpand:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.1.2.2 build 3'
    20130401:10:25:47:gpexpand:mdw:gpadmin-[INFO]:-Querying gpexpand schema for current expansion state
    20130401:10:25:47:gpexpand:mdw:gpadmin-[INFO]:-Readying Greenplum Database for a new expansion
    20130401:10:25:54:gpexpand:mdw:gpadmin-[INFO]:-Checking database gpadmin for unalterable tables...
    20130401:10:25:54:gpexpand:mdw:gpadmin-[INFO]:-Checking database postgres for unalterable tables...
    20130401:10:25:54:gpexpand:mdw:gpadmin-[INFO]:-Checking database template1 for unalterable tables...
    20130401:10:25:54:gpexpand:mdw:gpadmin-[INFO]:-Checking database gpadmin for tables with unique indexes...
    20130401:10:25:54:gpexpand:mdw:gpadmin-[INFO]:-Checking database postgres for tables with unique indexes...
    20130401:10:25:54:gpexpand:mdw:gpadmin-[INFO]:-Checking database template1 for tables with unique indexes...
    20130401:10:25:55:gpexpand:mdw:gpadmin-[INFO]:-Creating segment template
    20130401:10:25:55:gpexpand:mdw:gpadmin-[INFO]:-VACUUM FULL on the catalog tables
    20130401:10:25:56:gpexpand:mdw:gpadmin-[INFO]:-Starting copy of segment dbid 1 to location /data/master_test1/gpexpand_04012013_15326
    20130401:10:25:57:gpexpand:mdw:gpadmin-[INFO]:-Copying postgresql.conf from existing segment into template
    20130401:10:25:57:gpexpand:mdw:gpadmin-[INFO]:-Copying pg_hba.conf from existing segment into template
    20130401:10:25:57:gpexpand:mdw:gpadmin-[INFO]:-Adding new segments into template pg_hba.conf
    20130401:10:25:57:gpexpand:mdw:gpadmin-[INFO]:-Creating schema tar file
    20130401:10:25:57:gpexpand:mdw:gpadmin-[INFO]:-Distributing template tar file to new hosts
    20130401:10:26:01:gpexpand:mdw:gpadmin-[INFO]:-Configuring new segments (primary)
    20130401:10:26:02:gpexpand:mdw:gpadmin-[INFO]:-Configuring new segments (mirror)
    20130401:10:26:02:gpexpand:mdw:gpadmin-[INFO]:-Backing up pg_hba.conf file on original segments
    20130401:10:26:03:gpexpand:mdw:gpadmin-[INFO]:-Copying new pg_hba.conf file to original segments
    20130401:10:26:03:gpexpand:mdw:gpadmin-[INFO]:-Configuring original segments
    20130401:10:26:03:gpexpand:mdw:gpadmin-[INFO]:-Cleaning up temporary template files
    20130401:10:26:03:gpexpand:mdw:gpadmin-[INFO]:-Starting Greenplum Database in restricted mode
    20130401:10:26:09:gpexpand:mdw:gpadmin-[INFO]:-Stopping database
    20130401:10:26:14:gpexpand:mdw:gpadmin-[INFO]:-Configuring new segment filespaces
    20130401:10:26:14:gpexpand:mdw:gpadmin-[INFO]:-Cleaning up databases in new segments.
    20130401:10:26:14:gpexpand:mdw:gpadmin-[INFO]:-Starting master in utility mode
    20130401:10:26:15:gpexpand:mdw:gpadmin-[INFO]:-Stopping master in utility mode
    20130401:10:26:19:gpexpand:mdw:gpadmin-[INFO]:-Starting Greenplum Database in restricted mode
    20130401:10:26:25:gpexpand:mdw:gpadmin-[INFO]:-Creating expansion schema
    20130401:10:26:25:gpexpand:mdw:gpadmin-[INFO]:-Populating gpexpand.status_detail with data from database gpadmin
    20130401:10:26:25:gpexpand:mdw:gpadmin-[INFO]:-Populating gpexpand.status_detail with data from database postgres
    20130401:10:26:25:gpexpand:mdw:gpadmin-[INFO]:-Populating gpexpand.status_detail with data from database template1
    20130401:10:26:26:gpexpand:mdw:gpadmin-[INFO]:-Stopping Greenplum Database
    20130401:10:26:31:gpexpand:mdw:gpadmin-[INFO]:-Starting Greenplum Database
    20130401:10:26:37:gpexpand:mdw:gpadmin-[INFO]:-Starting new mirror segment synchronization
    20130401:10:26:48:gpexpand:mdw:gpadmin-[INFO]:-************************************************
    20130401:10:26:48:gpexpand:mdw:gpadmin-[INFO]:-Initialization of the system expansion complete.
    20130401:10:26:48:gpexpand:mdw:gpadmin-[INFO]:-To begin table expansion onto the new segments
    20130401:10:26:48:gpexpand:mdw:gpadmin-[INFO]:-rerun gpexpand
    20130401:10:26:48:gpexpand:mdw:gpadmin-[INFO]:-************************************************
    20130401:10:26:48:gpexpand:mdw:gpadmin-[INFO]:-Exiting...
    Recheck of the segment configuration after the expand run 
    gpadmin:Fullrack@mdw $ gpadmin=# select * from gp_segment_configuration ;
     dbid | content | role | preferred_role | mode | status | port  | hostname | address | replication_port | san_mounts
    ------+---------+------+----------------+------+--------+-------+----------+---------+------------------+------------
        1 |      -1 | p    | p              | s    | u      | 15432 | mdw      | mdw     |                  |
        2 |       0 | p    | p              | s    | u      | 50030 | sdw1     | sdw1    |            41600 |
        3 |       1 | p    | p              | s    | u      | 50030 | sdw2     | sdw2    |            41600 |
        4 |       0 | m    | m              | s    | u      | 52000 | sdw2     | sdw2    |            51600 |
        5 |       1 | m    | m              | s    | u      | 52000 | sdw1     | sdw1    |            51600 |
        6 |       2 | p    | p              | s    | u      | 50030 | sdw3     | sdw3-1  |            41610 |
        7 |       2 | m    | m              | s    | u      | 52100 | sdw1     | sdw1-1  |            51610 |
    (7 rows)
     
    Time: 0.885 ms
    gpadmin=#
    gpadmin=#
    gpadmin=#
    gpadmin=# select * from pg_filespace_entry ;
     fsefsoid | fsedbid |         fselocation
    ----------+---------+-----------------------------
         3052 |       1 | /data/master_test1/gpseg-1
         3052 |       2 | /data1/primary_test1/gpseg0
         3052 |       3 | /data1/primary_test1/gpseg1
         3052 |       4 | /data1/mirror_test1/gpseg0
         3052 |       5 | /data1/mirror_test1/gpseg1
         3052 |       6 | /data1/primary_test1
         3052 |       7 | /data1/mirror_test2
    (7 rows)
     
    Time: 0.665 ms
    gpadmin=#

-- Scenario 2 / Balanced Method .

Here I had two segments in the configuration ( sdw1 / 2 ) , Renamed the mirror directory , Using gprecoverseg I moved the mirror to the new host ( sdw3) Using gpexpand I added a third host (sdw3) to the segments and the mirror of sdw3 was passed on to sdw1 ( this helped in balancing the workload ) .

  • My current configuration
    gpadmin=# select * from gp_segment_configuration ;
     dbid | content | role | preferred_role | mode | status | port  | hostname | address | replication_port | san_mounts
    ------+---------+------+----------------+------+--------+-------+----------+---------+------------------+------------
        1 |      -1 | p    | p              | s    | u      | 15432 | mdw      | mdw     |                  |
        2 |       0 | p    | p              | s    | u      | 50030 | sdw1     | sdw1    |            41600 |
        3 |       1 | p    | p              | s    | u      | 50030 | sdw2     | sdw2    |            41600 |
        4 |       0 | m    | m              | s    | u      | 52000 | sdw2     | sdw2    |            51600 |
        5 |       1 | m    | m              | s    | u      | 52000 | sdw1     | sdw1    |            51600 |
    (5 rows)
     
    Time: 0.888 ms
    gpadmin=# select * from pg_filespace_entry;
     fsefsoid | fsedbid |         fselocation
    ----------+---------+-----------------------------
         3052 |       1 | /data/master_test1/gpseg-1
         3052 |       2 | /data1/primary_test1/gpseg0
         3052 |       3 | /data1/primary_test1/gpseg1
         3052 |       4 | /data1/mirror_test1/gpseg0
         3052 |       5 | /data1/mirror_test1/gpseg1
    (5 rows)
     
    Time: 0.742 ms
    gpadmin=#
  • renamed the folder to mark the mirror segment down.
    [gpadmin@sdw1 ~]$ cd /data1/mirror_test1/gpseg1
    [gpadmin@sdw1 gpseg1]$ cd ..
    [gpadmin@sdw1 mirror_test1]$ ls -ltr
    total 4
    drwx------ 16 gpadmin gpadmin 4096 Apr  1 10:38 gpseg1
    [gpadmin@sdw1 mirror_test1]$ mv gpseg1 gpseg1_bk
    [gpadmin@sdw1 mirror_test1]$ ls -ltr
    total 4
    drwx------ 16 gpadmin gpadmin 4096 Apr  1 10:38 gpseg1_bk
    [gpadmin@sdw1 mirror_test1]$
  • restarted the segments , so that it gets detected ( else it will get detected only after a timeout)
    gpadmin:Fullrack@mdw $ gpstop -a
    20130401:10:45:51:gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -a
    20130401:10:45:51:gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
    20130401:10:45:51:gpstop:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
    20130401:10:45:51:gpstop:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
    20130401:10:45:51:gpstop:mdw:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.1.2.2 build 3'
    20130401:10:45:51:gpstop:mdw:gpadmin-[INFO]:-There are 0 connections to the database
    20130401:10:45:51:gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode='smart'
    20130401:10:45:51:gpstop:mdw:gpadmin-[INFO]:-Master host=mdw
    20130401:10:45:51:gpstop:mdw:gpadmin-[INFO]:-Commencing Master instance shutdown with mode=smart
    20130401:10:45:51:gpstop:mdw:gpadmin-[INFO]:-Master segment instance directory=/data/master_test1/gpseg-1
    20130401:10:45:52:gpstop:mdw:gpadmin-[INFO]:-No standby master host configured
    20130401:10:45:52:gpstop:mdw:gpadmin-[INFO]:-Commencing parallel primary segment instance shutdown, please wait...
    ..
    20130401:10:45:54:gpstop:mdw:gpadmin-[INFO]:-Commencing parallel mirror segment instance shutdown, please wait...
    ..
    20130401:10:45:56:gpstop:mdw:gpadmin-[INFO]:-----------------------------------------------------
    20130401:10:45:56:gpstop:mdw:gpadmin-[INFO]:-   Segments stopped successfully                              = 4
    20130401:10:45:56:gpstop:mdw:gpadmin-[INFO]:-   Segments with errors during stop                           = 0
    20130401:10:45:56:gpstop:mdw:gpadmin-[INFO]:-
    20130401:10:45:56:gpstop:mdw:gpadmin-[WARNING]:-Segments that are currently marked down in configuration   = 1   <<<<<<<<
    20130401:10:45:56:gpstop:mdw:gpadmin-[INFO]:-            (stop was still attempted on these segments)
    20130401:10:45:56:gpstop:mdw:gpadmin-[INFO]:-----------------------------------------------------
    20130401:10:45:56:gpstop:mdw:gpadmin-[INFO]:-Successfully shutdown 4 of 4 segment instances
    20130401:10:45:56:gpstop:mdw:gpadmin-[INFO]:-Database successfully shutdown with no errors reported
    20130401:10:45:56:gpstop:mdw:gpadmin-[INFO]:-Unregistering with DCA
    20130401:10:45:56:gpstop:mdw:gpadmin-[INFO]:-Unregistered with DCA
     
    gpadmin:Fullrack@mdw $ gpstart -a
    20130401:10:46:00:gpstart:mdw:gpadmin-[INFO]:-Starting gpstart with args: -a
    20130401:10:46:00:gpstart:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
    20130401:10:46:00:gpstart:mdw:gpadmin-[INFO]:-Greenplum Binary Version: 'postgres (Greenplum Database) 4.1.2.2 build 3'
    20130401:10:46:00:gpstart:mdw:gpadmin-[INFO]:-Greenplum Catalog Version: '201101130'
    20130401:10:46:00:gpstart:mdw:gpadmin-[INFO]:-Starting Master instance in admin mode
    20130401:10:46:01:gpstart:mdw:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
    20130401:10:46:01:gpstart:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
    20130401:10:46:01:gpstart:mdw:gpadmin-[INFO]:-Master Started...
    20130401:10:46:01:gpstart:mdw:gpadmin-[INFO]:-Shutting down master
    20130401:10:46:02:gpstart:mdw:gpadmin-[WARNING]:-Skipping startup of segment marked down in configuration: on sdw1 directory /data1/mirror_test1/gpseg1 <<<<<
    20130401:10:46:02:gpstart:mdw:gpadmin-[INFO]:-No standby master configured.  skipping...
    20130401:10:46:02:gpstart:mdw:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait...
    ..
    20130401:10:46:04:gpstart:mdw:gpadmin-[INFO]:-Process results...
    20130401:10:46:04:gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
    20130401:10:46:04:gpstart:mdw:gpadmin-[INFO]:-   Successful segment starts                                            = 3
    20130401:10:46:04:gpstart:mdw:gpadmin-[INFO]:-   Failed segment starts                                                = 0
    20130401:10:46:04:gpstart:mdw:gpadmin-[WARNING]:-Skipped segment starts (segments are marked down in configuration)   = 1   <<<<<<<<
    20130401:10:46:04:gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
    20130401:10:46:04:gpstart:mdw:gpadmin-[INFO]:-
    20130401:10:46:04:gpstart:mdw:gpadmin-[INFO]:-Successfully started 3 of 3 segment instances, skipped 1 other segments
    20130401:10:46:04:gpstart:mdw:gpadmin-[INFO]:-----------------------------------------------------
    20130401:10:46:04:gpstart:mdw:gpadmin-[WARNING]:-****************************************************************************
    20130401:10:46:04:gpstart:mdw:gpadmin-[WARNING]:-There are 1 segment(s) marked down in the database
    20130401:10:46:04:gpstart:mdw:gpadmin-[WARNING]:-To recover from this current state, review usage of the gprecoverseg
    20130401:10:46:04:gpstart:mdw:gpadmin-[WARNING]:-management utility which will recover failed segment instance databases.
    20130401:10:46:04:gpstart:mdw:gpadmin-[WARNING]:-****************************************************************************
    20130401:10:46:04:gpstart:mdw:gpadmin-[INFO]:-Starting Master instance mdw directory /data/master_test1/gpseg-1
    20130401:10:46:05:gpstart:mdw:gpadmin-[INFO]:-Command pg_ctl reports Master mdw instance active
    20130401:10:46:05:gpstart:mdw:gpadmin-[WARNING]:-Database started but warnings generated       <<<<<
    20130401:10:46:05:gpstart:mdw:gpadmin-[INFO]:-Check status of database with gpstate utility
    20130401:10:46:05:gpstart:mdw:gpadmin-[INFO]:-Iniializing DCA settings
    20130401:10:46:05:gpstart:mdw:gpadmin-[INFO]:-DCA settings initialized
    gpadmin:Fullrack@mdw $
  • The segment is now down.
    gpadmin=# select * from gp_segment_configuration ;
     dbid | content | role | preferred_role | mode | status | port  | hostname | address | replication_port | san_mounts
    ------+---------+------+----------------+------+--------+-------+----------+---------+------------------+------------
        1 |      -1 | p    | p              | s    | u      | 15432 | mdw      | mdw     |                  |
        2 |       0 | p    | p              | s    | u      | 50030 | sdw1     | sdw1    |            41600 |
        4 |       0 | m    | m              | s    | u      | 52000 | sdw2     | sdw2    |            51600 |
        3 |       1 | p    | p              | c    | u      | 50030 | sdw2     | sdw2    |            41600 |
        5 |       1 | m    | m              | s    | d      | 52000 | sdw1     | sdw1    |            51600 |
    (5 rows)
     
    Time: 0.839 ms
    gpadmin=#
  • moved the mirror to a new segments
    gpadmin:Fullrack@mdw $ gprecoverseg -p sdw3
    20130401:10:46:54:gprecoverseg:mdw:gpadmin-[INFO]:-Starting gprecoverseg with args: -p sdw3
    20130401:10:46:54:gprecoverseg:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.1.2.2 build 3'
    20130401:10:46:54:gprecoverseg:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[WARNING]:-Failed to resolve hostname for sdw31
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-Greenplum instance recovery parameters
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:----------------------------------------------------------
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-Recovery type              = Pool Host
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-Pool host for recovery     = sdw3
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:----------------------------------------------------------
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-Recovery 1 of 1
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:----------------------------------------------------------
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Synchronization mode                        = Full
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Failed instance host                        = sdw1
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Failed instance address                     = sdw1
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Failed instance directory                   = /data1/mirror_test1/gpseg1
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Failed instance port                        = 52000
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Failed instance replication port            = 51600
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Source instance host               = sdw2
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Source instance address            = sdw2
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Source instance directory          = /data1/primary_test1/gpseg1
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Source instance port               = 50030
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Source instance replication port   = 41600
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Target instance host               = sdw3
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Target instance address            = sdw3
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Target instance directory          = /data1/mirror_test1/gpseg1
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Target instance port               = 50030
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Target instance replication port   = 41600
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[INFO]:----------------------------------------------------------
    20130401:10:46:57:gprecoverseg:mdw:gpadmin-[WARNING]:-Lookup of sdw31 failed.  Using sdw3 for both hostname and address.
     
    Continue with segment recovery procedure Yy|Nn (default=N):
    > y
    20130401:10:47:02:gprecoverseg:mdw:gpadmin-[INFO]:-1 segment(s) to recover
    20130401:10:47:02:gprecoverseg:mdw:gpadmin-[INFO]:-Ensuring 1 failed segment(s) are stopped
    .
    20130401:10:47:03:gprecoverseg:mdw:gpadmin-[INFO]:-Building template directory
    20130401:10:47:04:gprecoverseg:mdw:gpadmin-[INFO]:-Validating remote directories
    .
    20130401:10:47:05:gprecoverseg:mdw:gpadmin-[INFO]:-Copying template directory file
    .
    20130401:10:47:06:gprecoverseg:mdw:gpadmin-[INFO]:-Configuring new segments
    .
    20130401:10:47:07:gprecoverseg:mdw:gpadmin-[INFO]:-Cleaning files
    .
    20130401:10:47:08:gprecoverseg:mdw:gpadmin-[INFO]:-Updating configuration with new mirrors
    20130401:10:47:08:gprecoverseg:mdw:gpadmin-[INFO]:-Updating mirrors
    .
    20130401:10:47:09:gprecoverseg:mdw:gpadmin-[INFO]:-Starting mirrors
    20130401:10:47:09:gprecoverseg:mdw:gpadmin-[INFO]:-Commencing parallel primary and mirror segment instance startup, please wait...
    ..
    20130401:10:47:11:gprecoverseg:mdw:gpadmin-[INFO]:-Process results...
    20130401:10:47:11:gprecoverseg:mdw:gpadmin-[INFO]:-Updating configuration to mark mirrors up
    20130401:10:47:11:gprecoverseg:mdw:gpadmin-[INFO]:-Updating primaries
    20130401:10:47:11:gprecoverseg:mdw:gpadmin-[INFO]:-Commencing parallel primary conversion of 1 segments, please wait...
    ..
    20130401:10:47:13:gprecoverseg:mdw:gpadmin-[INFO]:-Process results...
    20130401:10:47:13:gprecoverseg:mdw:gpadmin-[INFO]:-Done updating primaries
    20130401:10:47:13:gprecoverseg:mdw:gpadmin-[INFO]:-******************************************************************
    20130401:10:47:13:gprecoverseg:mdw:gpadmin-[INFO]:-Updating segments for resynchronization is completed.
    20130401:10:47:13:gprecoverseg:mdw:gpadmin-[INFO]:-For segments updated successfully, resynchronization will continue in the background.
    20130401:10:47:13:gprecoverseg:mdw:gpadmin-[INFO]:-
    20130401:10:47:13:gprecoverseg:mdw:gpadmin-[INFO]:-Use  gpstate -s  to check the resynchronization progress.
    20130401:10:47:13:gprecoverseg:mdw:gpadmin-[INFO]:-******************************************************************
    gpadmin:Fullrack@mdw $
  • status after the movement
    gpadmin=# select * from gp_segment_configuration ;
     dbid | content | role | preferred_role | mode | status | port  | hostname | address | replication_port | san_mounts
    ------+---------+------+----------------+------+--------+-------+----------+---------+------------------+------------
        1 |      -1 | p    | p              | s    | u      | 15432 | mdw      | mdw     |                  |
        2 |       0 | p    | p              | s    | u      | 50030 | sdw1     | sdw1    |            41600 |
        4 |       0 | m    | m              | s    | u      | 52000 | sdw2     | sdw2    |            51600 |
        3 |       1 | p    | p              | r    | u      | 50030 | sdw2     | sdw2    |            41600 |
        5 |       1 | m    | m              | r    | u      | 50030 | sdw3     | sdw3    |            41600 |
    (5 rows)
     
    Time: 0.897 ms
    gpadmin=#
  • created a input file.
    gpadmin:Fullrack@mdw $ cat expand
    sdw3:sdw3-1:50130:/data1/primary_test1:6:2:p:41620
    sdw1:sdw1-1:52100:/data1/mirror_test2:7:2:m:51620
    gpadmin:Fullrack@mdw $
  • gpexpand run / was a success.
    gpadmin:Fullrack@mdw $ gpexpand -D gpadmin -i expand
    20130401:11:14:38:gpexpand:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.1.2.2 build 3'
    20130401:11:14:38:gpexpand:mdw:gpadmin-[INFO]:-Querying gpexpand schema for current expansion state
    20130401:11:14:38:gpexpand:mdw:gpadmin-[INFO]:-Readying Greenplum Database for a new expansion
    20130401:11:14:45:gpexpand:mdw:gpadmin-[INFO]:-Checking database faisal for unalterable tables...
    20130401:11:14:45:gpexpand:mdw:gpadmin-[INFO]:-Checking database postgres for unalterable tables...
    20130401:11:14:45:gpexpand:mdw:gpadmin-[INFO]:-Checking database gpadmin for unalterable tables...
    20130401:11:14:45:gpexpand:mdw:gpadmin-[INFO]:-Checking database template1 for unalterable tables...
    20130401:11:14:45:gpexpand:mdw:gpadmin-[INFO]:-Checking database faisal for tables with unique indexes...
    20130401:11:14:45:gpexpand:mdw:gpadmin-[INFO]:-Checking database postgres for tables with unique indexes...
    20130401:11:14:45:gpexpand:mdw:gpadmin-[INFO]:-Checking database gpadmin for tables with unique indexes...
    20130401:11:14:45:gpexpand:mdw:gpadmin-[INFO]:-Checking database template1 for tables with unique indexes...
    20130401:11:14:45:gpexpand:mdw:gpadmin-[INFO]:-Creating segment template
    20130401:11:14:45:gpexpand:mdw:gpadmin-[INFO]:-VACUUM FULL on the catalog tables
    20130401:11:14:47:gpexpand:mdw:gpadmin-[INFO]:-Starting copy of segment dbid 1 to location /data/master_test1/gpexpand_04012013_23780
    20130401:11:14:47:gpexpand:mdw:gpadmin-[INFO]:-Copying postgresql.conf from existing segment into template
    20130401:11:14:47:gpexpand:mdw:gpadmin-[INFO]:-Copying pg_hba.conf from existing segment into template
    20130401:11:14:47:gpexpand:mdw:gpadmin-[INFO]:-Adding new segments into template pg_hba.conf
    20130401:11:14:47:gpexpand:mdw:gpadmin-[INFO]:-Creating schema tar file
    20130401:11:14:48:gpexpand:mdw:gpadmin-[INFO]:-Distributing template tar file to new hosts
    20130401:11:14:52:gpexpand:mdw:gpadmin-[INFO]:-Configuring new segments (primary)
    20130401:11:14:53:gpexpand:mdw:gpadmin-[INFO]:-Configuring new segments (mirror)
    20130401:11:14:54:gpexpand:mdw:gpadmin-[INFO]:-Backing up pg_hba.conf file on original segments
    20130401:11:14:54:gpexpand:mdw:gpadmin-[INFO]:-Copying new pg_hba.conf file to original segments
    20130401:11:14:54:gpexpand:mdw:gpadmin-[INFO]:-Configuring original segments
    20130401:11:14:54:gpexpand:mdw:gpadmin-[INFO]:-Cleaning up temporary template files
    20130401:11:14:55:gpexpand:mdw:gpadmin-[INFO]:-Starting Greenplum Database in restricted mode
    20130401:11:15:00:gpexpand:mdw:gpadmin-[INFO]:-Stopping database
    20130401:11:15:06:gpexpand:mdw:gpadmin-[INFO]:-Configuring new segment filespaces
    20130401:11:15:06:gpexpand:mdw:gpadmin-[INFO]:-Cleaning up databases in new segments.
    20130401:11:15:06:gpexpand:mdw:gpadmin-[INFO]:-Starting master in utility mode
    20130401:11:15:07:gpexpand:mdw:gpadmin-[INFO]:-Stopping master in utility mode
    20130401:11:15:11:gpexpand:mdw:gpadmin-[INFO]:-Starting Greenplum Database in restricted mode
    20130401:11:15:17:gpexpand:mdw:gpadmin-[INFO]:-Creating expansion schema
    20130401:11:15:17:gpexpand:mdw:gpadmin-[INFO]:-Populating gpexpand.status_detail with data from database faisal
    20130401:11:15:17:gpexpand:mdw:gpadmin-[INFO]:-Populating gpexpand.status_detail with data from database postgres
    20130401:11:15:17:gpexpand:mdw:gpadmin-[INFO]:-Populating gpexpand.status_detail with data from database gpadmin
    20130401:11:15:17:gpexpand:mdw:gpadmin-[INFO]:-Populating gpexpand.status_detail with data from database template1
    20130401:11:15:17:gpexpand:mdw:gpadmin-[INFO]:-Stopping Greenplum Database
    20130401:11:15:23:gpexpand:mdw:gpadmin-[INFO]:-Starting Greenplum Database
    20130401:11:15:29:gpexpand:mdw:gpadmin-[INFO]:-Starting new mirror segment synchronization
    20130401:11:15:43:gpexpand:mdw:gpadmin-[INFO]:-************************************************
    20130401:11:15:43:gpexpand:mdw:gpadmin-[INFO]:-Initialization of the system expansion complete.
    20130401:11:15:43:gpexpand:mdw:gpadmin-[INFO]:-To begin table expansion onto the new segments
    20130401:11:15:43:gpexpand:mdw:gpadmin-[INFO]:-rerun gpexpand
    20130401:11:15:43:gpexpand:mdw:gpadmin-[INFO]:-************************************************
    20130401:11:15:43:gpexpand:mdw:gpadmin-[INFO]:-Exiting...
  • The status of the configuration , this now a balanced configuration.
    gpadmin=# select * from gp_segment_configuration ;
     dbid | content | role | preferred_role | mode | status | port  | hostname | address | replication_port | san_mounts
    ------+---------+------+----------------+------+--------+-------+----------+---------+------------------+------------
        1 |      -1 | p    | p              | s    | u      | 15432 | mdw      | mdw     |                  |
        2 |       0 | p    | p              | s    | u      | 50030 | sdw1     | sdw1    |            41600 |
        4 |       0 | m    | m              | s    | u      | 52000 | sdw2     | sdw2    |            51600 |
        6 |       2 | p    | p              | r    | u      | 50130 | sdw3     | sdw3-1  |            41620 |
        3 |       1 | p    | p              | s    | u      | 50030 | sdw2     | sdw2    |            41600 |
        5 |       1 | m    | m              | s    | u      | 50030 | sdw3     | sdw3    |            41600 |
        7 |       2 | m    | m              | r    | u      | 52100 | sdw1     | sdw1-1  |            51620 |
    (7 rows)
     
    Time: 0.860 ms
    gpadmin=#
    gpadmin=#
    gpadmin=#
    gpadmin=# select * from pg_filespace_entry ;
     fsefsoid | fsedbid |         fselocation
    ----------+---------+-----------------------------
         3052 |       1 | /data/master_test1/gpseg-1
         3052 |       2 | /data1/primary_test1/gpseg0
         3052 |       3 | /data1/primary_test1/gpseg1
         3052 |       4 | /data1/mirror_test1/gpseg0
         3052 |       6 | /data1/primary_test1
         3052 |       5 | /data1/mirror_test1/gpseg1
         3052 |       7 | /data1/mirror_test2
    (7 rows)
     
    Time: 0.639 ms
    gpadmin=#

Comments

Powered by Zendesk