网络信息如下:
[root@node1 ~]# ifconfig eth0 Link encap:Ethernet HWaddr 08:00:27:B2:D1:1B inet addr:192.168.100.20 Bcast:192.168.100.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:8697 errors:0 dropped:0 overruns:0 frame:0 TX packets:28955 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:788771 (770.2 KiB) TX bytes:35854996 (34.1 MiB) eth0:1 Link encap:Ethernet HWaddr 08:00:27:B2:D1:1B inet addr:192.168.100.98 Bcast:192.168.100.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 eth1 Link encap:Ethernet HWaddr 08:00:27:CB:6A:BB inet addr:10.1.1.1 Bcast:10.1.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:322721 errors:0 dropped:0 overruns:0 frame:0 TX packets:283490 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:198377998 (189.1 MiB) TX bytes:145057008 (138.3 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:110006 errors:0 dropped:0 overruns:0 frame:0 TX packets:110006 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:55092250 (52.5 MiB) TX bytes:55092250 (52.5 MiB) 3.9 修改 local_listener最后,还需要修改oracle的local_listener。
oracle 用户登录,只在一个节点操作即可:
注意:sql语句中的IP地址为新的VIP,如下:
ALTER SYSTEM SET LOCAL_LISTENER = '(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.100.98)(PORT = 1521))' scope=both SID = 'iesdb1';
[root@node1 ~]# su - oracle [oracle@node1 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.5.0 - Production on Fri Jun 16 18:31:50 2017 Copyright (c) 1982, 2010, Oracle. All Rights Reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real Application Clusters, OLAP, Data Mining and Real Application Testing options SQL> show parameter local_listener; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ local_listener string (ADDRESS = (PROTOCOL = TCP)(HO ST = 192.168.56.98)(PORT = 152 1)) SQL> ALTER SYSTEM SET LOCAL_LISTENER = '(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.98)(PORT = 1521))' scope=both SID = 'iesdb1'; System altered. SQL> ALTER SYSTEM SET LOCAL_LISTENER = '(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.99)(PORT = 1521))' scope=both SID = 'iesdb2'; System altered. SQL> show parameter local_listener; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ local_listener string (ADDRESS = (PROTOCOL = TCP)(HO ST = 192.168.100.98)(PORT = 15 21)) SQL> SQL> conn system/inspur@iesdb2 Connected. SQL> show parameter local_listener; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ local_listener string (ADDRESS = (PROTOCOL = TCP)(HO ST = 192.168.100.99)(PORT = 15 21)) SQL>至此,oracle rac的Public IP 和 VIP修改完毕。
4. 回退流程如果我们中间修改出错,导致集群无法启动等,可以利用OCR回退至初始状态。
首先在所有节点关闭crs