How to Setup SCAN Listener and Client for TAF and Load Balancing
Verify SCAN Listener Configuration on Server
After grid installation is completed you can verify the SCAN Listener configuration on your server -
•At the $GRID_HOME/network/admin directory you will have two listener related files.
-rw-r--r-- 1 grid oinstall 887 Jul 13 09:33 listener.ora
-rw-r--r-- 1 grid oinstall 375 Jul 13 09:33 endpoints_listener.ora
example of listener.ora
LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))) # line added by Agent
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))) # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN2=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by Agent
example of endpoints_listener.ora
LISTENER_DBGRAC1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myrac1-vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=10.17
7.60.87)(PORT=1521)(IP=FIRST)))) # line added by Agent
Check Status of SCAN IPs and SCAN Listener
srvctl command can be used to check the status of SCAN IPs and SCAN listener -
[grid@myrac1 admin]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node myrac2
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node myrac1
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node myrac1
Note that two SCAN IPs are online on node myrac1 and one is online on myrac2.
Respective SCAN listeners will be online on the nodes where the corresponding SCAN IP is online.
[grid@myrac1 admin]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node myrac2
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node myrac1
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node myrac1
You can verify the instance registration with SCAN listeners using lsnrctl command -
[grid@myrac1 admin] $ lsnrctl status listener_scan2
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 28-AUG-2010 12:53:56
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN2
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 23-AUG-2010 10:15:16
Uptime 5 days 2 hr. 38 min. 40 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/11.2.0/grid/log/diag/tnslsnr/myrac1/listener_scan2/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=111.222.333.90)(PORT=1521)))
Services Summary...
Service "myrac" has 2 instance(s).
Instance "myrac1", status READY, has 2 handler(s) for this service...
Instance "myrac2", status READY, has 2 handler(s) for this service...
Service "myracXDB" has 2 instance(s).
Instance "myrac1", status READY, has 1 handler(s) for this service...
Instance "myrac2", status READY, has 1 handler(s) for this service...
The command completed successfully
Note that above output shows that the listener "listener_scan2" is running on myrac1 and both the instances are registered with this listener. Each instance within the cluster registers itself with all the SCAN listener using remote_listener setting. For e.g
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) HOST=myrac1-vip)(PORT=1521))))
remote_listener string myrac-cluster-scan:1521
The local_listener will always point to the local VIP for the node while the remote_listener will point to
You can use srvctl command to change or edit the SCAN listener settings. Refer Note 972500.1 : How to Modify SCAN Setting after Installation.
Configure Client to Connect Using SCAN
To configure client to connect using SCAN, configure the tnsnames.ora. For
e.g -
MYRAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = myrac-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = myrac)
)
)
Configure Clients for Transparent Application Failover (TAF) Using SCAN
The above tns entry will connect to cluster using SCAN name "myrac-cluster-scan" to service "myrac" and assumes that the service is configured for server side TAF. The default Service created at the time of installation and creation of RAC database is not TAF enabled. You can create a TAF enabled service using srvctl command. Refer Note 460982.1: How To Configure Server Side Transparent Application Failover
If you wish to use client side TAF setting for clients connecting using SCAN name, you can configure tnsnames.ora entry at the client side as -
MYRAC_TAF =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = myrac-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = myrac)
(FAILOVER_MODE=
(TYPE=select)
(METHOD=basic))))
You can verify the client connections to 11gR2 database for TAF using -
SQL> SELECT MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER, COUNT(*)
FROM V$SESSION
GROUP BY MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER;
MACHINE AILOVER_TYPE FAILOVER_M FAI COUNT(*)
--------- ------------- --------- ----- ---
mymachine SELECT BASIC NO 1
Older supported client versions which are using VIP Address TAF enabled connect string can continue use VIP to connect to 11gR2 RAC setup.
Client Side Load Balancing
For 11.2 clients connecting to 11.2 RAC database via SCAN, the client side load balancing happens during the connection phase when the SCAN name gets resolved. Client side sqlnet trace can be used to verify this. For e.g
(3086231232) [28-AUG-2010 14:13:06:118] nlad_expand_hst: Expanding myrac-cluster-scan
(3086231232) [28-AUG-2010 14:13:06:118] snlinGetAddrInfo: entry
(3086231232) [28-AUG-2010 14:13:11:119] snlinGetAddrInfo: exit
(3086231232) [28-AUG-2010 14:13:11:119] snlinGetNameInfo: entry
(3086231232) [28-AUG-2010 14:13:11:119] snlinGetNameInfo: exit
(3086231232) [28-AUG-2010 14:13:11:119] nlad_expand_hst: Adding IP 111.222.333.90
(3086231232) [28-AUG-2010 14:13:11:119] snlinGetNameInfo: entry
(3086231232) [28-AUG-2010 14:13:11:119] snlinGetNameInfo: exit
(3086231232) [28-AUG-2010 14:13:11:119] nlad_expand_hst: Adding IP 111.222.333.191
(3086231232) [28-AUG-2010 14:13:11:119] snlinGetNameInfo: entry
(3086231232) [28-AUG-2010 14:13:11:119] snlinGetNameInfo: exit
(3086231232) [28-AUG-2010 14:13:11:119] nlad_expand_hst: Adding IP 111.222.333.193
(3086231232) [28-AUG-2010 14:13:11:119] snlinFreeAddrInfo: entry
Note that the name myrac-cluster-scan was resolved to three different IPs, client will randomly pick any of the IP for the connection to achieve client side load balancing.
A pre-11g Release 2 client (Oracle Database 11g Release 1 or Oracle Database 10g Release 2, or older) will not fully benefit from the advantages of SCAN. The older version Oracle Client will not be able to handle a set of three IPs returned by the DNS for SCAN. Hence, it will try to connect to only the first address returned in the list and will more or less ignore the others. If the SCAN Listener listening on this specific IP is not available or the IP itself is not available, the connection will fail.
To workaround this problem -
•If you are using static SCAN IPs, include the address of all SCAN IPs in the tnsnames.ora entry.
TEST =
(DESCRIPTION =
(ADDRESS_LIST =
(LOAD_BALANCE=ON)
(FAILOVER=ON)
(ADDRESS = (PROTOCOL = TCP)(HOST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
(ADDRESS = (PROTOCOL = TCP)(HOST =
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = myrac)
(FAILOVER_MODE=
(TYPE=select)
(METHOD=basic))))
•If you are using GNS (dynamic SCAN IPs), use VIP listener for the connections.
However in this case the remote_listener parameter on each node should be set accordingly so that all instance cross registers with each VIP listener within the cluster.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/1933/viewspace-1052018/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- How to Configure TAF and Client Load Balancing in a Replicated Environment [ID 210596.1]client
- oracle10g rac(rhel4)_load balancing_taf(一)Oracle
- oracle10g rac(rhel4)_load balancing_taf(二)Oracle
- oracle10g rac(rhel4)_load balancing_taf(三)Oracle
- oracle10g rac(rhel4)_load balancing_taf(四)Oracle
- gRPC Load BalancingRPC
- HTTP Server load balancing secretsHTTPServer
- [RIP-9]RocketMQ Load BalancingMQ
- LOAD_BALANCE&TAF總結
- Oracle LOAD_BALANCE&TAF總結Oracle
- TNSNAMES TAF TEMPLATE , LOCAL_LISTENER RAC FAILOVERAI
- rac 的Client-side TAF配置clientIDE
- How to update SCAN VIP (ora.scan.vip) [ID 952903.1]
- 我對Load Balancing Advisory的理解
- Failover 之 Client-Side Connect time Failover、Client-Side TAF、Service-Side TAFAIclientIDE
- oracle 11gr2 SCAN LISTENER配置Oracle
- listener_scan1.log、listener.log監聽日誌清理
- akka-typed(6) - cluster:group router, cluster-load-balancing
- Configuration of Load Balancing and Transparent Application FailoverAPPAI
- oracle-rac--srvctl add scan_listenerOracle
- How to update the IP address of the SCAN VIP
- rac scan listener log 清理監聽日誌 oracleOracle
- Oracle Appliactions 11i concepts(十) - Load Balancing(1)OracleAPP
- How to Run and View a Listener Trace. [ID 147446.1]View
- Oracle 11g RAC 叢集 SCAN IP Listener說明Oracle
- How To modify listener port in oracle 11g GridOracle
- Attempt to load oracle client libraries threw BadImageFormatExceptionOracleclientORMException
- How to Troubleshoot Connectivity Issue with 11gR2 SCAN Name
- Connecting to ASM through the TNS Listener from a Client DesktopASMclient
- 安裝11grac資料庫:Scan Listener is not configured資料庫
- REMOTE_LISTENER對LOAD_BALANCE的影響(二)REM
- REMOTE_LISTENER對LOAD_BALANCE的影響(一)REM
- 導致 Scan VIP 和 Scan Listener(監聽程式)出現故障的最常見的 5 個問題
- Bug 6083037 - Server side load balancing does not work [ID 6083037.8]ServerIDE
- How to Configure the DNS Server for 11gR2 SCAN On LinuxDNSServerLinux
- How to load multiple Spring bean configuration fileSpringBean
- How to Troubleshoot Connectivity Issue with 11gR2 SCAN Name (Doc ID 975457.1)
- TNS-12518: TNS:listener could not hand off client connectionclient