Oracle 11.2.0.4 RAC修改VIP(虛擬IP)
阿新 • • 發佈:2019-01-06
本實驗是在Redhat 6.5 && Oracle 11.2.0.4 RAC 環境下做的,生產中有時會需要修改RAC的VIP(虛擬IP),往往
一些Oracle 學習愛好者或者相關管理人員在進行修改時遇到各類問題,這裡我將自己的實驗過程展示出來,希望能給
更多的Oracle 學習愛好者一些幫助。
本次實驗是要將節點2的VIP(虛擬IP):192.168.80.13 修改成:192.168.80.16
具體操作步驟如下:
以root使用者執行
[root@vastdata2 ~]# cd /u01/app/11.2.0/grid/bin/
[root@vastdata2 bin]# ./srvctl config vip -n vastdata2
VIP exists: /vastdata2-vip/192.168.80.13/192.168.80.0/255.255.255.0/eth0, hosting node vastdata2
- 1
- 2
- 3
- 4
- 1
- 2
- 3
- 4
檢視VIP狀態
[[email protected] bin]# ./srvctl status vip -n vastdata2
VIP vastdata2-vip is enabled
VIP vastdata2-vip is running on node: vastdata2
- 1
- 2
- 3
- 1
- 2
- 3
檢視監聽狀態
[[email protected] bin]# ./srvctl status listener -n vastdata2
Listener LISTENER is enabled on node(s): vastdata2
Listener LISTENER is running on node(s): vastdata2
- 1
- 2
- 3
- 1
- 2
- 3
停止監聽
[root@vastdata2 bin]# ./srvctl stop listener -n vastdata2
- 1
- 1
檢視停掉監聽後的狀態
[[email protected] bin]# ./srvctl status listener -n vastdata2
Listener LISTENER is enabled on node(s): vastdata2
Listener LISTENER is not running on node(s): vastdata2
- 1
- 2
- 3
- 1
- 2
- 3
停止VIP
[root@vastdata2 bin]# ./srvctl stop vip -n vastdata2
- 1
- 1
檢視停止VIP後的狀態
[root@vastdata2 bin]# ./srvctl status vip -n vastdata2
VIP vastdata2-vip is enabled
VIP vastdata2-vip is not running
- 1
- 2
- 3
- 1
- 2
- 3
修改hosts檔案
[[email protected] bin]# vi /etc/hosts
192.168.80.2 vastdata1.us.oracle.com vastdata1
192.168.80.12 vastdata1-vip.us.oracle.com vastdata1-vip
10.0.0.2 vastdata1-priv1.us.oracle.com vastdata1-priv1
192.168.80.3 vastdata2.us.oracle.com vastdata2
192.168.80.16 vastdata2-vip.us.oracle.com vastdata2-vip
10.0.0.3 vastdata2-priv1.us.oracle.com vastdata2-priv1
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
修改VIP地址–該命令給出了新的VIP地址“192.168.80.16”、網路掩碼“255.255.255.0”和VIP使用的網絡卡“eth0”。
[root@vastdata2 bin]# ./srvctl modify nodeapps -n vastdata2 -A 192.168.80.16/255.255.255.0/eth0
- 1
- 1
開啟監聽
[root@vastdata2 bin]# ./srvctl start listener -n vastdata2
- 1
- 1
檢視開啟監聽後的狀態
[[email protected] bin]# ./srvctl status listener -n vastdata2
Listener LISTENER is enabled on node(s): vastdata2
Listener LISTENER is running on node(s): vastdata2
- 1
- 2
- 3
- 1
- 2
- 3
驗證
[root@vastdata2 bin]# ./srvctl config vip -n vastdata2
VIP exists: /vastdata2-vip/192.168.80.16/192.168.80.0/255.255.255.0/eth0, hosting node vastdata2
- 1
- 2
- 1
- 2
獲取當前VIP資訊
[root@vastdata2 bin]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 08:00:27:18:E6:C8
inet addr:192.168.80.3 Bcast:192.168.80.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe18:e6c8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:13045 errors:0 dropped:0 overruns:0 frame:0
TX packets:10104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1411664 (1.3 MiB) TX bytes:1413666 (1.3 MiB)
eth0:1 Link encap:Ethernet HWaddr 08:00:27:18:E6:C8
inet addr:192.168.80.16 Bcast:192.168.80.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:2 Link encap:Ethernet HWaddr 08:00:27:18:E6:C8
inet addr:192.168.80.22 Bcast:192.168.80.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth1 Link encap:Ethernet HWaddr 08:00:27:D8:FA:69
inet addr:10.0.0.3 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::a00:27ff:fed8:fa69/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:593752 errors:0 dropped:0 overruns:0 frame:0
TX packets:701220 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:336092144 (320.5 MiB) TX bytes:507839384 (484.3 MiB)
eth1:1 Link encap:Ethernet HWaddr 08:00:27:D8:FA:69
inet addr:169.254.24.28 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:126962 errors:0 dropped:0 overruns:0 frame:0
TX packets:126962 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:66228834 (63.1 MiB) TX bytes:66228834 (63.1 MiB)
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39