您的位置:首页 > 移动开发

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

InthisDocument
Goal
Solution
CONCEPTS
CONFIGURATION
ClientSideLoadBalancing
ConnectTimeFailover
ClientSideLoadBalance&Connect-timeFailoverConnectString
TAF-ClientSideConfiguration
TAF-ServerSideConfiguration
TroubleshootingTAF
References

Appliesto:

OracleNetServices-Version:10.1.0.2.0to11.1.0.7.0-Release:10.1to11.1
OracleNetServices-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-TimeLoadBalance

Theclientloadbalancingfeatureenablesclientstorandomizeconnectionrequestsamongthelisteners.

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

Wewilltakea2nodesetupforthisentireconfigurationexample

Node1:


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

FollowingisanexampleofTNSnetservicealiasforclientsideloadbalancing

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)

)

)


ConnectTimeFailover

SampleconnecttimefailoverTNSnetservicealias
address_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.
ReferNote460982.1HowToConfigureServerSideTransparentApplication
Failover

TroubleshootingLoadBalance

Incaseofserversideloadbalancingnothappeningproperly,tostartdiagonisngtheissueyoumaycollectthebelowsetofinformation:

a.Issessionloadbalanceturnedon?
b.Whatistheconnectiondistributiononnodes?
c.Isallthenodesareequalpowerw.r.tCPU/Memory/Hardware?
d.Isthereanyapplicationconnectinglocally(BEQueathconnection)anddoingbigoperationsonanyoneofthenode?
e.Areallthenodesareconfiguredwithpropersettingsoflocal/remotelisteners?
ReferNOTE263599.1UnderstandingandTroubleshootingInstanceLoadBalancing

TroubleshootingTAF

IncaseofclientconnectivityfailuretheidealstartpointtodiagonisetheissueiswithClientSqlnettracingatsupportLevel

ToenabletheclienttracingRefer
NOTE395525.1HowtoEnableOracleSQLNetClient,Server,Listener,KerberosandExternalprocedureTracingfromNetManager

WhilecreatinganServiceRequestwithOracleSupportforTAF,providethefollowinginformationtodiagonisetheproblem:

a.Failedconnectionclientsqlnettracing

b.Executeandprovidetheoutputoffollowingcommandsfromboththenodes:
$sql>showparameterListener
$sql>showparameterservice
$lsnrctlservices<listener_name>

c.Uploadthetnsnames.ora&Listenerlogs(bydefaultcreatedwith<listener_name>.log)frombothnodes.

References

NOTE:226880.1-ConfigurationofLoadBalancingandTransparentApplicationFailover
NOTE:342419.1-ORA-12520:ListenersRunningonVIPAddressin10gorNewerRAC
NOTE:395525.1-HowtoEnableOracleSQLNetClient,Server,Listener,KerberosandExternalprocedureTracingfromNetManager

Related

Products

OracleDatabaseProducts>OracleDatabase>NetServices>OracleNetServices

OracleDatabaseProducts>OracleDatabase>NetServices>OracleNetServices

OracleDatabaseProducts>OracleDatabase>NetServices>OracleNetServices

Keywords

TRANSPARENTAPPLICATIONFAILOVER;TAF;LOADBALANCED;CONNECTTIMEFAILOVER;FAILOVER;REMOTE_LISTENER;FAILOVER_MODE;LOAD_BALANCE

------------------------------------------------------------------------------

Blog:http://blog.csdn.net/tianlesoftware
网上资源:http://tianlesoftware.download.csdn.net
相关视频:http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx

DBA1群:62697716(满);DBA2群:62697977(满)

DBA3群:62697850DBA超级群:63306533;

聊天群:40132017

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐