When a segment host is not recoverable

If a host is nonoperational, for example, due to hardware failure, recover the segments onto a spare set of hardware resources. If mirroring is enabled, you can recover a segment from its mirror onto an alternate host using gprecoverseg. For example:

  1. $ gprecoverseg -i <recover_config_file>

Where the format of <recover_config_file> is:

  1. filespaceOrder=[<filespace1_name>[:<filespace2_name>:...]<failed_host_address>:
  2. <port>:<fselocation> [<recovery_host_address>:<port>:<replication_port>:<fselocation>
  3. [:<fselocation>:...]]

For example, to recover to a different host than the failed host without additional filespaces configured (besides the default pg_system filespace):

  1. filespaceOrder=sdw5-2:50002:/gpdata/gpseg2 sdw9-2:50002:53002:/gpdata/gpseg2

The gp_segment_configuration and pg_filespace_entry system catalog tables can help determine your current segment configuration so you can plan your mirror recovery configuration. For example, run the following query:

  1. =# SELECT dbid, content, hostname, address, port,
  2. replication_port, fselocation as datadir
  3. FROM gp_segment_configuration, pg_filespace_entry
  4. WHERE dbid=fsedbid
  5. ORDER BY dbid;

The new recovery segment host must be pre-installed with the Greenplum Database software and configured exactly as the existing segment hosts.

Parent topic: Recovering From Segment Failures