Skip to content
Expand and Shrink Greenplum Database
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


readme for gpresize

** gpresize
These scripts can be destructive and are intended for evaluation purposes only!  Some commands 
used by these scripts are not supported by Pivotal.  These steps are intended to evaluate a 
cluster with more segments per host than was originally configured.  The scripts also allow you 
to restore the cluster to the original size.

Please do not use these scripts on a Production cluster.  Use only for Proof of Concept work and
data that is easily restored from an external backup.

These scripts also only work for a single database in a Greenplum cluster.

** Install 
Download from github.
curl " " >
chmod 755

1.  Use gpstate to make sure the database is up and healthy.  Do NOT proceed if you have any 
segments that are down!

2.  Removing database mirroring if enabled with
Note: use gpstate to ensure you don't have any segments that are down.  If you have any segments 
down and you remove mirroring, the database will not work.


3.  Run a gpcrondump backup of the entire database.  This must be done AFTER step 1.

Example (where gpadmin is the name of the database):
gpcrondump -x gpadmin -a -c -g -G -C

4.  Run and pass the number of parallel processes you want to use.
    - Pick a new System Expansion.
    - Enter a blank line for the new hosts you want to add.
    - Enter number of new segments PER HOST you want to add.  
    - Provide directory names such as "/data1/primary" and "/data2/primary".
    - Review the expand file and continue.
    - Expansion will execute and so will an analyze.

./ 8

5.  Test with the increased number of segments per host.  WARNING: If you decide to revert to the 
former configuration, any changes you make in this database will be lost!!

6.  (Optional) Run and pass the expansion file created during the expand process, the 
original database intialization file, and the number of parallel processes you want to use.  You 
only need to run this if you decide to revert to the former configuration.  

Note: You will need to update the gp_init_config file to remove the mirroring information.  
Mirroring will be added back in a later step.

./ gpexpand_inputfile_20161012_174056 gp_init_config 8

7.  Add mirrors back to the configuration ONLY after you have decided to stay with the current 
number of segments per host or you have successfully executed to revert to the former 
configuration.  Run to add mirrors back to the database.  Pass in the name the
standby master if you have one configured.  

./ smdw
You can’t perform that action at this time.