本次记录是针对生产场景的一次变更操作的记录,重点在操作的思路和顺序,力图思考严谨,操作谨慎。
前提是因该套环境的搭建时应客户的要求催促,在网络还未调整好的时候急于部署应用进行压力测试等,导致出现服务器后期有网络调整,先期并未将服务器的网卡实现bond,后又提出需要做多网卡bond。
为应对该问题,做了相关预备工作,并预备相关操作
eth0 --private 更换为bond0
eth1 --public 更换为bond1
1.1 查看当前系统上crs运行的状态
[root@raw1 bin]# pwd
/u01/app/oracle/product/crs/bin
[root@raw1 bin]# ./crs_stat -t
1.2 关闭数据库
[root@raw1 bin]# ./srvctl stop database -d raw
1.3 关闭asm实例
[root@raw1 bin]# ./srvctl stop asm -n raw1
[root@raw1 bin]# ./srvctl stop asm -n raw2
1.4 关闭其他应用程序
[root@raw1 bin]# ./srvctl stop nodeapps -n raw1
[root@raw1 bin]# ./srvctl stop nodeapps -n raw2
1.5 关闭crs后台进程, 在操作系统一级中止运行的crs后台进程, 必须在所有节点上运行.
[root@raw1 bin]# /etc/init.d/init.crs stop
[root@raw2 ~]# /etc/init.d/init.crs stop
二 修改操作系统的ip设置
修改IP设置之后,检查IP的设置情况
三. 启动crs, 设置oracle中ip地址相关的设置.
3.1 在两个节点启动crs, 并关闭随crs启动的应用程序
两个节点
[root@raw1 ~]# /etc/init.d/init.crs start
[root@raw2 ~]# /etc/init.d/init.crs start
由于oracle所有应用设置为自动启动, 所以在crs启动时会试图启动所有的服务,
但是在对oracle相关的ip地址进行设置时需要crs处于运行状态. 但是数据库,
asm和node application处于停止状态, 在一个节点执行以下命令:
[root@raw1 bin]# ./srvctl stop database -d raw
[root@raw1 bin]# ./srvctl stop asm -n raw1
[root@raw1 bin]# ./srvctl stop asm -n raw2
[root@raw1 bin]# ./srvctl stop nodeapps -n raw1
[root@raw1 bin]# ./srvctl stop nodeapps -n raw2
[root@raw1 bin]# ./crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.raw.db application OFFLINE OFFLINE
ora.raw.dmm.cs application OFFLINE OFFLINE
ora....aw2.srv application OFFLINE OFFLINE
ora....w1.inst application OFFLINE OFFLINE
ora....w2.inst application OFFLINE OFFLINE
ora....SM1.asm application OFFLINE OFFLINE
ora....W1.lsnr application OFFLINE OFFLINE
ora.raw1.gsd application OFFLINE OFFLINE
ora.raw1.ons application OFFLINE OFFLINE
ora.raw1.vip application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....W2.lsnr application OFFLINE OFFLINE
ora.raw2.gsd application OFFLINE OFFLINE
ora.raw2.ons application OFFLINE OFFLINE
ora.raw2.vip application OFFLINE OFFLINE
3.2 使用oifcfg修改网卡设置, oifconfig可以用来设置和查看网卡使用的方式.
-- 查看当前配置:
[root@raw1 bin]# ./oifcfg getif -global
eth0 10.85.10.0 global public
eth1 192.168.1.0 global cluster_interconnect
-- 删除当前配置
[root@raw1 bin]# ./oifcfg delif -global eth0
[root@raw1 bin]# ./oifcfg delif -global eth1
[root@raw1 bin]# ./oifcfg getif
-- 重新添加
[root@raw1 bin]# ./oifcfg setif -global eth0/10.85.10.0:public --此处更换为对应的bond
[root@raw1 bin]# ./oifcfg setif -global eth1/192.168.1.0:cluster_interconnect --此处更换为对应的bond
[root@raw1 bin]# ./oifcfg getif
eth0 10.85.10.0 global public
eth1 192.168.1.0 global cluster_interconnect
注意: 这里IP 地址最一个为0. 代表的是一个网段。 修改的时候要切记。 否在在启动OCR 时 会报错误
[root@racnode2 bin]# ./oifcfg iflist
3.3 修改VIP
[root@raw1 bin]# ./srvctl modify nodeapps -n raw1 -A 10.85.10.222/255.255.255.0/eth0
[root@raw1 bin]# ./srvctl modify nodeapps -n raw2 -A 10.85.10.223/255.255.255.0/eth0
3.4 设置listener.ora和tnsnames.ora, 检查这些文件中是否有指定原来ip的地方, 修改为更改后的ip地址。
3.5 启动node applications, asm, 数据库
[root@raw1 bin]# ./srvctl start nodeapps -n raw1
[root@raw1 bin]# ./srvctl start nodeapps -n raw2
[root@raw1 bin]# ./srvctl start asm -n raw1
[root@raw1 bin]# ./srvctl start asm -n raw2
[root@raw1 bin]# ./srvctl start instance -d raw -i raw1
[root@raw1 bin]# ./srvctl start instance -d raw -i raw2
3.6 确认IP, 修改完成。
[root@raw1 bin]# ifconfig
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/759027/viewspace-751715/
,如需转载,请注明出处,否则将追究法律责任。