10g & 11g Configuration of TAF(Transparent Application Failover) and Load Balancing [ID 453293.1]
2010-12-19 19:34
645 查看
10g&11g:ConfigurationofTAF(TransparentApplicationFailover)andLoadBalancing[ID453293.1] | ||
Modified28-SEP-2010TypeHOWTOStatusPUBLISHED |
Appliesto:
OracleNetServices-Version:10.1.0.2.0to11.1.0.7.0-Release:10.1to11.1OracleNetServices-Version:10.1.0.2.0to11.1.0.7.0[Release:10.1to11.1]
Informationinthisdocumentappliestoanyplatform.
Goal
Thisnoteexplainstheconfigurationin10g&11gfor:1)ClientSideConnectTimeLoadBalance
2)ClientSideConnectTimeFailover
3)ServerSideListenerConnectionLoadBalance
4)TransparentApplicationFailover(TAF)
Solution
CONCEPTS
(1)ClientSideConnect-TimeLoadBalanceTheclientloadbalancingfeatureenablesclientstorandomizeconnectionrequestsamongthelisteners.
TnsnamesParameter:LOAD_BALANCE
The(load_balance=yes)instructsSQLNettoprogressthroughthelistoflisteneraddressesinarandomsequence,balancingtheloadonthevariouslisteners.WhensettoOFF,instructsSQLNettotrytheaddressessequentiallyuntilonesucceeds.
LoadbalancingcanbespecifiedforanADDRESS_LISTorassociatedwithasetofADDRESSesorsetDESCRIPTIONs.
Thisparametermustbecorrectlycodedinyournetservicename(connectdescriptor).
Bydefault,thisparameterissettoONforDESCRIPTION_LISTs.
IfyouuseADDRESS_LIST,(load_balance=yes)shouldbewithinthe(ADDRESS_LIST=)portion.IfyoudonotuseADDRESS_LIST,(load_balance=yes)shouldbewithinthe(description=)portion.
(2)ClientSideConnect-Timefailover
Theconnect-timefailoverenablesclientstoconnecttoanotherlisteneriftheinitialconnectiontothefirstlistenerfails.Thenumberoflistenerprotocoladdressesdetermineshowmanylistenersaretried.Without
connect-timefailover,OracleNetattemptsaconnectionwithonlyonelistener.Thedefaultison.
TnsnamesParameter:FAILOVER
(failover=on)isdefaultforADDRESS_LISTs,DESCRIPTION_LISTs,andasetof
DESCRIPTIONs.,therefore,youdonothavetospecifyitexplicitly.
(3)ServerSideListenerConnectionLoadBalance
Thelistenerconnectionloadbalancingfeatureimprovesconnectionperformancebybalancingthenumberofactiveconnectionsamongmultipledispatchersandinstances.Inasingle-instanceenvironment,thelistenerselectstheleastloadeddispatchertohandletheincomingclientrequests.InanOracleRealApplicationClusters(RAC)environment,connectionloadbalancingalsohasthecapabilitytobalancethenumberofactiveconnectionsamongmultipleinstances.
1.Least-loadednode
2.Least-loadedinstance
3.Least-loadeddispatcherforthatinstance(incaseofSharedserverconfiguration)
Therearetwotypesofserver-sideloadbalancing:
LoadBased—Serversideloadbalancingredirectsconnectionsbydefaultdependingonnodeload.From10.2onwardsyoucanworkthiswithLoadbalancingadvisory(LBA).ThiswillnotbeeffectiveforloginstormsastheconnectionsarealreadyinthelistenerafterwhichPMONupdateontheloadcomestothelistener.
SessionBased—Sessionbasedloadbalancingtakesintoaccountthenumberofsessionsconnectedtoeachnodeandthendistributestheconnectionstobalancethenumberofsessionsacrossthedifferentnodes.
Sessioncountbalancingisusedwhenyousetalistenerparameter,PREFER_LEAST_LOADED_NODE_<listener_name>=OFF(<listener_name>istheactualnameofthelistenerwhichisdifferentoneachnodeinyourclusterandbydefaultisconstructedas"listener_<nodename>").Pleasebeawarethatconnectionsbursts(largenumberofconnectionsinitiatedveryquicklyoneafteranother)maynotbeproperlybalancedduetostatisticsupdatelatency.
(4)TransparentApplicationFailover(TAF)
TransparentApplicationFailover(TAF)isafeatureoftheOracleCallInterface(OCI)driveratclientside.Itenablestheapplicationtoautomaticallyreconnecttoadatabase,ifthedatabaseinstancetowhichtheconnectionismadefails.Inthiscase,theactivetransactionsrollback.
TnsnamesParameter:FAILOVER_MODE
Whenaninstancetowhichaconnectionisestablishedfailsorisshutdown,theconnectionontheclientsidebecomesstaleandwouldthrowexceptionstothecallertryingtouseit.TAFenablestheapplicationtotransparentlyreconnecttoapreconfiguredsecondaryinstancecreatingafreshconnection,butidenticaltotheconnectionthatwasestablishedonthefirstoriginalinstance.
CONFIGURATION
Wewilltakea2nodesetupforthisentireconfigurationexampleNode1:
Hostname:node1.idc.oracle.com
VIPHostname:node1-vip.idc.oracle.com
DatabaseService_names:service.idc.oracle.com
SID:sid1
Node2:
Hostname:node2.idc.oracle.com
VIPHostname:node2-vip.idc.oracle.com
DatabaseService_names:service.idc.oracle.com
SID:sid2
Note:Ensurethatthenode1-vip.idc.oracle.comandnode2-vip.idc.oracle.comisresolvable&reachablefromclients.IfneededYoumayreplacethehostnameswithIPaddressintheentireconfigurationfiles.
Node1
Listener.ora
LISTENER_NODE1=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=node1-vip.idc.oracle.com)(PORT=1521)(IP=FIRST))
(ADDRESS=(PROTOCOL=TCP)(HOST=node1.idc.oracle.com)(PORT=1521)(IP=FIRST))
)
)
Startthelistener
$lsnrctlstartLISTENER_NODE1
Tnsnames.ora
NODE1_LOCAL=
(ADDRESS=(PROTOCOL=TCP)(HOST=node1-vip.idc.oracle.com)(PORT=1521))
Note:MakesurethistnsaliasNODE1_LOCALisresolvableontheserver,thisensuresPMONpicksuptheentrywithoutproblem.
Thefollowingcommandshouldsucceedonnode1
$tnspingnode1_local
Setthelocal_listenerfornode1
sql>altersystemsetLOCAL_LISTENER='node1_local'scope=bothsid='sid1';
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))
)
)
Startthelistener
$lsnrctlstartLISTENER_NODE2
Tnsnames.ora
NODE2_LOCAL=
(ADDRESS=(PROTOCOL=TCP)(HOST=node2-vip.idc.oracle.com)(PORT=1521))
Note:MakesurethistnsaliasNODE2_LOCALisresolvableontheserver,thisensuresPMONpicksuptheentrywithoutproblem.
Thefollowingcommandshouldsucceedonnode2
$tnspingnode2_local
Setthelocal_listenerfornode2
sql>altersystemsetLOCAL_LISTENER='node2_local'scope=bothsid='sid2';
EnabletheserversideLoadbalancing(ifrequired)
Youshouldmakethethelistenersawareofadjacentnodesloadtodotheserversideloadbalance.
TomakePMONtonotifytheloadinformationtoadjacentnodes,youshouldsettheREMOTE_LISTENERparameter.
Addthefollowingtnsaliasinboththenodestnsnames.ora
Node1&Node2Tnsnames.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:MakesurethistnsaliasNODE_REMOTEisresolvableonalltheservers,thisensuresPMONpicksuptheentrywithoutproblem.
Thefollowingcommandshouldsucceedonallthenodes
$tnspingnode_remote
Settheremotelistenerstoboththenodes
sql>altersystemsetREMOTE_LISTENER='node_remote'scope=both;
ClientSideLoadBalancing
FollowingisanexampleofTNSnetservicealiasforclientsideloadbalancingCLIENT_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)
)
)
ConnectTimeFailover
SampleconnecttimefailoverTNSnetservicealiasaddress_listdefaultsthefailover=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)
)
)
ClientSideLoadBalance&Connect-timeFailoverConnectString
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-ClientSideConfiguration
FailoverModeTypecanbeEitherSESSIONorSELECT.Sessionfailoverwillhavejustthesessiontofailedovertothenextavailablenode.Theselectquerywillnotberesumed.
YoucanreferthebelowdocumentforvariousoptionsonTAF
Oracle®DatabaseNetServicesAdministrator'sGuide
ChapteronEnablingAdvancedFeaturesofOracleNetServices
SimpleTAFcanbeconfiguredontheclientsidetnsnames.orawithfollowingentry
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-ServerSideConfiguration
TAFcanbeconfiguredwithserversideatthetimeofservicecreationalso.Refer
Failover
TroubleshootingLoadBalance
Incaseofserversideloadbalancingnothappeningproperly,tostartdiagonisngtheissueyoumaycollectthebelowsetofinformation:
a.Issessionloadbalanceturnedon?
b.Whatistheconnectiondistributiononnodes?
c.Isallthenodesareequalpowerw.r.tCPU/Memory/Hardware?
d.Isthereanyapplicationconnectinglocally(BEQueathconnection)anddoingbigoperationsonanyoneofthenode?
e.Areallthenodesareconfiguredwithpropersettingsoflocal/remotelisteners?
Refer
TroubleshootingTAF
IncaseofclientconnectivityfailuretheidealstartpointtodiagonisetheissueiswithClientSqlnettracingatsupportLevelToenabletheclienttracingRefer
WhilecreatinganServiceRequestwithOracleSupportforTAF,providethefollowinginformationtodiagonisetheproblem:
a.Failedconnectionclientsqlnettracing
b.Executeandprovidetheoutputoffollowingcommandsfromboththenodes:
$sql>showparameterListener
$sql>showparameterservice
$lsnrctlservices<listener_name>
c.Uploadthetnsnames.ora&Listenerlogs(bydefaultcreatedwith<listener_name>.log)frombothnodes.
References
Related Products OracleDatabaseProducts>OracleDatabase>NetServices>OracleNetServices OracleDatabaseProducts>OracleDatabase>NetServices>OracleNetServices OracleDatabaseProducts>OracleDatabase>NetServices>OracleNetServices Keywords
|
Blog:
网上资源:
相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
DBA1群:62697716(满);DBA2群:62697977(满)
DBA3群:62697850DBA超级群:63306533;
聊天群:40132017
--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请
相关文章推荐
- 10g & 11g Configuration of TAF(Transparent Application Failover) and Load Balancing [ID 453293.1]
- 10g & 11g Configuration of TAF(Transparent Application Failover) and Load Balancing [ID 453293.1]
- 10g & 11g Configuration of TAF(Transparent Application Failover) and Load Balancing [ID 453293.1]
- 10g & 11g :Configuration of TAF(Transparent Application Failover) and Load Balancing (文档 ID 453293.1
- 10g & 11g Configuration of TAF(Transparent Application Failover) and Load Balancing [ID 453293.1]
- 10g & 11g Configuration of TAF(Transparent Application Failover) and Load Balancing
- All about TAF - 10g&11g :Configuration of TAF(Transparent Application Failover) and Load Balancing
- 10g & 11g :Configuration of TAFand Load Balancing (文档 ID 453293.1)
- 在Oracle 11g Data Guard中实现Connect Time Failover & Transparent Application Failover(TAF)
- All about TAF - How To Configure Server Side Transparent Application Failover [ID 460982.1]
- Placement of Voting disk and OCR Files in Oracle RAC 10g and 11gR1 [ID 293819.1]
- How To Configure Server Side Transparent Application Failover [ID 460982.1]
- Transparent Application Failover (TAF)
- Ora10g How To Configure Server Side Transparent Application Failover [ID 460982.1]
- Placement of Voting disk and OCR Files in Oracle RAC 10g and 11gR1 [ID 293819.1]
- How To Configure Server Side Transparent Application Failover (文档 ID 460982.1)
- How To Configure Server Side Transparent Application Failover [ID 460982.1]
- 解决Opentaps/OFBiz在Eclipse启动时"Could not load VFS configuration"的问题
- TAF(Transparent Application Failover)
- Placement of Voting disk and OCR Files in Oracle RAC 10g and 11gR1 [ID 293819.1]