因現場應用需要,需要對新配置的oracle RAC環境增配2個scanIP地址,10.138.129.106以及10.138.129.107。
配置前情況:
[grid@db1 ~]$ srvctl config scan ----查看scan的配置資訊
SCAN name: scan-ip, Network: 1/10.138.129.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /scan-ip/10.138.129.105
[grid@db1 ~]$ srvctl status scan ----查看scan的狀態以及scan ip所處節點
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node db1
[grid@db1 ~]$ srvctl config scan_listener ----查看scan listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
預設情況下配置RAC 只有1個scan IP,1個 scan listener。
進入主題,開始增配scan ip
1、修改rac所有節點的/etc/hosts資訊
[grid@db1 ~]$ cat /etc/hosts
127.0.0.1 localhost
10.138.129.101 db1
10.138.129.102 db2
10.138.129.103 db1-vip
10.138.129.104 db2-vip
10.138.129.105 scan-ip
10.138.129.106 scan-ip ---------新增的scanIP
10.138.129.107 scan-ip ---------新增的scanIP
192.168.20.1 db1-priv
192.168.20.2 db2-priv
2、停止scan 監聽,注意先聽監聽才能停scan
[grid@db1 ~]$ srvctl stop scan_listener
[grid@db1 ~]$ srvctl stop scan
[grid@db1 ~]$srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is not running
3、配置scan,注意需要用root許可權執行
[root@db1 bin]# pwd
/u01/app/11.2.0/grid/bin
[root@db1 bin]# ./srvctl modify scan -n scan-ip -----修改scan資訊,-n 後面接 hosts中的san ip 網路名稱
[root@db1 bin]# ./srvctl modify scan_listener -u ------添加scanIP的監聽,若不執行該命令,將只有一個listener_scan1監聽,執行後將根據scan ip數自動增加listener_scan2,listener_scan3.
4、啟動scan
[grid@db1 ~]$ srvctl start scan
[grid@db1 ~]$ srvctl start scan_listener
[grid@db1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node db1
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node db2
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node db1
[grid@db1 ~]$ srvctl config scan
SCAN name: scan-ip, Network: 1/10.138.129.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /scan-ip/10.138.129.105
SCAN VIP name: scan2, IP: /scan-ip/10.138.129.106
SCAN VIP name: scan3, IP: /scan-ip/10.138.129.107
[grid@db1 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node db1
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node db2
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node db1