ORACLE 12CR2 RAC Flex集群与传统标准集群的区别与设置
本文主要讲述安装配置ORACLE 12C R2 RAC时,需要注意的方面:即是Flex集群还是传统的标准集群,默认安装的情况下为传统标准的Flex集群https://www.cndba.cn/Marvinn/article/2760
环境配置
环境 配置
数据库版本 12.2.0.1
系统版本 centos 7
物理内存 4G
CPU 2颗 逻辑4核
https://www.cndba.cn/Marvinn/article/2760
IP配置
# Public Network - (eth0)
172.16.10.116 rac12chub1
172.16.10.142 rac12chub2
# Private Interconnect - (eth1)
192.168.122.222 rac12chub1-priv
192.168.122.238 rac12chub2-priv
# Public Virtual IP (VIP) addresses - (eth0:1)
172.16.10.134 rac12chub1-vip
172.16.10.135 rac12chub2-vip
172.16.10.150 racnode-scanip
标准集群安装方式,这里不再赘述…..跟11GR2 RAC安装基本相同,不同之处在于 MGMT是否跟OCRVOTE放一起以及是否采用Flex 冗余方式 ,另外值得注意的是:
注意: 标准集群即默认为Flex 集群,是因为在选私有IP选定时,默认选择为Private&Asm 导致为Flex ASM产生了Flex 集群,若只选择为Private,则为传统的标准集群,但可升级为Flex 集群(即传统Asm需变更为Flex Asm),
默认选择Private&Asm安装集群后Mode查看为Flex 集群:
grid@rac12chub2:/home/grid>asmcmd showclustermode
ASM cluster : Flex mode enabled
但是,预检查碰到一个错误, Same core file name pattern,简单说两个节点core 文件值不同,具体原因请查看连接
解决方法:
两个节点执行查看ocre_pattern值
# sysctl kernel.core_pattern
关闭当前被更改core_pattern值节点上的abrtd 服务
# semanage fcontext -a -t public_content_rw_t "/some/dir(/.*)?"
# setsebool -P abrt_anon_write 1
# service abrtd stop
再次查看两个节点ocre_pattern值,检查相同通过
# sysctl kernel.core_pattern
至此…RAC12C 环境是搭建完成…
注意: 标准集群即默认为Flex 集群,是因为在选私有IP选定时,选择为Private&Asm 导致为Flex ASM产生了Flex 集群,若只选择为Private,则为传统的标准集群,但可升级为Flex 集群(即传统Asm需变更为Flex Asm)https://www.cndba.cn/Marvinn/article/2760
https://www.cndba.cn/Marvinn/article/2760https://www.cndba.cn/Marvinn/article/2760
演示过程:
https://www.cndba.cn/Marvinn/article/2760
11G 传统集群RAC: 其中选定为私有Private,并未指定ASM
grid@rac2:/home/grid>oifcfg getif
ens160 172.41.176.0 global public
ens192 10.10.10.0 global cluster_interconnect
grid@rac2:/home/grid>crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
12C 传统FlexRAC:其中选定为私有Private&Asm,默认指定ASM为Private,
grid@rac12chub2:/home/grid>oifcfg getif
eth0 172.16.10.0 global public
eth1 192.168.122.0 global cluster_interconnect,asm
grid@rac12chub2:/home/grid>crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
grid@rac12chub2:/home/grid>crsctl get node role config -all
Node 'rac12chub1' configured role is 'hub'
Node 'rac12chub2' configured role is 'hub'
总结:
1、若想搭建跟11G RAC相同架构,则私有IP选择需只选择选择Private即可,但角色仍然为Hub.后续可以转换为Flex ASM
2、若想Private 跟 ASM 分开,则需要ASM 需独占IP(两个节点则需再添加两个网卡对应两个IP),原私有IP只选定为Private,现指定ASM IP则指定为ASM,则输出结果为:ASM独占一行
[root@dg2 ~]# oifcfg getif
eth0 192.168.8.0 global public
eth1 192.168.7.0 global cluster_interconnect
eth2 192.168.7.0 global asm
标准ORACLE Flex ASM架构
传统Flex 集群RAC12C 与传统集群的11G RAC相比,最大不同得是有Hub以及Leaf节点的存在,而Hub节点类似于传统集群节点,但是存在一个最大区别:即传统集群节点11G RAC是ASM实例与数据库实例绑定,ASM实例宕机则直接导致数据库实例无法访问,但是该方式在Flex集群中已将ASM和数据库实例进行了分割,本机ASM实例宕了,其ASM服务飘在其他节点,数据库实例仍然是可以访问的,架构如下:
https://www.cndba.cn/Marvinn/article/2760https://www.cndba.cn/Marvinn/article/2760
Oracle Flex ASM 配置上的 ASM 实例故障:
https://www.cndba.cn/Marvinn/article/2760
1. 登录 RAC 数据库实例 1 (rac1)
[root@rac12chub2 bin]# hostname
rac12chub2
2. 检查 ASM 实例和 RAC 数据库实例的状态
oracle@rac12chub2:/home/oracle>ps -ef | grep pmon
grid 16355 1 0 13:23 ? 00:00:00 asm_pmon_+ASM2
oracle 16641 1 0 13:23 ? 00:00:00 ora_pmon_marvin2
oracle 18325 18277 0 13:28 pts/0 00:00:00 grep --color=auto pmon
3. 从数据库实例 检查 RAC 数据库实例中 ASM 实例的状态
oracle@rac12chub2:/home/oracle>srvctl status asm
ASM is running on rac12chub1,rac12chub2
4. 在ASM实例中检查集群状态
grid@rac12chub2:/home/grid>crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
5. 用于检查 Oracle Flex ASM 是否启用的命令 (rac12chub2)
grid@rac12chub2:/home/grid>asmcmd showclustermode
ASM cluster : Flex mode enabled
grid@rac12chub2:/home/grid>asmcmd showclusterstate
Normal
6. 用于更改 ASM 基数的命令 (rac12chub2)
grid@rac12chub2:/home/grid>srvctl status asm -detail
ASM is running on rac12chub1,rac12chub2
ASM is enabled.
ASM instance +ASM1 is running on node rac12chub1
Number of connected clients: 2
Client names: marvin1:marvin:rac12ch-cluster rac12chub1:_OCR:rac12ch-cluster
ASM instance +ASM2 is running on node rac12chub2
Number of connected clients: 2
Client names: marvin2:marvin:rac12ch-cluster rac12chub2:_OCR:rac12ch-cluster
查看Asm配置
grid@rac12chub2:/home/grid>srvctl config asm -detail
ASM home:
Password file: +OCR/orapwASM
Backup of Password file:
ASM listener: LISTENER
ASM is enabled.
ASM is individually enabled on nodes:
ASM is individually disabled on nodes:
ASM instance count: 3
Cluster ASM listener: ASMNET1LSNR_ASM
8. 在 RAC 实例 2 (rac12chub) 中关闭 ASM 实例
grid@rac12chub2:/home/grid>srvctl stop asm -node rac12chub2 -stopoption abort -force
grid@rac12chub2:/home/grid>
9. 在 RAC 实例 2 (rac12chub) 中检查 ASM 实例的状态 ,发现ASM实例并未运行在节点2上
grid@rac12chub2:/home/grid>srvctl status asm
ASM is running on rac12chub1
10. 在 RAC 实例 2 (rac12chub) 中检查集群服务的状态,但是集群状态确实正常
grid@rac12chub2:/home/grid>crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
11. 在 RAC 实例 2 (rac12chub) 中检查 ASM 和 RAC 数据库的状态
grid@rac12chub2:/home/grid>ps -ef | grep pmon
oracle 16641 1 0 13:23 ? 00:00:00 ora_pmon_marvin2
grid 20676 18559 0 13:35 pts/0 00:00:00 grep --color=auto pmon
注:在这里,数据库实例与特定节点中运行的特定 ASM 实例关联。如果因为某种原因,ASM 实例无法启动/服务关闭(当前服务关闭),数据库实例仍然可以启动,因为数据库实例将查找同一集群中运行的其他 ASM 实例。上图已描绘了 Flex ASM 的高可用特性。
12. 在 RAC 数据库实例 2 (rac12chub) 中检查没有 ASM 实例的正在运行的 RAC 数据库实例的状态
oracle@rac12chub2:/home/oracle>. oraenv
ORACLE_SID = [marvin2] ?
ORACLE_HOME = [/home/oracle] ?
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID oracle.
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base remains unchanged with value /u01/oracle
13. 从RAC 数据库实例 2 (rac12chub) 登录数据库实例
oracle@rac12chub2:/home/oracle>sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Wed May 2 13:37:48 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
oracle@rac12chub2:/home/oracle>sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Wed May 2 13:37:57 2018
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> select instance_name,instance_number from gv$instance;
INSTANCE_NAME INSTANCE_NUMBER
---------------- ---------------
marvin2 2
marvin1 1
SQL> select instance_name,instance_number from v$instance;
INSTANCE_NAME INSTANCE_NUMBER
---------------- ---------------
marvin2 2
SQL> select instance_name,instance_number from gv$instance;
INSTANCE_NAME INSTANCE_NUMBER
---------------- ---------------
marvin2 2
marvin1 1
14. 查看RAC实例2 GI状态
grid@rac12chub2:/home/grid>crsctl status res -t
1 OFFLINE OFFLINE STABLE
ora.asm
1 ONLINE ONLINE rac12chub1 Started,STABLE
2 OFFLINE OFFLINE Instance Shutdown,ST
ABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE rac12chub1 STABLE
总结:数据库实例使用一个专用 ASM 实例,我们强制该 ASM 实例被停止工作来模拟故障,因此数据库实例重新连接到另一节点,并且数据库仍然可以正常使用(在本示例中为节点 1 (rac12chub1))上的现有 ASM 实例。
15. 重新节点2上ASM服务
grid@rac12chub2:/home/grid>srvctl start asm -node rac12chub2
grid@rac12chub2:/home/grid>crsctl status res -t
---------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac12chub1 STABLE
ora.MGMTLSNR
1 OFFLINE OFFLINE STABLE
ora.asm
1 ONLINE ONLINE rac12chub1 Started,STABLE
2 ONLINE ONLINE rac12chub2 Started,STABLE
3 OFFLINE OFFLINE STABLE
ora.cvu
1 ONLINE ONLINE rac12chub1 STABLE
grid@rac12chub2:/home/grid>srvctl status asm
ASM is running on rac12chub1,rac12chub2
版权声明:本文为博主原创文章,未经博主允许不得转载。