ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Configuration of TAFand Load Balancing

Configuration of TAFand Load Balancing

原创 Linux操作系统 作者:1983tracy 时间:2011-08-15 16:52:48 0 删除 编辑
10g & 11g :Configuration of TAF(Transparent Application Failover) and Load Balancing [ID 453293.1]

  修改时间 18-JUL-2011     类型 HOWTO     状态 PUBLISHED  

In this Document
  
     
CONFIGURATION
     
     

     

  

 

Node2

Listener.ora

LISTENER_NODE2=    
(DESCRIPTION =   
 (ADDRESS_LIST =           
 (ADDRESS=(PROTOCOL=TCP)(HOST=node2.idc.oracle.com)(PORT=1521)(IP=FIRST))   
 (ADDRESS=(PROTOCOL=TCP)(HOST=node2-vip.idc.oracle.com)(PORT=1521)(IP=FIRST))   
 )   
)

Start the listener

$ lsnrctl start LISTENER_NODE2

Tnsnames.ora

NODE2_LOCAL=  
   (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip.idc.oracle.com)(PORT = 1521)) 

 

Note: Make sure this tns alias NODE2_LOCAL is resolvable on the server, this ensures PMON picksup the entry without problem.
The following command should succeed on node2
$ tnsping node2_local

Set the local_listener for node2

sql > alter system set LOCAL_LISTENER='node2_local' scope=both sid='sid2' ;  

Enable the server side Load balancing (if required)
You should make the the listeners aware of adjacent nodes load to do the server side load balance.
To make PMON to notify the load information to adjacent nodes,  you should set the REMOTE_LISTENER parameter.

Add the following tnsalias in both the nodes tnsnames.ora
Node1 & Node2 Tnsnames.ora

NODE_REMOTE =
(DESCRIPTION =  
 (ADDRESS_LIST =   
  (ADDRESS = (PROTOCOL = TCP)(HOST=node1-vip.idc.oracle.com)(PORT = 1521))   
  (ADDRESS = (PROTOCOL = TCP)(HOST=node2-vip.idc.oracle.com)(PORT = 1521))   
 )  

 

Note: Make sure this tns alias NODE_REMOTE is resolvable on all the servers, this ensures PMON picksup the entry without problem.
The following command should succeed on all the nodes
$ tnsping node_remote

Set the remote listeners to both the nodes

sql> alter system set REMOTE_LISTENER='node_remote' scope=both;

 

Client Side Load Balancing

Following is an example of TNS net service alias for client side load balancing

CLIENT_LOADBALANCE= 
 (DESCRIPTION = 
  (LOAD_BALANCE = yes) 
  (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip.idc.oracle.com)(PORT = 1521)) 
  (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip.idc.oracle.com)(PORT = 1521))  
  (CONNECT_DATA =  
   (SERVICE_NAME = service.idc.oracle.com)  
  ) 
 )

Connect Time Failover

Sample connect time failover TNS net service alias
address_list defaults the failover=on

CLIENT_FAILOVER= 
(DESCRIPTION =  
 (ADDRESS_LIST =  
  (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip.idc.oracle.com)(PORT = 1521)) 
  (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip.idc.oracle.com)(PORT = 1521))  
 ) 
 (CONNECT_DATA = 
   (SERVICE_NAME = service.idc.oracle.com) 
 ) 
)

Client Side Load Balance & Connect-time Failover Connect String

CLIENT_LOAD_FAILOVER=
(DESCRIPTION = 
 (ADDRESS_LIST = 
  (LOAD_BALANCE = yes) 
  (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip.idc.oracle.com)(PORT = 1521)) 
  (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip.idc.oracle.com)(PORT = 1521)) 
 ) 
 (CONNECT_DATA = 
  (SERVICE_NAME = service.idc.oracle.com) 
 ) 

 

TAF - Client Side Configuration

Failover Mode Type can be Either SESSION or SELECT.
Session failover will have just the session to failed over to the next available node.The select query will not be resumed.

You can refer the below document for various options on TAF
Oracle® Database Net Services Administrator's Guide
Chapter on Enabling Advanced Features of Oracle Net Services

Simple TAF can be configured on the client side tnsnames.ora with following entry

TAF=
(DESCRIPTION = 
 (ADDRESS_LIST =
  (LOAD_BALANCE = yes) 
  (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip.idc.oracle.com)(PORT = 1521)) 
  (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip.idc.oracle.com)(PORT = 1521)) 
 )
 (CONNECT_DATA = 
   (SERVICE_NAME = service.idc.oracle.com) 
   (failover_mode=(type=select)(method=basic)) 
    ) 
  ) 

TAF - Server Side Configuration

From Oracle 10.2 onwards, TAF can be configured with server side at the time of service creation also.
Refer Note 460982.1 How To Configure Server Side Transparent Application
Failover

Troubleshooting Load Balance

Incase of server side load balancing not happening properly, to start diagonisng the issue you may collect the below set of information:

a. Is session load balance turned on ? 
b. What is the connection distribution on nodes ?
c. Is all the nodes are equal power w.r.t CPU / Memory / Hardware ?
d. Is there any application connecting locally (BEQueath connection) and doing big operations on any one of the node?
e. Are all the nodes are configured with proper settings of local / remote listeners?
Refer NOTE 263599.1 Understanding and Troubleshooting Instance Load Balancing

Troubleshooting TAF

Incase of client connectivity failure the ideal start point to diagonise the issue is with Client Sqlnet tracing at support Level

To enable the client tracing  Refer
NOTE 395525.1How to Enable Oracle SQLNet Client , Server , Listener , Kerberos and External procedure Tracing from Net Manager

While creating an Service Request with Oracle Support for TAF , provide the following information to diagonise the problem:

a. Failed connection client sqlnet tracing

b. Execute and provide the output of following commands from both the nodes:
    $ sql > show parameter Listener 
    $ sql> show parameter service
    $ lsnrctl  services

c. Upload the tnsnames.ora & Listener logs (by default created with .log) from both nodes.

References

NOTE:226880.1 - Configuration of Load Balancing and Transparent Application Failover
NOTE:342419.1 - ORA-12520: Listeners Running on VIP Address in 10g or Newer RAC
NOTE:395525.1 - How to Enable Oracle SQLNet Client , Server , Listener , Kerberos and External procedure Tracing from Net Manager

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7900083/viewspace-704898/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2009-06-01

  • 博文量
    18
  • 访问量
    40092