【Oracle 12c Flex Cluster专题】Leaf Node的故障迁移
原文链接:http://allthingsoracle.com/oracle-flex-cluster-leaf-node-failover/ Oracle 在12c中使用hub-and-spoken技术实现了flex cluster的功能(即RAC集群中的每个节点不再需要既运行ASM实例又运行DB实例,各节点可以扮演不同的角色)。相比12c以前的版本,该功能使集群规模的扩大和缩减变得更加靠谱。原因如下:
一个Flex Cluster中可以包含两类节点,分别是hub node和leaf node。 Hub node:
leaf node:
即使flex cluster中没有一个leaf node, hub node也可以正常的像传统rac节点一样工作。但如果flex cluster中只有leaf node没有一个hub node是万万不可的,因为leaf node需要通过hub node上的asm实例获取数据。当集群件启动在lead node上时,leaf node就会根据GNS信息查找所有hub node,然后选择其中一个hub node来获取数据(配置GNS是使用leaf node的重要前提)。一个hub node同时可能被0个或多个leaf node连接,而一个leaf node同时只能连接一个hub node。hub node和lead node之间也会交换心跳信息,只有这样lead mode才能加入集群并作为集群的一部分。 标准集群可无痛转换为flex cluster,但flex cluster无法转为标准集群,除非你重新配置(约等于重装)。 当作为集群的一部分的某hub node挂了,将发生什么?当发生如下情况时,hub node会被从集群中移除:
这种情况发生时,连接着这个hub node的leaf node会自动挑一个活着的hub node来作为数据源。
现状:为了更好的阐述,我搭建了如下结构的12.1.0.2c的flex cluster:
论证:确定hub node host01和leaf node host04是活着的: [root@host01 log]# crsctl get node role status -all
Node 'host01' active role is 'hub'
Node 'host04' active role is 'leaf'
因为当前host01是集群中唯一活着的hub node,所以host04一定连的是host01。而且,host04的警告日志中也可以证明这个事实: [root@host04 trace]#export ORACLE_BASE=/u01/app/grid
[root@host04 ~]# cat $ORACLE_BASE/diag/crs/host04/crs/trace/ocssdrim.trc |grep 'Sending a ping msg to' | tail -1
2016-05-04 10:50:15.315138 : CSSD:1085761856: clssbnmc_PeriodicPing_CB: Sending a ping msg to host host01,number 1,using handle (0x137e5d0) last msg to hub at 4294684730,connection timeout at 4294714730,current time 4294686330
这时启动host02和host05: [root@host01 log]# crsctl get node role status -all
Node 'host01' active role is 'hub'
Node 'host02' active role is 'hub'
Node 'host04' active role is 'leaf'
Node 'host05' active role is 'leaf'
为了确定host05连得是那个hub node,我们看下ocssdrim进程的trace文件: [root@host05 trace]#export ORACLE_BASE=/u01/app/grid
[root@host05 ~]# cat $ORACLE_BASE/diag/crs/host05/crs/trace/ocssdrim.trc |grep 'Sending a ping msg to' | tail -1
2016-05-04 11:12:01.008283 : CSSD:1086187840: clssbnmc_PeriodicPing_CB: Sending a ping msg to host host01,using handle (0x14055d0) last msg to hub at 4294948750,connection timeout at 11454,current time 4294951260]]
我们可以看到host05连得也是host01。 让我们停掉host01上的集群件,来确定所有leaf node都能故障切换到集群中其他存活的hub node,在这里就是host02: [root@host01 log]# crsctl stop crs
[root@host02 ~]# crsctl get node role status -all
Node 'host02' active role is 'hub'
Node 'host04' active role is 'leaf'
Node 'host05' active role is 'leaf'
确定host04切到了host02: [root@host04 ~]# cat $ORACLE_BASE/diag/crs/host04/crs/trace/ocssdrim.trc |grep 'Destroying connection' | tail -1
2016-05-04 11:17:31.932770 : CSSD:1085761856: clssbnmConnDestroy: Destroying connection object (0x1061200) for host host01
[root@host04 ~]# cat $ORACLE_BASE/diag/crs/host04/crs/trace/ocssdrim.trc |grep 'Sending a ping msg to' | tail -1
2016-05-04 11:18:21.860771 : CSSD:1085761856: clssbnmc_PeriodicPing_CB: Sending a ping msg to host host02,number 2,using handle (0x17e2fe0) last msg to hub at 1404044,connection timeout at 1434044,current time 1405324
确定host05切到了host02: [root@host05 ~]# cat $ORACLE_BASE/diag/crs/host05/crs/trace/ocssdrim.trc |grep 'Destroying connection' | tail -1
2016-05-04 11:17:31.873993 : CSSD:1086187840: clssbnmConnDestroy: Destroying connection object (0x16979f0) for host host01
[root@host05 ~]# cat $ORACLE_BASE/diag/crs/host05/crs/trace/ocssdrim.trc |grep 'Sending a ping msg to' | tail -1
2016-05-04 11:17:36.751628 : CSSD:1086187840: clssbnmc_PeriodicPing_CB: Sending a ping msg to host host02,using handle (0x10950b0) last msg to hub at 318184,connection timeout at 348184,current time 319664
总结:
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |