【摘要】
某客户因搬迁机房,需要修改数据库集群的双心跳IP。当前环境为两块网卡,需要同时修改两块网卡为其他网段IP;心跳IP主要用于多个节点之间内存数据共享,互相检测各节点是否在线,一般要求与公共网络IP处于不同网段,带宽达到千兆。
【正文】
文中出现的主机名和IP都来自测试环境。
操作系统版本:red hat 7.4
数据库版本:11.2.0.4
主机名 | 原心跳IP | 新心跳IP |
racnode2 | 192.168.2.154 192.168.2.165 | 192.168.1.154 192.168.1.165 |
racnode4 | 192.168.2.163 192.168.2.164 | 192.168.1.163 192.168.1.164 |
准备过程:
- Root用户备份OCR
./ocrdump /tmp/ocr.bak
- Root用户备份gpnp profile.xml
节点一
cd /u01/app/11.2.0/grid/gpnp/racnode2/profiles/peer
cp profile.xml profile.xml.bak
节点二
cd /u01/app/11.2.0/grid/gpnp/racnode4/profiles/peer
cp profile.xml profile.xml.bak
- 备份数据库
- Grid用户备份asm spfile
Sqlplus / as sysasm
Create pfile=’/tmp/pfile.ora’ from spfile;
- 查看数据库实例及asm实例的cluster_interconnect,若有指定值,及时清空。
Show parameter cluster_interconnect
修改过程
一、修改ens38网卡IP地址
- Root用户查看当前心跳IP配置
./oifcfg getif
- 删除ens38信息
./oifcfg delif -global ens38/192.168.2.0
- Down掉ens38网卡(双节点)
Ifconfig ens38 down
- 加入新的心跳网卡信息
./oifcfg setif -global ens38/192.168.1.0:cluster_interconnect
- 修改两节点ens38网卡配置文件
- Root用户停止集群软件
./crsctl stop cluster –all
- 启动两节点ens38网卡
ifconfig ens38 up
service network restart
- 修改hosts文件
vi /etc/hosts
- 启动集群软件
./crsctl start cluster -all
二、修改ens39网卡IP地址
- Root用户查看当前心跳IP配置
./oifcfg getif
- 删除ens39信息
./oifcfg delif -global ens39/192.168.2.0
- Down掉ens39网卡(双节点)
ifconfig ens39 down
- 加入新的心跳网卡信息
./oifcfg setif -global ens39/192.168.1.0:cluster_interconnect
- 修改两节点ens39网卡配置文件
- Root用户停止集群软件
./crsctl stop cluster –all
- 启动两节点ens39网卡
ifconfig ens39 up
service network restart
- 修改hosts文件
vi /etc/hosts
- 启动集群软件
./crsctl start cluster -all
【结论】
修改前的准备工作一定要完整准确,避免小的失误导致大的故障。