如何在 oracle 集群环境下修改私网信息

举报
snowofsummer 发表于 2021/01/14 16:27:48 2021/01/14
【摘要】 例1: 更改私有主机名在 11.2 oracle clusterware 之前的版本,私有主机名被记录在 OCR 中, 它不能被更改,一般情况下私有主机名是不需要改变的,它附属的 ip 可以被更改,只有使用删除/添加节点或重新安装 oracle clusterware 来更改私有主机名。在 11.2 Grid 结构中,私有主机名不在记录在 OCR 中,并且不存在依赖关系,所以它可以在 /et...

例1: 更改私有主机名

在 11.2 oracle clusterware 之前的版本,私有主机名被记录在 OCR 中, 它不能被更改,一般情况下私有主机名是不需要改变的,它附属的 ip 可以被更改,只有使用删除/添加节点或重新安装 oracle clusterware 来更改私有主机名。

在 11.2 Grid 结构中,私有主机名不在记录在 OCR 中,并且不存在依赖关系,所以它可以在 /etc/hosts 文件中任意更改。

例2:只更改私有 ip 地址不更改网卡、子网及子网掩码信息

举例,私有 ip 地址从 192.XXX.X.10 更改至 192.XXX.X.21,网卡名字及子网保持不变。或者只改变MAC地址,保持private IP address/interface name/subnet/network不变

只要关闭需要更改主机上的 oracle clusterware 软件,在操作系统层,根据需求更改私有 ip 地址或者MAC地址(如:/etc/hosts,OS network config 等等), 再重启启动 oracle clusterware 软件即可。

例3:只改变私有网络的 MTU 值

举例, 将私有网络 MTU 值从1500更改至9000(激活 jumbo frame),网卡名字保持不变。

1. 关闭集群中的所有节点。
2. 在操作系统层更改 MTU 需要设定的值,确保更改后 MTU 值的私有网卡可用并且可以 ping 通集群中的所有节点。
3. 重启所有节点的集群管理软件。

例4:更改私有网卡名字,子网及掩码

1. 确保集群中的所有节点都已启动并正常运行

2. 使用 grid 用户:

获取下面信息, 例如:

$ oifcfg getif
<interfacename>1 100.17.10.0 global public
<interfacename>0 192.168.0.0 global cluster_interconnect


加入新的集群私网通讯信息:

$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect

例如:
a. 加入新的并有相同子网的接口卡 bond0
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect

b. add a new subnet with the same interface name but different subnet or new interface name
$ 添加一个新的子网具有相同网卡的名称但不同的子网或新的网卡名

$ oifcfg setif -global eth3/192.168.1.96:cluster_interconnect

1. 确保 oracle 集群中的所有节点都已正常运行。

2. 使用 grid 用户:

得到现有信息,如下:

$ oifcfg getif
<interfacename>1 100.17.10.0 global public
<interfacename>0 192.168.0.0 global cluster_interconnect,asm

上面例子显示网卡 ech0 被用作集群私网和 ASM 网络。

加入新的集群私网信息:

$ oifcfg setif -global <interface>/<subnet>:cluster_interconnect[,asm]

如:
a. 加入一个新的具有相同子网网卡 bond0
$ oifcfg setif -global bond0/192.168.0.0:cluster_interconnect,asm

b. 加入一个新的并具有相同网卡名字的子网,或不同子网和具有新的接口名字
$ oifcfg setif -global eth0/192.68.10.0:cluster_interconnect,asm

$ oifcfg setif -global eth3/192.168.1.96:cluster_interconnect,asm

 如果有不同的网络用于私有网络和 ASM 网络,则可以对其进行相应的调整。

3. 当 ASMLISTENER 正被用作私有网络,如果对其修改则会影响 ASMLISTENER。需要添加一个新的 ASMLISTENER 及新的网络配置。如果 ASM 的子网网络没有改变则跳过这一步。

3.1. 加入一个新的 ASMLISTENE(例:ASMNEWLISNR_ASM)及新的子网,使用 grid 用户:

$ srvctl add  listener -asmlistener -l <new ASM LISTENER NAME> -subnet <new subnet>

如:
$ srvctl add listener -asmlistener -l ASMNEWLSNR_ASM -subnet 192.168.10.0

3.2. 删除现有的 ASMLISTENER(这个例子中 ASMLSNR_ASM)并去除依赖关系,使用 grid 用户:

$ srvctl update listener -listener ASMLSNR_ASM -asm -remove -force
$ lsnrctl stop ASMLSNR_ASM

 

注意. 需要使用 –force 选项,否则会出现下面错误:

$ srvctl update listener -listener ASMLSNR_ASM -asm -remove
PRCR-1025 : Resource ora.ASMLSNR_ASM.lsnr is still running
$ srvctl stop listener -l ASMLSNR_ASM
PRCR-1065 : Failed to stop resource ora.ASMLSNR_ASM.lsnr
CRS-2529: Unable to act on 'ora.ASMLSNR_ASM.lsnr' because that would require stopping or relocating 'ora.asm', but the force option was not specified


3.3 校验配置信息:

$ srvctl config listener -asmlistener
$ srvctl config asm


4. 使用 root 用户关闭集群中的所有节点并禁用集群:

# crsctl stop crs
# crsctl disable crs

5. 在操作系统层面更改网络配置,更改之后,确保所有节点上的新网卡生效:

$ ifconfig -a
$ ping <private hostname>

6. 使用 root 用户激活 oracle 集群并重新启动集群中的所有节点:

# crsctl enable crs
# crsctl start crs

7. 删除旧的网卡信息:

$ oifcfg delif -global <interface>[/<subnet>]
如:
$ oifcfg delif -global <interfacename>0/192.168.0.0

 

 

参考文章:(Doc ID 2103317.1)

【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

举报
请填写举报理由
0/200