gpinitsystem
# su - gpadmin
$ cd $GPHOME
$ gpinitsystem --help
*****************************************************
SYNOPSIS
*****************************************************
gpinitsystem -c <gpinitsystem_config>
[-h <hostfile_gpinitsystem>]
[-B <parallel_processes>]
[-p <postgresql_conf_param_file>]
[-s <standby_master_host>
[-P <standby_master_port>] [-F <standby_master_filespaces>]]
[--max_connections=<number>] [--shared_buffers=<size>]
[--locale=<locale>] [--lc-collate=<locale>]
[--lc-ctype=<locale>] [--lc-messages=<locale>]
[--lc-monetary=<locale>] [--lc-numeric=<locale>]
[--lc-time=<locale>] [--su_password=<password>]
[-S] [-a] [-q] [-l <logfile_directory>] [-D]
gpinitsystem -v
$ gpinitsystem -c /usr/local/greenplum-db/gpinitsystem_config
或者
$ gpinitsystem -c /usr/local/greenplum-db/gpinitsystem_config -h /usr/local/greenplum-db/all_segment
中间出现了错误
20180418:04:30:05:026877 gpinitsystem:node1:gpadmin-[INFO]:-Checking Master host
20180418:04:30:05:026877 gpinitsystem:node1:gpadmin-[INFO]:-Checking new segment hosts, please wait...
./bin/touch: cannot touch ‘/u01/greenplum-data,/u01/greenplum-data/tmp_file_test’: No such file or directory
20180418:04:30:09:gpinitsystem:node1:gpadmin-[FATAL]:-Cannot write to /u01/greenplum-data,/u01/greenplum-data on node2 Script Exiting!
经过分析后发现是 /usr/local/greenplum-db/gpinitsystem_config 的 DATA_DIRECTORY设置出错了,
需要参考 /usr/local/greenplum-db/gpinitsystem_config
修改前 declare -a DATA_DIRECTORY=(/u01/greenplum-data,/u01/greenplum-data)
修改后 declare -a DATA_DIRECTORY=(/u01/greenplum-data)
gpdeletesystem
# su - gpadmin
$ cd $GPHOME
$ gpdeletesystem --help
*****************************************************
SYNOPSIS
*****************************************************
gpdeletesystem -d <master_data_directory> [-B <parallel_processes>]
[-f] [-l <logfile_directory>] [-D]
gpdeletesystem -?
gpdeletesystem -v
强制删除 -f (force)
$ gpdeletesystem -f
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Option -d or --master-data-directory not set. Checking environment variable MASTER_DATA_DIRECTORY
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Checking for database dump files...
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Getting segment information...
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Greenplum Instance Deletion Parameters
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:---------------------------------------
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Greenplum Master hostname = localhost
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Greenplum Master data directory = /u01/greenplum-data/gpseg-1
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Greenplum Master port = 5432
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Greenplum Force delete of dump files = ON
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Batch size = 32
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:---------------------------------------
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:- Segment Instance List
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:---------------------------------------
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Host:Datadir:Port
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-node1:/u01/greenplum-data/gpseg-1:5432
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-node2:/u01/greenplum-data/gpseg0:40000
20180418:05:52:53:012590 gpdeletesystem:node1:gpadmin-[INFO]:-node3:/u01/greenplum-data/gpseg1:40000
Continue with Greenplum instance deletion? Yy|Nn (default=N):
> y
20180418:05:52:55:012590 gpdeletesystem:node1:gpadmin-[INFO]:-FINAL WARNING, you are about to delete the Greenplum instance
20180418:05:52:55:012590 gpdeletesystem:node1:gpadmin-[INFO]:-on master host localhost.
Continue with Greenplum instance deletion? Yy|Nn (default=N):
> y
20180418:05:52:57:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Stopping database...
20180418:05:53:01:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Deleting segments and removing data directories...
20180418:05:53:01:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Waiting for worker threads to complete...
20180418:05:53:02:012590 gpdeletesystem:node1:gpadmin-[INFO]:-Delete system successful.