Oracle 11G RAC 修改各种IP
1 修改scan-ip
1)查看scan ip的状态信息
[grid@rac1 ~]$ srvctl config scan SCAN name: rac-cluster-scan, Network: 1/192.168.10.0/255.255.255.0/eth0 SCAN VIP name: scan1, IP: /rac-cluster-scan/192.168.10.130
2)停止scan_listener,scan 应用
[grid@rac1 ~]$ srvctl stop scan_listener [grid@rac1 ~]$ srvctl stop scan
3)在所有节点中 /etc/hosts 文件中修改 scan 对应的ip
[root@rac1 ~] vi /etc/hosts [root@rac2 ~] vi /etc/hosts
4)使用root命令修改scan-ip,即修改为/etc/hosts里面scan-ip对应的ip
[root@rac1 ~]# cd /u01/app/11.2.0/grid/bin [root@rac1 bin]# ./srvctl modify scan -n scanip
注:-n后面跟的是/etc/hosts下scan的名称
5)以grid用户更改及启动资源
[grid@rac1 ~]$ srvctl modify scan_listener -u [grid@rac1 ~]$ srvctl start scan_listener
6)测试和查看
[grid@rac1 ~]$ ping 192.168.10.146 [grid@rac1 ~]$ srvctl config scan SCAN name: rac-cluster-scan, Network: 1/192.168.10.0/255.255.255.0/eth0 SCAN VIP name: scan1, IP: /rac-cluster-scan/192.168.10.146 [grid@rac1 ~]$ srvctl config scan_listener SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
2 修改Public Ip
1) 查看当前集群 Ip信息
[grid@rac1 ~]$ su root Password: [root@rac1 grid]# oifcfg getif eth1 10.10.10.0 global cluster_interconnect eth0 172.18.56.0 global public
2)所有结点修改物理ip
3) 利用oifcfg命令,进行删除,修改public ip
[grid@rac1 ~]$ oifcfg delif -global eth0/172.18.56.0 [grid@rac1 ~]$ oifcfg setif -global eth0/192.168.56.0:public [grid@rac1 ~]$ oifcfg getif eth1 10.10.10.0 global cluster_interconnect eth0 192.168.56.0 global public
4) OS修改/etc/hosts, ifcfg-eth0文件(On all node)
# vi /etc/hosts # PUBLIC 192.168.10.147 rac1 192.168.10.148 rac2
3 修改vip
1) 停止节点1的实例和vip资源
[grid@rac1 ~]$ srvctl stop instance -d orcl -n rac1 [grid@rac1 ~]$ srvctl stop vip -n rac1 -f
2) 查看原始vip资源配置
[grid@rac1 ~]$ srvctl config nodeapps -a VIP exists.:rac1 VIP exists.: /rac1vip/192.168.10.149/255.255.255.0/eth0 VIP exists.:rac2 VIP exists.: /rac2vip/192.168.10.150/255.255.255.0/eth0
3) 修改/etc/hosts文件中的 vip
#VIP 192.168.10.149 rac1vip 192.168.10.150 rac2vip
4) 使用root用户修改vip资源
[grid@rac1 ~]$ srvctl modify nodeapps -n rac1 -A 192.168.10.149/255.255.255.0/eth0 PRCN-2018 : Current user grid is not a privileged user [grid@rac1 ~]$ su root Password: [root@rac1 grid]# srvctl modify nodeapps -n rac1 -A 192.168.10.149/255.255.255.0/eth0
5) 启动服务
[grid@rac1 ~]$ srvctl start vip -n rac1 [grid@rac1 ~]$ srvctl start listener -n rac1 [grid@rac1 ~]$ srvctl start instance -d orcl -n rac1
6) 集群其他节点请重复以上1-5的动作
4 修改Private IP
1)备份
在对集群中所有节点操作之前,请先备份 profile.xml 配置文件。作为 grid 用户执行’:
[grid@rac1 ~]$ cd /u01/11.2.0/grid/gpnp/rac1/profiles/peer/ [grid@rac1 peer]$ cp -p profile.xml profile.xml.bak123
2) 确保集群中所有节点都已经启动并正常运行
3) 使用grid用户,获取以下信息,例如:
[grid@rac1 peer]$ oifcfg getif eth1 10.10.10.0 global cluster_interconnect eth0 192.168.10.0 global public123
4) 加入新的private ip
[grid@rac1 peer]$ oifcfg setif -global eth1/20.20.20.0:cluster_interconnect [grid@rac1 peer]$ oifcfg getif eth1 10.10.10.0 global cluster_interconnect eth0 192.168.10.0 global public eth1 20.20.20.0 global cluster_interconnect
5) 使用root用户关闭集群中所有节点并禁用集群(每个节点)
[grid@rac1 peer]$ su - root Password: [root@rac1 peer]# crsctl stop crs CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1' CRS-2673: Attempting to stop 'ora.crsd' on 'rac1' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1' CRS-2673: Attempting to stop 'ora.CRSDG.dg' on 'rac1' CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac1' CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' succeeded … CRS-4133: Oracle High Availability Services has been stopped. [root@rac1 peer]# crsctl disable crs CRS-4621: Oracle High Availability Services autostart is disabled.
6) 更改/etc/hosts,ifcfg-eth1文件(两个节点)
# vi /etc/hosts # PRIVATE 20.20.20.10 rac1priv 20.20.20.20 rac2priv 修改物理IP 确保能相互ping 通 [root@rac1 ~]# ping rac1priv [root@rac1 ~]# ping rac2priv
7) 使用root用户激活集群并重新启动集群中所有节点(每个节点)
[grid@rac1 ~]$ su root Password: [root@rac1 grid]# crsctl enable crs CRS-4622: Oracle High Availability Services autostart is enabled. [root@rac1 grid]# crsctl start crs CRS-4123: Oracle High Availability Services has been started.
8) 删除旧的private ip
[grid@rac2 ~]$ oifcfg delif -global eth1/10.10.10.0 [grid@rac2 ~]$ oifcfg getif eth0 192.168.10.0 global public eth1 20.20.20.0 global cluster_interconnect
近期评论