gprecoverseg

1. Description

In a cluster where the mirror node is started, restore the downtime primary Segment instance or mirrored Segment instance.

2. Parameter options

Parameter name Description
-a Do not prompt the user to confirm.
-B parallel_processes Number of Segments recovered in parallel. If not specified, up to 16 parallel processes will be started, depending on how many Segment instances need to be restored.
-d master_data_directory Master host's data directory. If not specified, use as $MASTER_DATA_DIRECTORY.
-F Doing full replication when recovering a failed node, only incremental is done by default.
-i recover_config_file Specifies a file containing the contents of the failed node that needs to be recovered. Sample files can be generated using the -o command.
-l logfile_directory Directory to write to the log file. The default is ~/gpAdminLogs.
-o output_recover_config_file Specify the file path to output the configuration file sample used when recovering. The sample file contains the currently valid Segment information and their default recovery path. The file is output in the format required by the -i option. Used with the -p option to output the sample file that is restored to a different host.
-p new_recover_host[,...] Specify an alternate host outside the current MatrixDB cluster to recover the faulty segment. Users can specify multiple hosts by comma splitting. The backup host must have MatrixDB installed and have the same hardware and operating system configuration as the current network segment host.
-q Operate in silent mode. The command output is not displayed on the screen, but is still written to the log file.
-r After the Segment restore, the Segment instance may not return to the default role specified for it when the system was initialized. This can put the system in a potentially unbalanced state, as some Segment hosts may have a number of primary Segments that exceed the system's maximum load. This option rebalances by returning the main Segment and mirror Segment to their default roles. All segments must be valid and synchronous before running gprecoverseg -r. If there are any ongoing queries, they will be cancelled and rolled back.
-s s order shows pg_basebackup progress rather than in-place. Very useful when writing to a file or terminal does not support escape sequences.
--no-progress Do not show pg_basebackup progress, which is very useful when writing to a file.
--hba-hostnames Use hostnames instead of CIDR in pg_hba.conf file
-v Set logging output to verbose.
--version Shows the version of this tool.
-? or -h or --help Show help information.

3. Example

Recover all failed Segment instances:

gprecoverseg

After recovery, rebalance the cluster and reset all segments to their default roles:

gprecoverseg -r