0
点赞
收藏
分享

微信扫一扫

opengauss出现双主解决办法

一、概述

当搭建了主从,单独启动启动其中的一个实例,尽量使用-M指定是主节点还是从节点,如果不指定,默认是主节点,就会出现双主现象

二、试验

1、查询opengauss集群状态

gs_om -t status –detail  ------此命令常用,使用频率高

Cluster_state:Unavailable  ------表示openGauss不可用

opengauss出现双主解决办法_数据库

2、在备节点关闭opengauss

命令:gs_ctl stop -D /gauss/data/db1

opengauss出现双主解决办法_数据_02

3、在备节点,以standby模式启动备节点

命令:gs_ctl start -D /gauss/data/db1 -M standby

opengauss出现双主解决办法_数据库_03

4、查看openGauss进程是否启动

命令:ps -ef|grep gauss

opengauss出现双主解决办法_数据_04

5、保存集群主备机器信息

命令:gs_om -t refreshconf

opengauss出现双主解决办法_log日志_05

6、查询openGauss集群状态

命令:gs_om -t status –detail

状态解释:

cluster_state:Degraded ------表示openGauss可用,但存在故障的数据库节点实例

Need  repair ------表示当前节点需要修复

opengauss出现双主解决办法_数据_06

7、备库执行重建修复

命令:gs_ctl build -D /gauss/data/db1

通过解析xlog日志获取主备机差异的数据进行增量修复备机。

opengauss出现双主解决办法_数据_07


opengauss出现双主解决办法_数据库_08

8、查询openGauss集群状态

命令:gs_om -t status –detail

状态解释:

cluster_state:Normal 

opengauss出现双主解决办法_log日志_09

举报

相关推荐

0 条评论