@zhangyy
2020-10-26T14:51:17.000000Z
字数 931
阅读 108
greenplum系列
当GP集群中的某segment的primary失效的时候,会发生主备切换,mirror来接管。那么,怎样恢复发生的role切换呢?
大致步骤如下:
(1)Recover any failed segment instances in place:
$ gprecoverseg
注意:A segment instance can fail for several reasons, such as a host failure, network failure, or disk failure. When a segment instance fails, its status is marked as down in the Greenplum Database system catalog,and its mirror is activated in change tracking mode. In order to bring the failed segment instance back into operation again, you must first correct the problem that made it fail in the first place, and then recover the segment instance in Greenplum Database using gprecoverseg.
(2)确保所有的同步都已完成:
Show detailed status information of a Greenplum Database system:
$ gpstate -s
Show information about mirror segment instances:
$ gpstate -m
(3)rebalance segment by resetting all segments to their preferred role
$ gprecoverseg -r
注意:All segments must be valid and synchronized before running gprecoverseg -r. If there are any in progress queries, they will be cancelled and rolled back.