检查备用主节点的状态

要检查备用主节点的状态, 可以查询 gp_master_mirroring 视图。

oushu_master$ psql dbname -c 'SELECT * FROM gp_master_mirroring;'

如果尚未在群集设置备用主节点, 则会看到以下输出:

 summary_state  | detail_state | log_time | error_message
----------------+--------------+----------+---------------
 Not Configured |              |          |
(1 row)

如果已配置备用主节点并与主节点同步, 则会看到与以下内容类似的输出:

 summary_state | detail_state | log_time               | error_message
---------------+--------------+------------------------+---------------
 Synchronized  |              | 2018-03-30 21:53:47+00 |
(1 row)