Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.
/ gpresize Public archive
forked from RunningJon/gpresize

Expand and Shrink Greenplum Database

License

Notifications You must be signed in to change notification settings

vmware-archive/gpresize

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

***********************************************************************************
** Repo is no longer maintained. **
***********************************************************************************

readme for gpresize

**************************************************************************************************
** gpresize
**************************************************************************************************
WARNING!  
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 update_repo.sh from github.
curl "https://raw.githubusercontent.com/pivotalguru/gpresize/master/update_repo.sh " > update_repo.sh
chmod 755 update_repo.sh
./update_repo.sh

Steps:
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 remove_mirroring.sh
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.

Example:
./remove_mirroring.sh

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 expand.sh 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.

Example:
./expand.sh 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 shrink.sh 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.

Example:
./shrink.sh 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 shrink.sh to revert to the former 
configuration.  Run add_mirrors.sh to add mirrors back to the database.  Pass in the name the
standby master if you have one configured.  

Example:
./add_mirrors.sh smdw

About

Expand and Shrink Greenplum Database

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%