暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

openGauss 3.0一主一备一级联安装

原创 吾喾 2022-10-08
480

参考一主两备安装过程,cluster_config.xml配置文件多一行内容即可。

https://www.modb.pro/db/507970

<DEVICE sn="omm3">
<!-- 节点3的主机名称 -->
<PARAM name="name" value="ccf12"/>
<!-- 节点3所在的AZ及AZ优先级 -->
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
<PARAM name="backIp1" value="192.168.6.203"/>
<PARAM name="sshIp1" value="192.168.6.203"/>
<PARAM name="cascadeRole" value="on"/>                                                     #增加此一行内容
...

检查主从
[omm@ccf11 ~]$ gs_om -t status --detail
[ CMServer State ]

node node_ip instance state
-------------------------------------------------------------------------
1 ccf10 192.168.6.201 1 /opt/openGauss/install/cm/cm_server Primary
2 ccf11 192.168.6.202 2 /opt/openGauss/install/cm/cm_server Standby
3 ccf12 192.168.6.203 3 /opt/openGauss/install/cm/cm_server Standby

[ Cluster State ]

cluster_state : Normal
redistributing : No
balanced : Yes
current_az : AZ_ALL

[ Datanode State ]

node node_ip instance state
---------------------------------------------------------------
1 ccf10 192.168.6.201 6001 /data/openGauss P Primary Normal
2 ccf11 192.168.6.202 6002 /data/openGauss S Standby Normal
3 ccf12 192.168.6.203 6003 /data/openGauss C Cascade Standby Normal

集群状态查询及启停
(1)状态查询
[omm@ccf10 ~]$ cm_ctl query -Cv
[ CMServer State ]

node instance state
-------------------------
1 ccf10 1 Primary
2 ccf11 2 Standby
3 ccf12 3 Standby

[ Cluster State ]

cluster_state : Normal
redistributing : No
balanced : Yes
current_az : AZ_ALL

[ Datanode State ]

node instance state | node instance state | node instance state
---------------------------------------------------------------------------------------------------------------
1 ccf10 6001 P Primary Normal | 2 ccf11 6002 S Standby Normal | 3 ccf12 6003 C Cascade Standby Normal
[omm@ccf10 ~]$

注:测试主备宕机集群异常,集群状态为Unavailable,此时数据库存在Need repair节点。

级联备库宕机,集群状态为Degraded,主备同步正常,但存在故障的数据库节点。

最好还是不要使用级联备库,出现故障时处理麻烦。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论