Home >Database >Mysql Tutorial >11Gr2 RAC 修改scan IP
11Gr2环境需要更改scan ip, 基本的原理就是更改DNS或者hosts文件内的IP地址,然后通过srvctl 命令去同步CRS内的信息,完成scan ip的修改。 Before, need modify all the node /etc/hosts, set the new ip address. 1. Stop the SCAN listener and the SCAN V
11Gr2环境需要更改scan ip, 基本的原理就是更改DNS或者hosts文件内的IP地址,然后通过srvctl 命令去同步CRS内的信息,完成scan ip的修改。
Before, need modify all the node /etc/hosts, set the new ip address.
1.
Stop the SCAN listener and the SCAN VIP resources:
2.需要先停止服务,测试时候由于没有停止服务,最后出现scan listener没有启动,后手动启动,同时parameter remote_listener值丢失,重新设置的。
# $GRID_HOME/bin/srvctl stop scan_listener
# $GRID_HOME/bin/srvctl stop scan
# $GRID_HOME/bin/srvctl status scan
<ol> <li><span><span>SCAN VIP scan1 is enabled </span></span></li> <li><span>SCAN VIP scan1 is not running </span></li> </ol>
# $GRID_HOME/bin/srvctl status scan_listener
<ol> <li><span><span>SCAN Listener LISTENER_SCAN1 is enabled </span></span></li> <li> <span>SCAN listener LISTENER_SCAN1 is not running </span><span> </span> </li> </ol>
3.
# To check the current IP address(es) of the SCAN VIPs, run the following commands as the root user:
$GRID_HOME/bin/srvctl config scan
<ol> <li><span><span>SCAN name: qr01-scan, Network: 1/192.0.2.0/255.255.255.0/eth0 </span></span></li> <li><span>SCAN VIP name: scan1, IP: /qr01-scan.example.com/192.0.2.21 </span></li> </ol>
4.
# Next refresh the SCAN VIPs with the new IP addresses from the DNS entry:
$GRID_HOME/bin/srvctl modify scan -n
5.
# To check if the SCAN VIPs have been changed, run the following command, it should now show the new IP addresses.
$GRID_HOME/bin/srvctl config scan
<ol> <li><span><span>SCAN name: qr01-scan, Network: 1/192.0.2.0/255.255.255.0/eth0 </span></span></li> <li><span>SCAN VIP name: scan1, IP: /qr01-scan.example.com/192.0.2.31 </span></li> </ol>
6.
Start SCAN and the SCAN listener:
# $GRID_HOME/bin/srvctl start scan
# $GRID_HOME/bin/srvctl start scan_listener
7.
check parameter
SQL> show parameter remote
<ol> <li><span><span>NAME TYPE VALUE </span></span></li> <li><span>------------------------------------ ----------- ------------------------------ </span></li> <li><span>remote_listener string qr01-scan:1521 </span></li> </ol>
8.
check listener status
$ps -ef|grep tns
<ol> <li><span><span>oracle 4992 1 0 16:12 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER_SCAN1 -inherit </span></span></li> <li><span>oracle 5004 1 0 16:12 ? 00:00:00 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit </span></li> <li><span>oracle 9816 5529 0 17:45 pts/0 00:00:00 grep tns </span></li> </ol>
需要到grid用户下执行下面命令
$lsnrctl status LISTENER_SCAN1
<ol> <li><span><span>LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 07-MAY-2012 17:46:25 </span></span></li> <li><span> </span></li> <li><span>Copyright (c) 1991, 2010, Oracle. All rights reserved. </span></li> <li><span> </span></li> <li><span>Connecting to (<span>DESCRIPTION</span><span>=(</span><span>ADDRESS</span><span>=(</span><span>PROTOCOL</span><span>=</span><span>IPC</span><span>)(</span><span>KEY</span><span>=</span><span>LISTENER_SCAN1</span><span>))) </span></span></li> <li><span>STATUS of the LISTENER </span></li> <li><span>------------------------ </span></li> <li><span>Alias LISTENER_SCAN1 </span></li> <li><span>Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production </span></li> <li><span>Start Date 07-MAY-2012 12:12:11 </span></li> <li><span>Uptime 0 days 1 hr. 34 min. 14 sec </span></li> <li><span>Trace Level off </span></li> <li><span>Security ON: Local OS Authentication </span></li> <li><span>SNMP OFF </span></li> <li><span>Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora </span></li> <li><span>Listener Log File /u01/app/11.2.0/grid/log/diag/tnslsnr/qr01db02/listener_scan1/alert/log.xml </span></li> <li><span>Listening Endpoints Summary... </span></li> <li><span> (<span>DESCRIPTION</span><span>=(</span><span>ADDRESS</span><span>=(</span><span>PROTOCOL</span><span>=</span><span>ipc</span><span>)(</span><span>KEY</span><span>=</span><span>LISTENER_SCAN1</span><span>))) </span></span></li> <li><span> (<span>DESCRIPTION</span><span>=(</span><span>ADDRESS</span><span>=(</span><span>PROTOCOL</span><span>=</span><span>tcp</span><span>)(</span><span>HOST</span><span>=</span><span>192</span><span>.0.2.31)(</span><span>PORT</span><span>=</span><span>1521</span><span>))) </span></span></li> <li><span>Services Summary... </span></li> <li><span>Service "dbm.example.com" has 2 instance(s). </span></li> <li><span> Instance "dbm1", status READY, has 1 handler(s) for this service... </span></li> <li><span> Instance "dbm2", status READY, has 1 handler(s) for this service... </span></li> <li><span>Service "dbmXDB.example.com" has 2 instance(s). </span></li> <li><span> Instance "dbm1", status READY, has 1 handler(s) for this service... </span></li> <li><span> Instance "dbm2", status READY, has 1 handler(s) for this service... </span></li> <li><span>The command completed successfully </span></li> </ol>