SunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideSunMicrosystems,Inc.
4150NetworkCircleSantaClara,CA95054U.
S.
A.
PartNo:819–2555–12August2007Copyright2007SunMicrosystems,Inc.
4150NetworkCircle,SantaClara,CA95054U.
S.
A.
Allrightsreserved.
SunMicrosystems,Inc.
hasintellectualpropertyrightsrelatingtotechnologyembodiedintheproductthatisdescribedinthisdocument.
Inparticular,andwithoutlimitation,theseintellectualpropertyrightsmayincludeoneormoreU.
S.
patentsorpendingpatentapplicationsintheU.
S.
andinothercountries.
U.
S.
GovernmentRights–Commercialsoftware.
GovernmentusersaresubjecttotheSunMicrosystems,Inc.
standardlicenseagreementandapplicableprovisionsoftheFARanditssupplements.
Thisdistributionmayincludematerialsdevelopedbythirdparties.
PartsoftheproductmaybederivedfromBerkeleyBSDsystems,licensedfromtheUniversityofCalifornia.
UNIXisaregisteredtrademarkintheU.
S.
andothercountries,exclusivelylicensedthroughX/OpenCompany,Ltd.
Sun,SunMicrosystems,theSunlogo,theSolarislogo,theJavaCoffeeCuplogo,docs.
sun.
com,Java,andSolarisaretrademarksorregisteredtrademarksofSunMicrosystems,Inc.
intheU.
S.
andothercountries.
AllSPARCtrademarksareusedunderlicenseandaretrademarksorregisteredtrademarksofSPARCInternational,Inc.
intheU.
S.
andothercountries.
ProductsbearingSPARCtrademarksarebaseduponanarchitecturedevelopedbySunMicrosystems,Inc.
TheOPENLOOKandSunTMGraphicalUserInterfacewasdevelopedbySunMicrosystems,Inc.
foritsusersandlicensees.
SunacknowledgesthepioneeringeffortsofXeroxinresearchinganddevelopingtheconceptofvisualorgraphicaluserinterfacesforthecomputerindustry.
Sunholdsanon-exclusivelicensefromXeroxtotheXeroxGraphicalUserInterface,whichlicensealsocoversSun'slicenseeswhoimplementOPENLOOKGUIsandotherwisecomplywithSun'swrittenlicenseagreements.
ProductscoveredbyandinformationcontainedinthispublicationarecontrolledbyU.
S.
ExportControllawsandmaybesubjecttotheexportorimportlawsinothercountries.
Nuclear,missile,chemicalorbiologicalweaponsornuclearmaritimeendusesorendusers,whetherdirectorindirect,arestrictlyprohibited.
ExportorreexporttocountriessubjecttoU.
S.
embargoortoentitiesidentifiedonU.
S.
exportexclusionlists,including,butnotlimitedto,thedeniedpersonsandspeciallydesignatednationalslistsisstrictlyprohibited.
DOCUMENTATIONISPROVIDED"ASIS"ANDALLEXPRESSORIMPLIEDCONDITIONS,REPRESENTATIONSANDWARRANTIES,INCLUDINGANYIMPLIEDWARRANTYOFMERCHANTABILITY,FITNESSFORAPARTICULARPURPOSEORNON-INFRINGEMENT,AREDISCLAIMED,EXCEPTTOTHEEXTENTTHATSUCHDISCLAIMERSAREHELDTOBELEGALLYINVALID.
Copyright2007SunMicrosystems,Inc.
4150NetworkCircle,SantaClara,CA95054U.
S.
A.
Tousdroitsréservés.
SunMicrosystems,Inc.
détientlesdroitsdepropriétéintellectuellerelatifsàlatechnologieincorporéedansleproduitquiestdécritdanscedocument.
Enparticulier,etcesanslimitation,cesdroitsdepropriétéintellectuellepeuventinclureunouplusieursbrevetsaméricainsoudesapplicationsdebrevetenattenteauxEtats-Unisetdansd'autrespays.
Cettedistributionpeutcomprendredescomposantsdéveloppéspardestiercespersonnes.
CertainescomposantsdeceproduitpeuventêtredérivéesdulogicielBerkeleyBSD,licenciésparl'UniversitédeCalifornie.
UNIXestunemarquedéposéeauxEtats-Unisetdansd'autrespays;elleestlicenciéeexclusivementparX/OpenCompany,Ltd.
Sun,SunMicrosystems,lelogoSun,lelogoSolaris,lelogoJavaCoffeeCup,docs.
sun.
com,JavaetSolarissontdesmarquesdefabriqueoudesmarquesdéposéesdeSunMicrosystems,Inc.
auxEtats-Unisetdansd'autrespays.
TouteslesmarquesSPARCsontutiliséessouslicenceetsontdesmarquesdefabriqueoudesmarquesdéposéesdeSPARCInternational,Inc.
auxEtats-Unisetdansd'autrespays.
LesproduitsportantlesmarquesSPARCsontbaséssurunearchitecturedéveloppéeparSunMicrosystems,Inc.
L'interfaced'utilisationgraphiqueOPENLOOKetSunaétédéveloppéeparSunMicrosystems,Inc.
poursesutilisateursetlicenciés.
SunreconnatleseffortsdepionniersdeXeroxpourlarechercheetledéveloppementduconceptdesinterfacesd'utilisationvisuelleougraphiquepourl'industriedel'informatique.
SundétientunelicencenonexclusivedeXeroxsurl'interfaced'utilisationgraphiqueXerox,cettelicencecouvrantégalementleslicenciésdeSunquimettentenplacel'interfaced'utilisationgraphiqueOPENLOOKetqui,enoutre,seconformentauxlicencesécritesdeSun.
Lesproduitsquifontl'objetdecettepublicationetlesinformationsqu'ilcontientsontrégisparlalegislationaméricaineenmatièredecontrledesexportationsetpeuventêtresoumisaudroitd'autrespaysdansledomainedesexportationsetimportations.
Lesutilisationsfinales,ouutilisateursfinaux,pourdesarmesnucléaires,desmissiles,desarmeschimiquesoubiologiquesoupourlenucléairemaritime,directementouindirectement,sontstrictementinterdites.
LesexportationsouréexportationsversdespayssousembargodesEtats-Unis,ouversdesentitésfigurantsurleslistesd'exclusiond'exportationaméricaines,ycompris,maisdemanièrenonexclusive,lalistedepersonnesquifontobjetd'unordredenepasparticiper,d'unefaondirecteouindirecte,auxexportationsdesproduitsoudesservicesquisontrégisparlalegislationaméricaineenmatièredecontrledesexportationsetlalistederessortissantsspécifiquementdesignés,sontrigoureusementinterdites.
LADOCUMENTATIONESTFOURNIE"ENL'ETAT"ETTOUTESAUTRESCONDITIONS,DECLARATIONSETGARANTIESEXPRESSESOUTACITESSONTFORMELLEMENTEXCLUES,DANSLAMESUREAUTORISEEPARLALOIAPPLICABLE,YCOMPRISNOTAMMENTTOUTEGARANTIEIMPLICITERELATIVEALAQUALITEMARCHANDE,AL'APTITUDEAUNEUTILISATIONPARTICULIEREOUAL'ABSENCEDECONTREFACON.
070830@18135ContentsPreface171ApplicationServerHighAvailabilityFeatures23OverviewofHighAvailability23LoadBalancerPlug-in23HighAvailabilityDatabase24HighlyAvailableClusters24MoreInformation26HighAvailabilitySessionPersistence272InstallingandSettingUpHighAvailabilityDatabase29OverviewofHighAvailabilityDatabase29HADBandApplicationServer29HADBServerArchitecture30HADBNodes31NewFeaturesandImprovements31UsingCustomerSupportforHADB33PreparingforHADBSetup34Prerequisites34ConfiguringNetworkRedundancy35ConfiguringSharedMemoryandSemaphores38ToconfiguresharedmemoryandsemaphoresonSolaris38ToconfiguresharedmemoryonLinux39SynchronizingSystemClocks40FileSystemSupport40Installation41HADBInstallation413NodeSupervisorProcessesPrivileges42ToGiveNodeSupervisorProcessesRootPrivileges43SettingupHighAvailability43Prerequisites43ToprepareyoursystemforHighAvailability43StartingtheHADBManagementAgent44ToStarttheManagementAgentwithJavaEnterpriseSystemonSolarisorLinux.
.
.
.
.
.
44ToStarttheManagementAgentwithJavaEnterpriseSystemonWindows45ToStarttheManagementAgentwithStandaloneApplicationServeronSolarisorLinux45ToStarttheManagementAgentwithStandaloneApplicationServeronWindows.
.
.
45ConfiguringaClusterforHighAvailability46ConfiguringanApplicationforHighAvailability46RestartingtheCluster46RestartingtheWebServer46ToCleanUptheWebServerInstanceActingasLoadBalancer47UpgradingHADB47ToupgradeHADBtoanewerversion47RegisteringHADBPackages48UnregisteringHADBPackages49ReplacingtheManagementAgentStartupScript503AdministeringHighAvailabilityDatabase51UsingtheHADBManagementAgent51ManagementAgentCommandSyntax51CustomizingManagementAgentConfiguration53TocustomizethemanagementagentconfigurationoneachHADBhost53StartingtheManagementAgent54UsingthehadbmManagementCommand59CommandSyntax59SecurityOptions60GeneralOptions61EnvironmentVariables62ConfiguringHADB64CreatingaManagementDomain64ContentsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust20074CreatingaDatabase65Tocreateadatabase65ViewingandModifyingConfigurationAttributes70ConfiguringtheJDBCConnectionPool75ManagingHADB78ManagingDomains78ManagingNodes79ManagingDatabases82RecoveringfromSessionDataCorruption86Tobringthesessionstorebacktoaconsistentstate86ExpandingHADB87AddingStorageSpacetoExistingNodes87AddingMachines88ToaddnewmachinestoanexistingHADBinstance88AddingNodes88RefragmentingtheDatabase90AddingNodesbyRecreatingtheDatabase91Toaddnodesbyrecreatingthedatabase91MonitoringHADB92GettingtheStatusofHADB92GettingDeviceInformation94GettingRuntimeResourceInformation96MaintainingHADBMachines99Toperformmaintenanceonasinglemachine99ToperformplannedmaintenanceonallHADBmachines100ToperformplannedmaintenanceonallHADBmachines100Toperformunplannedmaintenanceintheeventofafailure101ClearingandArchivingHistoryFiles1014ConfiguringLoadBalancingandFailover103HowtheLoadBalancerWorks103AssignedRequestsandUnassignedRequests104HTTPLoadBalancingAlgorithm104SampleApplications104SettingUpHTTPLoadBalancing105Contents5PrerequisitesforSettingUpLoadBalancing105HTTPLoadBalancerDeployments105ProceduretoSetUpLoadBalancing106ToSetUpLoadBalancing106ConfiguringWebServersforLoadBalancing107ModificationstoSunJavaSystemWebServer108UsingApacheWebServer108ToconfigureApacheSecurityFilestoworkwiththeLoadBalancer113ModificationstoMicrosoftIIS114ToConfigureMicrosoftIIStousetheLoadBalancerPlug-in114ConfiguringMultipleWebServerInstances115ToConfigureMultipleWebServerInstances116ConfiguringtheLoadBalancer116CreatinganHTTPLoadBalancerConfiguration117CreatinganHTTPLoadBalancerReference117EnablingServerInstancesforLoadBalancing118EnablingApplicationsforLoadBalancing118CreatingtheHTTPHealthChecker118ExportingtheLoadBalancerConfigurationFile120Toexporttheloadbalancerconfiguration120ChangingtheLoadBalancerConfiguration121EnablingDynamicReconfiguration121Disabling(Quiescing)aServerInstanceorCluster121Todisableaserverinstanceorcluster122Disabling(Quiescing)anApplication122Todisableanapplication122ConfiguringHTTPandHTTPSFailover123ConfiguringIdempotentURLs124UpgradingApplicationsWithoutLossofAvailability125ApplicationCompatibility125UpgradingInaSingleCluster125Toupgradeanapplicationinasinglecluster126UpgradinginMultipleClusters127Toupgradeacompatibleapplicationintwoormoreclusters:127UpgradingIncompatibleApplications129Toupgradeanincompatibleapplicationbycreatingasecondcluster129ContentsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust20076MonitoringtheHTTPLoadBalancerPlug-in131ConfiguringLogMessages131TypesofLogMessages131EnablingLoadBalancerLogging132Toturnonloadbalancerlogging133UnderstandingMonitoringMessages1335UsingApplicationServerClusters135OverviewofClusters135WorkingwithClusters135ToCreateaCluster136ToCreateServerInstancesforaCluster137ToConfigureaCluster138ToStart,Stop,andDeleteClusteredInstances138ToConfigureServerInstancesinaCluster139ToConfigureApplicationsforaCluster140ToConfigureResourcesforaCluster140ToDeleteaCluster141ToMigrateEJBTimers141ToUpgradeComponentsWithoutLossofService1426ManagingNamedConfigurations145AboutNamedConfigurations145NamedConfigurations145Thedefault-configConfiguration146ConfigurationsCreatedwhenCreatingInstancesorClusters146UniquePortNumbersandConfigurations147WorkingwithNamedConfigurations148ToCreateaNamedConfiguration148EditingaNamedConfiguration'sProperties148ToEditaNamedConfiguration'sProperties149ToEditPortNumbersforInstancesReferencingaConfiguration150ToviewaNamedConfiguration'sTargets150ToDeleteaNamedConfiguration151Contents77ConfiguringNodeAgents153WhatIsaNodeAgent153SeeAlso154NodeAgentPlaceholders155DeployingNodeAgents155ToDeployNodeAgentsOnline155ToDeployNodeAgentsOffline156NodeAgentandDomainAdministrationServerSynchronization158NodeAgentSynchronization158ServerInstanceSynchronization159SynchronizingLibraryFiles160UniqueSettingsandConfigurationManagement161SynchronizingLargeApplications161ViewingNodeAgentLogs162TasksAvailablethroughtheAdminConsoleandasadminTool163WorkingwithNodeAgents164ToViewGeneralNodeAgentInformation164ToCreateaNodeAgentPlaceholder165ToDeleteaNodeAgentConfiguration166ToEditaNodeAgentConfiguration166ToEditaNodeAgentRealm167ToEdittheNodeAgent'sListenerforJMX168WorkingwithNodeAgentsusingasadmin169CreatingaNodeAgent169StartingaNodeAgent170StoppingaNodeAgent171DeletingaNodeAgent1718ConfiguringHighAvailabilitySessionPersistenceandFailover173OverviewofSessionPersistenceandFailover173Requirements173Restrictions174SampleApplications174SettingUpHighAvailabilitySessionPersistence175ToSetUpHighAvailabilitySessionPersistence175ContentsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust20078EnablingSessionAvailability176HTTPSessionFailover177ConfiguringAvailabilityfortheWebContainer177ToEnableAvailabilityfortheWebContainerwithAdminConsole178ConfiguringAvailabilityforIndividualWebApplications179UsingSingleSign-onwithSessionFailover180StatefulSessionBeanFailover181ConfiguringAvailabilityfortheEJBContainer182ToEnableAvailabilityfortheEJBContainer182ConfiguringAvailabilityforanIndividualApplicationorEJBModule184ConfiguringAvailabilityforanIndividualBean184SpecifyingMethodstoBeCheckpointed1859JavaMessageServiceLoadBalancingandFailover187OverviewofJavaMessageService187SampleApplication187FurtherInformation188ConfiguringtheJavaMessageService188JavaMessageServiceIntegration189JMSHostsList190ConnectionPoolingandFailover191Load-BalancedMessageInflow192UsingMQClusterswithApplicationServer192ToEnableMQclusterswithApplicationServerClusters19210RMI-IIOPLoadBalancingandFailover197Overview197Requirements198Algorithm198SampleApplication199SettingupRMI-IIOPLoadBalancingandFailover199TosetupRMI-IIOPloadbalancingfortheApplicationClientContainer199TosetupRMI-IIOPloadbalancingandfailoverforStand-AloneClient201Contents9Index203ContentsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200710FiguresFIGURE2–1HADBArchitecture301112TablesTABLE2–1hadbmregisterpackageOptions49TABLE3–1ManagementAgentCommonOptions52TABLE3–2ManagementAgentServiceOptions(WindowsOnly)52TABLE3–3ConfigurationFileSettings54TABLE3–4hadbmSecurityOptions61TABLE3–5hadbmGeneralOptions62TABLE3–6HADBOptionsandEnvironmentVariables62TABLE3–7hadbmcreateOptions66TABLE3–8ConfigurationAttributes71TABLE3–9HADBConnectionPoolSettings76TABLE3–10HADBConnectionPoolProperties76TABLE3–11HADBJDBCResourceSettings78TABLE3–12hadbmclearOptions85TABLE3–13hadbmaddnodesOptions89TABLE3–14HADBStates93TABLE3–15hadbmresourceinfoCommandOptions96TABLE4–1LoadBalancerConfigurationParameters117TABLE4–2HealthCheckerParameters119TABLE4–3Health-checkerManualProperties120TABLE7–1Filesanddirectoriessynchronizedamongremoteserverinstances159TABLE7–2TasksavailablethroughtheAdminConsoleandtheasadmincommand.
.
.
.
.
.
.
1631314ExamplesEXAMPLE2–1SettingupMultipathing36EXAMPLE2–2ExampleofunregisteringHADB50EXAMPLE3–1Exampleofhadbmcommand60EXAMPLE3–2CreatinganHADBManagementDomain64EXAMPLE3–3Exampleofcreatingadatabase67EXAMPLE3–4Exampleofusinghadbmget70EXAMPLE3–5CreatingaConnectionPool77EXAMPLE3–6Exampleofstartinganode80EXAMPLE3–7Exampleofstoppinganode81EXAMPLE3–8Exampleofrestartinganode82EXAMPLE3–9Exampleofstartingadatabase82EXAMPLE3–10Exampleofstoppingadatabase83EXAMPLE3–11Exampleofremovingadatabase86EXAMPLE3–12Exampleofsettingdatadevicesize88EXAMPLE3–13Exampleofaddingnodes89EXAMPLE3–14Exampleofrefragmentingthedatabase91EXAMPLE3–15ExampleofgettingHADBstatus93EXAMPLE3–16Exampleofgettingdeviceinformation96EXAMPLE3–17Exampledatabufferpoolinformation97EXAMPLE3–18Examplelockinformation98EXAMPLE3–19Exampleoflogbufferinformation98EXAMPLE3–20Exampleofinternallogbufferinformation99EXAMPLE7–1ExampleofCreatingaNodeAgent170EXAMPLE8–1ExampleofanEJBDeploymentDescriptorWithAvailabilityEnabled184EXAMPLE8–2ExampleofEJBDeploymentDescriptorSpecifyingMethodsCheckpointing1851516PrefaceTheHighAvailabilityAdministrationGuidedescribesthehigh-availabilityfeaturesofSunJavaTMSystemApplicationServer,includinghowto:Install,configure,andadministerHighAvailabilityDatabase(HADB).
Install,configure,andusetheHTTPLoadBalancerPlug-in.
Usenamedconfigurationstoshareserverconfigurationattributes.
Setupandusehighly-availableclusters.
Configurenodeagents.
Configureandusehigh-availabilitysessionpersistence.
UseotherhighavailabilityfeaturessuchasJavaMessageserviceandRMI-IIOPfailover.
WhoShouldUseThisBookThisguideisintendedforsystemadministratorsinproductionenvironments.
Itassumesyouarefamiliarwith:BasicsystemadministrationInstallingsoftwareUsingawebbrowserIssuingcommandsinaterminalwindowBeforeYouReadThisBookApplicationServercanbepurchasedbyitselforasacomponentofSunJavaTMEnterpriseSystem(JavaES),asoftwareinfrastructurethatsupportsenterpriseapplicationsdistributedacrossanetworkorInternetenvironment.
IfyoupurchasedApplicationServerasacomponentofJavaES,youshouldbefamiliarwiththesystemdocumentationathttp://docs.
sun.
com/coll/1286.
1.
17HowThisBookIsOrganizedChapter1,"ApplicationServerHighAvailabilityFeatures"providesanoverviewofApplicationServer'shighavailabilityfeatures.
Chapter2,"InstallingandSettingUpHighAvailabilityDatabase"describeshowtoinstallandsetupHighAvailabilityDatabase.
Chapter3,"AdministeringHighAvailabilityDatabase"explainshowtoadministerHighAvailabilityDatabase.
Chapter4,"ConfiguringLoadBalancingandFailover"describeshowtoinstall,configure,andusetheHTTPLoadBalancerPlug-in.
Chapter5,"UsingApplicationServerClusters"explainsApplicationServerclustersandhowtoconfigureandadministerthem.
Chapter6,"ManagingNamedConfigurations"explainshowtousenamedconfigurationstoshareApplicationServerconfigurationattributes.
Chapter7,"ConfiguringNodeAgents"describesnodeagentsandhowtoadministerthem.
Chapter8,"ConfiguringHighAvailabilitySessionPersistenceandFailover"explainshowtosetuphigh-availabilitysessionpersistence.
Chapter9,"JavaMessageServiceLoadBalancingandFailover"describesJavaMessageServiceLoadBalancingandFailover.
Chapter10,"RMI-IIOPLoadBalancingandFailover"describesRMI-IIOPLoadBalancingandFailover.
ApplicationServerDocumentationSetTheApplicationServerdocumentationsetdescribesdeploymentplanningandsysteminstallation.
Thestand-aloneApplicationServerdocumentationisathttp://docs.
sun.
com/app/docs/coll/1310.
1.
ForanintroductiontoApplicationServer,refertothebooksintheorderinwhichtheyarelistedinthefollowingtable.
TABLEP–1BooksintheApplicationServerDocumentationSetBookTitleDescriptionReleaseNotesLate-breakinginformationaboutthesoftwareandthedocumentation.
Includesacomprehensive,table-basedsummaryofthesupportedhardware,operatingsystem,JDK,andJDBC/RDBMS.
PrefaceSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200718TABLEP–1BooksintheApplicationServerDocumentationSet(Continued)BookTitleDescriptionQuickStartGuideHowtogetstartedwiththeApplicationServerproduct.
InstallationGuideInstallingthesoftwareanditscomponents.
DeploymentPlanningGuideEvaluatingyoursystemneedsandenterprisetoensurethatyoudeploytheApplicationServerinamannerthatbestsuitsyoursite.
Generalissuesandconcernsthatyoumustbeawareofwhendeployingtheserverarealsodiscussed.
Developer'sGuideCreatingandimplementingJava2Platform,EnterpriseEdition(J2EETMplatform)applicationsintendedtorunontheApplicationServerthatfollowtheopenJavastandardsmodelforJ2EEcomponentsandAPIs.
Includesgeneralinformationaboutdevelopertools,security,assembly,deployment,debugging,andcreatinglifecyclemodules.
J2EE1.
4TutorialUsingJ2EE1.
4platformtechnologiesandAPIstodevelopJ2EEapplications.
AdministrationGuideConfiguring,managing,anddeployingApplicationServersubsystemsandcomponentsfromtheAdministrationConsole.
HighAvailabilityAdministrationGuidePost-installationconfigurationandadministrationinstructionsforthehigh-availabilitydatabase.
AdministrationReferenceEditingtheApplicationServerconfigurationfile,domain.
xml.
UpgradeandMigrationGuideMigratingyourapplicationstothenewApplicationServerprogrammingmodel,specificallyfromApplicationServer6.
xand7.
Thisguidealsodescribesdifferencesbetweenadjacentproductreleasesandconfigurationoptionsthatcanresultinincompatibilitywiththeproductspecifications.
PerformanceTuningGuideTuningtheApplicationServertoimproveperformance.
TroubleshootingGuideSolvingApplicationServerproblems.
ErrorMessageReferenceSolvingApplicationServererrormessages.
ReferenceManualUtilitycommandsavailablewiththeApplicationServer;writteninmanpagestyle.
Includestheasadmincommandlineinterface.
RelatedBooksForotherSunJavaSystemserverdocumentation,see:MessageQueuedocumentationDirectoryServerdocumentationWebServerdocumentationDocumentationofJavaESanditscomponentsisathttp://docs.
sun.
com/prod/entsys.
05q4.
Preface19DefaultPathsandFileNamesThefollowingtabledescribesthedefaultpathsandfilenamesthatareusedinthisbook.
TABLEP–2DefaultPathsandFileNamesPlaceholderDescriptionDefaultValueinstall-dirRepresentsthebaseinstallationdirectoryforApplicationServer.
SunJavaEnterpriseSysteminstallationsontheSolarisTMplatform:/opt/SUNWappserver/appserverSunJavaEnterpriseSysteminstallationsontheLinuxplatform:/opt/sun/appserver/OtherSolarisandLinuxinstallations,non-rootuser:user'shomedirectory/SUNWappserverOtherSolarisandLinuxinstallations,rootuser:/opt/SUNWappserverWindows,allinstallations:SystemDrive:\Sun\AppServerdomain-root-dirRepresentsthedirectorycontainingalldomains.
SunJavaEnterpriseSysteminstallationsontheSolarisplatform:/var/opt/SUNWappserver/domains/SunJavaEnterpriseSysteminstallationsontheLinuxplatform:/var/opt/sun/appserver/domains/Allotherinstallations:install-dir/domains/domain-dirRepresentsthedirectoryforadomain.
Inconfigurationfiles,youmightseedomain-dirrepresentedasfollows:${com.
sun.
aas.
instanceRoot}domain-root-dir/domain-dirinstance-dirRepresentsthedirectoryforaserverinstance.
domain-dir/instance-dirPrefaceSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200720TypographicConventionsThefollowingtabledescribesthetypographicchangesthatareusedinthisbook.
TABLEP–3TypographicConventionsTypefaceMeaningExampleAaBbCc123Thenamesofcommands,files,anddirectories,andonscreencomputeroutputEdityour.
loginfile.
Usels-atolistallfiles.
machine_name%youhavemail.
AaBbCc123Whatyoutype,contrastedwithonscreencomputeroutputmachine_name%suPassword:AaBbCc123AplaceholdertobereplacedwitharealnameorvalueThecommandtoremoveafileisrmfilename.
AaBbCc123Booktitles,newterms,andtermstobeemphasized(notethatsomeemphasizeditemsappearboldonline)ReadChapter6intheUser'sGuide.
Acacheisacopythatisstoredlocally.
Donotsavethefile.
SymbolConventionsThefollowingtableexplainssymbolsthatmightbeusedinthisbook.
TABLEP–4SymbolConventionsSymbolDescriptionExampleMeaning[]Containsoptionalargumentsandcommandoptions.
ls[-l]The-loptionisnotrequired.
{|}Containsasetofchoicesforarequiredcommandoption.
-d{y|n}The-doptionrequiresthatyouuseeithertheyargumentorthenargument.
${}Indicatesavariablereference.
${com.
sun.
javaRoot}Referencesthevalueofthecom.
sun.
javaRootvariable.
-Joinssimultaneousmultiplekeystrokes.
Control-APresstheControlkeywhileyoupresstheAkey.
+Joinsconsecutivemultiplekeystrokes.
Ctrl+A+NPresstheControlkey,releaseit,andthenpressthesubsequentkeys.
Preface21TABLEP–4SymbolConventions(Continued)SymbolDescriptionExampleMeaning→Indicatesmenuitemselectioninagraphicaluserinterface.
File→New→TemplatesFromtheFilemenu,chooseNew.
FromtheNewsubmenu,chooseTemplates.
AccessingSunResourcesOnlineThedocs.
sun.
comSMwebsiteenablesyoutoaccessSuntechnicaldocumentationonline.
Youcanbrowsethedocs.
sun.
comarchiveorsearchforaspecificbooktitleorsubject.
BooksareavailableasonlinefilesinPDFandHTMLformats.
Bothformatsarereadablebyassistivetechnologiesforuserswithdisabilities.
ToaccessthefollowingSunresources,gotohttp://www.
sun.
com:DownloadsofSunproductsServicesandsolutionsSupport(includingpatchesandupdates)TrainingResearchCommunities(forexample,SunDeveloperNetwork)Third-PartyWebSiteReferencesThird-partyURLsarereferencedinthisdocumentandprovideadditional,relatedinformation.
Note–Sunisnotresponsiblefortheavailabilityofthird-partywebsitesmentionedinthisdocument.
Sundoesnotendorseandisnotresponsibleorliableforanycontent,advertising,products,orothermaterialsthatareavailableonorthroughsuchsitesorresources.
Sunwillnotberesponsibleorliableforanyactualorallegeddamageorlosscausedorallegedtobecausedbyorinconnectionwithuseoforrelianceonanysuchcontent,goods,orservicesthatareavailableonorthroughsuchsitesorresources.
SunWelcomesYourCommentsSunisinterestedinimprovingitsdocumentationandwelcomesyourcommentsandsuggestions.
Toshareyourcomments,gotohttp://docs.
sun.
comandclickSendComments.
Intheonlineform,providethefulldocumenttitleandpartnumber.
Thepartnumberisa7-digitor9-digitnumberthatcanbefoundonthebook'stitlepageorinthedocument'sURL.
Forexample,thepartnumberofthisbookis819-2555.
PrefaceSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200722ApplicationServerHighAvailabilityFeaturesThischapterdescribesthehighavailabilityfeaturesintheSunJavaSystemApplicationServerEnterpriseEdition,withthefollowingtopics:"OverviewofHighAvailability"onpage23"HighAvailabilitySessionPersistence"onpage27OverviewofHighAvailabilityHighavailabilityapplicationsandservicesprovidetheirfunctionalitycontinuously,regardlessofhardwareandsoftwarefailures.
ApplicationServerprovideshighavailabilityforHTTPrequestsandsessiondata(bothHTTPsessiondataandstatefulsessionbeandata).
ApplicationServerprovideshighavailabilitythroughthefollowingsub-componentsandfeatures:"LoadBalancerPlug-in"onpage23"HighAvailabilityDatabase"onpage24(HADB)"HighlyAvailableClusters"onpage24LoadBalancerPlug-inTheloadbalancerplug-inacceptsHTTPandHTTPSrequestsandforwardsthemtoapplicationserverinstancesinacluster.
Ifaninstancefails,becomesunavailable(duetonetworkfaults),orbecomesunresponsive,theloadbalancerredirectsrequeststoexisting,availablemachines.
Theloadbalancercanalsorecognizewhenafailedinstancehasrecoveredandredistributetheloadaccordingly.
TheApplicationServerEnterpriseEditionincludestheloadbalancerplug-infortheSunJavaSystemWebServerandtheApacheWebServer,andMicrosoftInternetInformationServer.
1CHAPTER123Bydistributingworkloadamongmultiplephysicalmachines,theloadbalancerincreasesoverallsystemthroughput.
ItalsoprovideshigheravailabilitythroughfailoverofHTTPrequests.
ForHTTPsessioninformationtopersist,youmustconfigureHTTPsessionpersistence.
Forsimple,statelessapplicationsaload-balancedclustermaybesufficient.
However,formission-criticalapplicationswithsessionstate,useloadbalancedclusterswithHADB.
Serverinstancesandclustersparticipatinginloadbalancinghaveahomogenousenvironment.
Usuallythatmeansthattheserverinstancesreferencethesameserverconfiguration,canaccessthesamephysicalresources,andhavethesameapplicationsdeployedtothem.
Homogeneityassuresthatbeforeandafterfailures,theloadbalanceralwaysdistributesloadevenlyacrosstheactiveinstancesinthecluster.
ForinformationonconfiguringloadbalancingandfailoverforseeChapter4,"ConfiguringLoadBalancingandFailover"HighAvailabilityDatabaseApplicationServerEnterpriseEditionprovidestheHighAvailabilityDatabase(HADB)forhighavailabilitystorageofHTTPsessionandstatefulsessionbeandata.
HADBisdesignedtosupportupto99.
999%serviceanddataavailabilitywithloadbalancing,failover,andstaterecovery.
Generally,youmustconfigureandmanageHADBindependentlyofApplicationServer.
KeepingstatemanagementresponsibilitiesseparatedfromApplicationServerhassignificantbenefits.
ApplicationServerinstancesspendtheircyclesperformingasascalableandhighperformanceJavaTM2Platform,EnterpriseEdition(J2EETMplatform)containersdelegatingstatereplicationtoanexternalhighavailabilitystateservice.
Duetothislooselycoupledarchitecture,applicationserverinstancescanbeveryeasilyaddedtoordeletedfromacluster.
TheHADBstatereplicationservicecanbeindependentlyscaledforoptimumavailabilityandperformance.
Whenanapplicationserverinstancealsoperformsreplication,theperformanceofJ2EEapplicationscansufferandcanbesubjecttolongergarbagecollectionpauses.
ForinformationonplanningandsettingupyourapplicationserverinstallationforhighavailabilitywithHADB,includingdetermininghardwareconfiguration,sizing,andtopology,see"PlanningforAvailability"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2DeploymentPlanningGuideandChapter3,"SelectingaTopology,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2DeploymentPlanningGuide.
HighlyAvailableClustersAclusterisacollectionofApplicationServerinstancesthatworktogetherasonelogicalentity.
AclusterprovidesaruntimeenvironmentforoneormoreJ2EEapplications.
Ahighlyavailableclusterintegratesastatereplicationservicewithclustersandloadbalancer.
OverviewofHighAvailabilitySunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200724Usingclustersprovidesthefollowingadvantages:Highavailability,byallowingforfailoverprotectionfortheserverinstancesinacluster.
Ifoneserverinstancegoesdown,otherserverinstancestakeovertherequeststhattheunavailableserverinstancewasserving.
Scalability,byallowingfortheadditionofserverinstancestoacluster,thusincreasingthecapacityofthesystem.
Theloadbalancerplug-indistributesrequeststotheavailableserverinstanceswithinthecluster.
Nodisruptioninserviceisrequiredasanadministratoraddsmoreserverinstancestoacluster.
Allinstancesinacluster:Referencethesameconfiguration.
Havethesamesetofdeployedapplications(forexample,aJ2EEapplicationEARfile,awebmoduleWARfile,oranEJBJARfile).
Havethesamesetofresources,resultinginthesameJNDInamespace.
Everyclusterinthedomainhasauniquename;furthermore,thisnamemustbeuniqueacrossallnodeagentnames,serverinstancenames,clusternames,andconfigurationnames.
Thenamemustnotbedomain.
Youperformthesameoperationsonacluster(forexample,deployingapplicationsandcreatingresources)thatyouperformonanunclusteredserverinstance.
ClustersandConfigurationsAcluster'ssettingsarederivedfromanamedconfiguration,whichcanpotentiallybesharedwithotherclusters.
Aclusterwhoseconfigurationisnotsharedbyotherserverinstancesorclustersissaidtohaveastand-aloneconfiguration.
Bydefault,thenameofthisconfigurationiscluster_name-config,wherecluster_nameisthenameofthecluster.
Aclusterthatsharesitsconfigurationwithotherclustersorinstancesissaidtohaveasharedconfiguration.
Clusters,Instances,Sessions,andLoadBalancingClusters,serverinstances,loadbalancers,andsessionsarerelatedasfollows:Aserverinstanceisnotrequiredtobepartofacluster.
However,aninstancethatisnotpartofaclustercannottakeadvantageofhighavailabilitythroughtransferofsessionstatefromoneinstancetootherinstances.
Theserverinstanceswithinaclustercanbehostedononeormultiplemachines.
Youcangroupserverinstancesacrossdifferentmachinesintoacluster.
Aparticularloadbalancercanforwardrequeststoserverinstancesonmultipleclusters.
Youcanusethisabilityoftheloadbalancertoperformanonlineupgradewithoutlossofservice.
Formoreinformation,see"UsingMultipleClustersforOnlineUpgradesWithoutLossofService"inthechapter"ConfiguringClusters"OverviewofHighAvailabilityChapter1ApplicationServerHighAvailabilityFeatures25Asingleclustercanreceiverequestsfrommultipleloadbalancers.
Ifaclusterisservedbymorethanoneloadbalancer,youmustconfiguretheclusterinexactlythesamewayoneachloadbalancer.
Eachsessionistiedtoaparticularcluster.
Therefore,althoughyoucandeployanapplicationonmultipleclusters,sessionfailoverwilloccuronlywithinasinglecluster.
Theclusterthusactsasasafeboundaryforsessionfailoverfortheserverinstanceswithinthecluster.
YoucanusetheloadbalancerandupgradecomponentswithintheApplicationServerwithoutlossofservice.
MoreInformationForinformationaboutplanningahigh-availabilitydeployment,includingassessinghardwarerequirements,planningnetworkconfiguration,andselectingatopology,seeSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2DeploymentPlanningGuide.
Thismanualalsoprovidesahigh-levelintroductiontoconceptssuchas:Applicationservercomponentssuchasnodeagents,domains,andclustersIIOPloadbalancinginaclusterHADBarchitectureMessagequeuefailoverFormoreinformationaboutdevelopinganddeployingapplicationsthattakeadvantageofhighavailabilityfeatures,seeSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2Developer'sGuide.
TuningHighAvailabilityServersandApplicationsForinformationonhowtoconfigureandtuneapplicationsandApplicationServerforbestperformancewithhighavailability,seeSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2PerformanceTuningGuide,whichdiscussestopicssuchas:TuningpersistencefrequencyandpersistencescopeCheckpointingstatefulsessionbeansConfiguringtheJDBCconnectionpoolSessionsizeTuningHADBdiskuse,memoryallocation,performance,andoperatingsystemconfigurationConfiguringloadbalancerforbestperformanceOverviewofHighAvailabilitySunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200726HighAvailabilitySessionPersistenceJ2EEapplicationstypicallyhavesignificantamountsofsessionstatedata.
Awebshoppingcartistheclassicexampleofasessionstate.
Also,anapplicationcancachefrequently-neededdatainthesessionobject.
Infact,almostallapplicationswithsignificantuserinteractionsneedtomaintainsessionstate.
BothHTTPsessionsandstatefulsessionbeans(SFSBs)havesessionstatedata.
Preservingsessionstateacrossserverfailurescanbeimportanttoendusers.
Forhighavailability,theApplicationServerprovidesthecapabilitytopersistsessionstateintheHADB.
Iftheapplicationserverinstancehostingtheusersessionexperiencesafailure,thesessionstatecanberecovered,andthesessioncancontinuewithoutlossofinformation.
Foradetaileddescriptionofhowtosetuphighavailabilitysessionpersistence,seeChapter8,"ConfiguringHighAvailabilitySessionPersistenceandFailover"HighAvailabilitySessionPersistenceChapter1ApplicationServerHighAvailabilityFeatures2728InstallingandSettingUpHighAvailabilityDatabaseThischaptercoversthefollowingtopics:"OverviewofHighAvailabilityDatabase"onpage29"PreparingforHADBSetup"onpage34"Installation"onpage41"SettingupHighAvailability"onpage43"UpgradingHADB"onpage47OverviewofHighAvailabilityDatabaseThissectionintroducesthehighavailabilitydatabase(HADB)anddescribeshowtosetupandconfigureHADBforusewiththeApplicationServer.
Thissectioncontainsthefollowingtopics:"HADBandApplicationServer"onpage29"HADBServerArchitecture"onpage30"HADBNodes"onpage31HADBandApplicationServerHADBisahorizontally-scalabledatabasethatcanberunandmanagedindependentlyoftheapplicationservertier.
Itisdesignedtosupportupto99.
999%serviceanddataavailabilitywithloadbalancing,failover,andstaterecoverycapabilities.
ApplicationServerusesHADBtostoreHTTPandstatefulsessionbean(SFSB)sessiondata.
Withoutasessionpersistencemechanism,theHTTPorSFSBsessionstatedataislostwhenaweborEJBcontainerfailsover.
KeepingstatemanagementseparatefromApplicationServerhassignificantbenefits.
ApplicationServerinstancesspendtheircyclesperformingasascalableandhighperformance2CHAPTER229JavaTM2Platform,EnterpriseEdition(J2EETMplatform)containersdelegatingstatereplicationtoanexternalhighavailabilitystateservice.
Duetothislooselycoupledarchitecture,youcaneasilyaddapplicationserverinstancestoandremoveinstancesfromacluster.
YoucanindependentlyscaleHADBstatereplicationserviceforoptimumavailabilityandperformance.
HADBServerArchitectureHighavailabilitymeansavailabilitydespiteplannedoutagesforupgradesorunplannedoutagescausedbyhardwareorsoftwarefailures.
HADBisbasedonasimpledatamodelandredundant,scalable,andhighperformancetechnology.
HADBoffersanidealplatformfordeliveringalltypesofsessionstatepersistencewithinahighperformanceenterpriseapplicationserverenvironment.
Thefollowingfigureshowsthearchitectureofadatabasewithfouractivenodesandtwosparenodes.
Nodes0and1areamirrornodepair,asarenodes2and3.
HADBachieveshighdataavailabilitythroughfragmentationandreplicationofdata.
Alltablesinthedatabasearepartitionedtocreatesubsetsofapproximatelythesamesizecalledfragments.
Fragmentationisbasedonahashfunctionthatevenlydistributesthedataamongthenodesofthedatabase.
Eachfragmentisstoredtwiceinthedatabase,inmirrornodes.
ThisNode0DRU0Node2Node4SpareNode1DRU1Node3Node5SpareHADBPrimaryfragmentStandbyfragmentFIGURE2–1HADBArchitectureOverviewofHighAvailabilityDatabaseSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200730ensuresfaulttoleranceandfastrecoveryofdata.
Inaddition,ifanodefails,orisshutdown,asparenodecantakeoveruntilthenodeisactiveagain.
HADBnodesareorganizedintotwoDataRedundancyUnits(DRUs),whichmirroreachother.
EachDRUconsistsofhalfoftheactiveandsparenodes,andcontainsonecompletecopyofthedata.
Toensurefaulttolerance,thecomputersthatsupportoneDRUmustbecompletelyself-supportedwithrespecttopower(useofuninterruptiblepowersuppliesisrecommended),processingunits,andstorage.
IfapowerfailureoccursinoneDRU,thenodesintheotherDRUcancontinueservicingrequestsuntilthepowerreturns.
Withoutasessionpersistencemechanism,theHTTPorSFSBsessionstate,includingthepassivatedsessionstate,islostwhenoneweborEJBcontainerfailsovertoanother.
UseoftheHADBforsessionpersistenceovercomesthissituation.
TheHADBstoresandretrievesstateinformationinaseparatebutwell-integratedpersistentstoragetier.
HADBreclaimsspacewhensessiondataisdeleted.
HADBplacessessiondatarecordsinfixedsizeblocks.
Whenallrecordsofablockaredeleted,theblockisfreed.
Recordsofablockcanbedeletedrandomly,creatingholesintheblock.
Whenanewrecordisinsertedintoablockandcontiguousspaceisneeded,theholesareremovedandthustheblockiscompacted.
Thisisabriefsummaryofthearchitecture.
Formoreinformation,seeSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2DeploymentPlanningGuide.
HADBNodesAdatabasenodeconsistsofasetofprocesses,adedicatedareaofsharedmemory,andoneormoresecondarystoragedevices.
Thedatabasestores,updates,andretrievessessiondata.
Eachnodehasamirrornode,thereforenodesoccurinpairs.
Inaddition,tomaximizeavailability,includetwoormoresparenodes,oneineachDRU,soifanodefailsasparecantakeoverwhilethenodeisrepaired.
Foranexplanationofnodetopologyalternatives,seeChapter3,"SelectingaTopology,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2DeploymentPlanningGuide.
NewFeaturesandImprovementsTheversionofHADBprovidedwithSunJavaSystemApplicationServerEnterpriseEdition8.
1hasmanynewfeaturesandimprovements.
HADBmanagementisimprovedbychangingtheunderlyingcomponentsofthemanagementsystem.
Theoldhadbminterfacefunctionsaremaintainedwithminormodifications.
ThesechangesalsoremovethedependencyonSSH/RSH.
Themanagementagentserverprocess(ma)constitutesadomainandkeepsthedatabaseconfigurationinarepository.
Therepositoryinformationisdistributedamongallagents.
OverviewofHighAvailabilityDatabaseChapter2InstallingandSettingUpHighAvailabilityDatabase31Thefollowingtopicsprovidemoredetails:"GeneralImprovements"onpage32"SpecificChanges"onpage32GeneralImprovementsThisversionofHADBhasthefollowinggeneralimprovements:HADBnolongerrequiresSSH/RSH.
AdministratorpasswordforHADBmanagementenhancessecurity.
Automaticonlineupgradetofutureversions.
Dependencyonasinglehostisremoved.
Heterogeneousconfigurationsofthedatabaseissupported.
Thedevicepathsandhistorypathscanbesetindividually.
Abilitytomanagemultipleplatformsuniformly.
SpecificChangesThisversionofHADBincludesthefollowingchangesfromthepreviousversion.
UDPmulticastisnowrequiredfornetworkconfiguration.
Themanagementagent,ma,isnowrequiredtoberunningonallHADBhosts.
Newhadbmcommandsfordomainmanagement:hadbmcreatedomain,hadbmdeletedomain,hadbmextenddomain,hadbmreducedomain,hadbmlistdomain,hadbmdisablehost.
Newcommandsforpackagemanagement:hadbmregisterpackage,hadbmunregisterpackage,hadbmlistpackageAllhadbmcommandshavethefollowingnewoptions:adminpasswordadminpasswordfileno-adminauthenticationagentjavahomeChangesmadetohadbmcreate:Newoptions:no-clearno-cleanuppackagepackagepathagentExtendedoptionsOverviewofHighAvailabilityDatabaseSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200732hosts(registershostsinthedomain).
setOptionsremoved:inetdinetdsetupdirconfigpathinstallpathsetTotalDataDevideSizePerNodesetmanagementProtocolModified:devicesizeisnowoptional,notrequired.
Thehadbmstartnodeandhadbmrestartnodecommands'startleveloptionhasanewvalue,clear.
Changesmadetohadbmaddnodes:Newoptions:set,historypath,devicepath.
Theinetdsetupdiroptionwasremoved.
Changesmadetohadbmgetandhadbmset:Newattributesarehistorypath(heterogeneouspathforhistoryfiles)andpackagename.
Attributeseliminatedare:managementProtocol,TotalDeviceSizePerNode,installpath,andsyslogging.
UsingCustomerSupportforHADBBeforecallingcustomersupportaboutHADBissues,gatherasmuchofthefollowinginformationaspossible:Systemuseprofile:NumberofactiveconcurrentusersNumberofpassiveusersNumberofusersenteringthesystempersecondAveragesessionsizeSessionstatetimeoutperiod(SessionTimeoutvalue)TransactionrateperuserpersecondMachineproperties:RAMNumberofCPUsCPUspeedOperatingsystemversionNumberofphysicaldisksTotaldisksizeAvailablediskspaceOverviewofHighAvailabilityDatabaseChapter2InstallingandSettingUpHighAvailabilityDatabase33DatatransfercapacityNetworkproperties:TransfercapacityNumberofhostnames(networkinterfaces)pernodeHADBdata:Historyfilescfgandmetafiles,locatedindbconfigpath/databasename/nodenodirectory.
dbconfigpathisdefinedinthevariablema.
server.
dbconfigpathinthemanagementagentconfigurationfile.
Versioninformation(hadbm--version)PreparingforHADBSetupThissectiondiscussesthefollowingtopics:"Prerequisites"onpage34"ConfiguringSharedMemoryandSemaphores"onpage38"ConfiguringNetworkRedundancy"onpage35"SynchronizingSystemClocks"onpage40"FileSystemSupport"onpage40Afterperformingthesetasks,seeChapter3,"AdministeringHighAvailabilityDatabase.
"ForthelatestinformationonHADB,seeSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2ReleaseNotes.
PrerequisitesBeforesettingupandconfiguringHADB,makesureyourenvironmentmeetsthefollowingrequirements:IPv4isenabled.
HADBsupportsIPv4only.
DisableIPv6ontheinterfacesbeingusedforHADB.
Thenetwork(routers,switches,andnetworkinterfacesonthehosts)mustbeconfiguredforUserDatagramProtocol(UDP)multicast.
IfHADBhostsspanmultiplesubnets,configureroutersbetweenthesubnetstoforwardUDPmulticastmessagesbetweenthesubnets.
ConfigureanyfirewallslocatedbetweenHADBhosts,orbetweenHADBandApplicationServerhoststoallowallUDPtraffic,bothordinaryandmulticast.
PreparingforHADBSetupSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200734DonotusedynamicIPaddresses(assignedbyDynamicHostConfigurationProtocol,orDHCP)forhoststhatarepartofhadbmcreatedomain,hadbmextenddomain,hadbmcreate,orhadbmaddnodescommands.
ConfiguringNetworkRedundancyConfiguringaredundantnetworkwillenableHADBtoremainavailable,evenifthereisasinglenetworkfailure.
Youcanconfigurearedundantnetworkintwoways:OnSolaris9,youcansetupnetworkmultipathing.
Configureadoublenetwork,supportedonallplatformsexceptWindowsServer2003.
SettingUpNetworkMultipathingBeforesettingupnetworkmultipathing,refertotheAdministeringNetworkMultipathingsectionintheIPNetworkMultipathingAdministrationGuide.
ToconfigureHADBhostmachinesthatalreadyuseIPmultipathing:Setnetworkinterfacefailuredetectiontime.
ForHADBtoproperlysupportmultipathingfailover,thenetworkinterfacefailuredetectiontimemustnotexceedonesecond(1000milliseconds),asspecifiedbytheFAILURE_DETECTION_TIMEparameterin/etc/default/mpathd.
Editthefileandchangethevalueofthisparameterto1000iftheoriginalvalueishigher:FAILURE_DETECTION_TIME=1000Toputthechangeintoeffect,usethiscommand:pkill-HUPin.
mpathdSetupIPaddressestousewithHADB.
AsdescribedintheIPNetworkMultipathingAdministrationGuide,multipathinginvolvesgroupingphysicalnetworkinterfacesintomultipathinterfacegroups.
EachphysicalinterfaceinsuchagrouphastwoIPaddressesassociatedwithit:aphysicalinterfaceaddressusedfortransmittingdata.
atestaddressforSolarisinternaluseonly.
Specifyonlyonephysicalinterfaceaddressfromthemultipathgroupwhenyouusehadbmcreate--hosts.
12PreparingforHADBSetupChapter2InstallingandSettingUpHighAvailabilityDatabase35SettingupMultipathingSupposetherearetwohostmachinesnamedhost1andhost2.
Iftheyeachhavetwophysicalnetworkinterfaces,thensetupthetwointerfacesasamultipathgroup.
Runifconfig-aoneachhost.
Theoutputonhost1is:bge0:flags=1000843mtu1500index5inet129.
159.
115.
10netmaskffffff00broadcast129.
159.
115.
255groupnamemp0bge0:1:flags=9040843mtu1500index5inet129.
159.
115.
11netmaskffffff00broadcast129.
159.
115.
255bge1:flags=1000843mtu1500index6inet129.
159.
115.
12netmaskffffff00broadcast129.
159.
115.
255groupnamemp0bge1:1:flags=9040843mtu1500index6inet129.
159.
115.
13netmaskff000000broadcast129.
159.
115.
255Theoutputonhost2is:bge0:flags=1000843mtu1500index3inet129.
159.
115.
20netmaskffffff00broadcast129.
159.
115.
255groupnamemp0bge0:1:flags=9040843mtu1500index3inet129.
159.
115.
21netmaskff000000broadcast129.
159.
115.
255bge1:flags=1000843mtu1500index4inet129.
159.
115.
22netmaskffffff00broadcast129.
159.
115.
255groupnamemp0bge1:1:flags=9040843mtu1500index4inet129.
159.
115.
23netmaskff000000broadcast129.
159.
115.
255Inthisexample,thephysicalnetworkinterfacesonbothhostsarelistedafterbge0andbge1.
Thoselistedafterbge0:1andbge1:1aremultipathtestinterfaces(markedDEPRECATEDintheifconfigoutput),asdescribedintheIPNetworkMultipathingAdministrationGuide.
TosetupHADBinthisenvironment,selectonephysicalinterfaceaddressfromeachhost.
Inthisexample,HADBusesIPaddress129.
159.
115.
10fromhost1and129.
159.
115.
20fromhost2.
Tocreateadatabasewithonedatabasenodeperhost,usethecommandhadbmcreate--host.
Forexamplehadbmcreate--host129.
159.
115.
10,129.
159.
115.
20Example2–1PreparingforHADBSetupSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200736Tocreateadatabasewithtwodatabasenodesoneachhost,usethecommand:hadbmcreate--host129.
159.
115.
10,129.
159.
115.
20,129.
159.
115.
10,129.
159.
115.
20Inbothcases,youmustconfiguretheagentsonhost1andhost2withseparateparameterstospecifywhichinterfaceonthemachinestheagentsshoulduse.
So,onhost1use:ma.
server.
mainternal.
interfaces=129.
159.
115.
10Andonhost2use:ma.
server.
mainternal.
interfaces=129.
159.
115.
20Forinformationonthema.
server.
mainternal.
interfacesvariable,see"ConfigurationFile"onpage53.
ConfiguringDoubleNetworksToenableHADBtotoleratesinglenetworkfailures,useIPmultipathingiftheoperatingsystem(forexample,Solaris)supportsit.
DonotconfigureHADBwithdoublenetworksonWindowsServer2003—theoperatingsystemdoesnotworkproperlywithdoublenetworks.
IfyouroperatingsystemisnotconfiguredforIPmultipathing,andHADBhostsareequippedwithtwoNICs,youcanconfigureHADBtousedoublenetworks.
Foreveryhost,theIPaddressesofeachofthenetworkinterfacecard(NIC)mustbeonseparateIPsubnets.
Withinadatabase,allnodesmustbeconnectedtoasinglenetwork,orallnodesmustbeconnectedtotwonetworks.
Note–RoutersbetweenthesubnetsmustbeconfiguredtoforwardUDPmulticastmessagesbetweensubnets.
WhencreatinganHADBdatabase,usethe–hostsoptiontospecifytwoIPaddressesorhostnamesforeachnode:oneforeachNICIPaddress.
Foreachnode,thefirstIPaddressisonnet-0andthesecondonnet-1.
Thesyntaxisasfollows,withhostnamesforthesamenodeseparatedbyaplussign(+):--hosts=node0net0name+node0net1name,node1net0name+node1net1name,node2net0name+node2net1name,.
.
.
Forexample,thefollowingargumentcreatestwonodes,eachwithtwonetworkinterfaces.
Thefollowinghostoptionisusedtocreatethesenodes:PreparingforHADBSetupChapter2InstallingandSettingUpHighAvailabilityDatabase37--hosts10.
10.
116.
61+10.
10.
124.
61,10.
10.
116.
62+10.
10.
124.
62Thus,thenetworkaddressesFornode0are10.
10.
116.
61and10.
10.
124.
61Fornode1are10.
10.
116.
62and10.
10.
124.
62Noticethat10.
10.
116.
61and10.
10.
116.
62areonthesamesubnet,and10.
10.
124.
61and10.
10.
124.
62areonthesamesubnet.
Inthisexample,themanagementagentsmustusethesamesubnet.
Thus,theconfigurationvariablema.
server.
mainternal.
interfacesmustbesetto,forexample,10.
10.
116.
0/24.
Thissettingcanbeusedonbothagentsinthisexample.
ConfiguringSharedMemoryandSemaphoresYoumustconfiguresharedmemoryandsemaphoresbeforeinstallingHADB.
Theproceduredependsonyouroperatingsystem.
ToconfiguresharedmemoryandsemaphoresonSolarisLoginasroot.
Configuresharedmemeory.
SetthevalueofshmmaxtothesizeofthephysicalmemoryontheHADBhostmachine.
ThemaximumsharedmemorysegmentsizemustbelargerthanthesizeoftheHADBdatabasebufferpool.
Forexample,foramachinewitha2GByte(0x8000000hexadecimal)mainmemory,addthefollowingtothe/etc/systemfile:setshmsys:shminfo_shmmax=0x80000000setshmsys:shminfo_shmseg=20OnSolaris9andlater,shmsys:shminfo_shmsegisobsolete.
Setshminfo_shmmaxtothetotalmemoryinyoursystem(inhexadecimalnotationthevalue0x80000000shownisfor2Gigabytesofmemory).
Note–Specifythevalueofshmsys:shminfo_shmmaxusingthehexadecimalvalueforthememorysize.
Todetermineyourhost'smemory,usethiscommand:prtconf|grepMemory12PreparingforHADBSetupSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200738Configuresemaphores.
Checkthe/etc/systemfileforsemaphoreconfigurationentries.
Thisfilemightalreadycontainsemmni,semmns,andsemmnuentries.
Forexample:setsemsys:seminfo_semmni=10setsemsys:seminfo_semmns=60setsemsys:seminfo_semmnu=30Iftheentriesarepresent,incrementthevaluesbyadding16,128,and1000respectively.
So,theentriesintheexampleabovewouldchangeto:setsemsys:seminfo_semmni=26setsemsys:seminfo_semmns=188setsemsys:seminfo_semmnu=1030Ifthe/etc/systemfiledoesnottheseentries,addthemattheendofthefile:setsemsys:seminfo_semmni=16setsemsys:seminfo_semmns=128setsemsys:seminfo_semmnu=1000Thisissufficienttorunupto16HADBnodesonthecomputer.
Forinformationonsetupformorethan16nodes,seetheHADBchapterintheSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q1PerformanceTuningGuide.
Rebootthemachine.
ToconfiguresharedmemoryonLinuxLoginasroot.
Editthefile/etc/sysctl.
confSetthekernel.
shmaxandkernel.
shmallparameters.
Thekernel.
shmaxparameterdefinesthemaximumsizeinbytesforasharedmemorysegment.
Thekernel.
shmallparametersetsthetotalamountofsharedmemoryinpagesthatcanbeusedatonetimeonthesystem.
Setthevalueofbothoftheseparameterstotheamountphysicalmemoryonthemachine.
Specifythevalueasadecimalnumberofbytes.
Forexample,foramachinehaving512Mbytesofphysicalmemory:kernel.
shmmax=536870912kernel.
shmall=536870912Rebootthemachine.
usingthiscommand:sync;sync;reboot341234PreparingforHADBSetupChapter2InstallingandSettingUpHighAvailabilityDatabase39ProcedureforWindowsWindowsdoesnotrequireanyspecialsystemsettings.
However,ifyouwanttouseanexistingJ2SEinstallation,settheJAVA_HOMEenvironmentvariabletothelocationwheretheJ2SEisinstalled.
SynchronizingSystemClocksYoumustsynchronizeclocksonHADBhosts,becauseHADBusestimestampsbasedonthesystemclock.
HADBusesthesystemclocktomanagetimeoutsandtotimestampeventsloggedtohistoryfiles.
Fortroubleshooting,youmustanalyzeallthehistoryfilestogether,sinceHADBisadistributedsystem.
So,itisimportantthatallthehosts'clocksbesynchronizedDonotadjustsystemclocksonarunningHADBsystem.
DoingsocancauseproblemsintheoperatingsystemorothersoftwarecomponentsthatcaninturncauseproblemssuchashangsorrestartsofHADBnodes.
AdjustingtheclockbackwardcancausesomeHADBserverprocessestohangastheclockisadjusted.
Tosynchronizeclocks:OnSolaris,usexntpd(networktimeprotocoldaemon).
OnLinux,usentpd.
OnWindows,useNTPTimeonWindowsIfHADBdetectsaclockadjustmentofmorethanonesecond,itlogsittothenodehistoryfile,forexample:NSUPINF2003-08-2617:46:47.
975Clockadjusted.
Leapis+195.
075046seconds.
FileSystemSupportThissectiondescribessomerestrictionsofHADBwithcertainfilesystems.
RedHatEnterpriseLinuxHADBsupportstheext2andext3filesystemsonRedHatEnterpriseLinux3.
0.
ForRedHatEnterpriseLinux2.
1,HADBsupportstheext2filesystem.
VeritasFileSystemWhenusingtheVeritasFileSystemonSolaris,HADBwritesthemessageWRN:DirectdiskI/Omappingfailedtothehistoryfiles.
ThismessageindicatesthatHADBcannotturnondirectinput/output(I/O)forthedataandlogdevices.
DirectI/OreducestheCPUcostofwritingdiskpages.
Italsoreducesoverheadofadministering"dirty"datapagesintheoperatingsystem.
PreparingforHADBSetupSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200740TousedirectI/OwithVeritasFileSystem,dooneofthefollowing:Createthedataandlogdevicesonafilesystemthatismountedwiththeoptionmincache=direct.
Thisoptionappliestoallfilescreatedonthefilesystem.
Checkthemount_vxfs(1M)commandfordetails.
UsetheVeritasQuickI/OfacilitytoperformrawI/Otofilesystemfiles.
Fordetails,seetheVERITASFileSystem4.
0Administrator'sGuideforSolaris.
Note–TheseconfigurationshavenotbeentestedwiththeSunJavaSystemApplicationServer.
InstallationIngeneral,youcaninstallHADBonthesamesystemasApplicationServer(co-locatedtopology)oronseparatehosts(separatetiertopology).
Formoreinformationonthesetwooptions,seeChapter3,"SelectingaTopology,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2DeploymentPlanningGuide.
However,youmustinstalltheHADBmanagementclienttobeabletosetuphighavailabilitywiththeasadminha-config-clustercommand.
WhenusingtheJavaEnterpriseSysteminstaller,youmustinstallanentireHADBinstancetoinstallthemanagementclient,evenifthenodesaretobeinstalledonaseparatetier.
HADBInstallationOnasingleordualCPUsystem,youcaninstallbothHADBandApplicationServerifthesystemhasatleasttwoGbytesofmemory.
Ifnot,installHADBonaseparatesystemoruseadditionalhardware.
Tousetheasadminha-configure-clustercommand,youmustinstallbothHADBandApplicationServer.
EachHADBnoderequires512Mbytesofmemory,soamachineneedsoneGbyteofmemorytoruntwoHADBnodes.
Ifthemachinehaslessmemory,setupeachnodeonadifferentmachine.
Forexample,youcaninstalltwonodeson:Twosingle-CPUsystems,eachwith512MbytestooneGbyteofmemoryAsingleordualCPUsystemwithoneGbytetotwoGbytesofmemoryYoucaninstallHADBwitheithertheJavaEnterpriseSysteminstallerortheApplicationServerstandaloneinstaller.
Ineitherinstaller,choosetheoptiontoinstallHADB(calledHighAvailabilitySessionStoreinJavaES)intheComponentSelectionpage.
Completetheinstallationonyourhosts.
IfyouareusingtheApplicationServerstandaloneinstaller,andchoosetwoseparatemachinestorunHADB,youmustchooseanidenticalinstallationdirectoryonbothmachines.
InstallationChapter2InstallingandSettingUpHighAvailabilityDatabase41DefaultInstallationDirectoriesThroughoutthismanual,HADB_install_dirrepresentsthedirectoryinwhichHADBisinstalled.
ThedefaultinstallationdirectorydependsonwhetheryouinstallHADBaspartoftheJavaEnterpriseSystem.
ForJavaEnterpriseSystem,thedefaultinstallationdirectoryis/opt/SUNWhadb/4.
ForthestandaloneApplicationServerinstaller,itis/opt/SUNWappserver/hadb/4.
NodeSupervisorProcessesPrivilegesThenodesupervisorprocesses(NSUP)ensuretheavailabilityofHADBbyexchanging"I'malive"messageswitheachother.
TheNSUPexecutablefilesmusthaverootprivilegessotheycanrespondasquicklyaspossible.
Theclu_nsup_srvprocessdoesnotconsumesignificantCPUresources,hasasmallfootprint,andsorunningitwithreal-timeprioritydoesnotaffectperformance.
Note–TheJavaEnterpriseSysteminstallerautomaticallysetstheNSUPprivilegesproperly,soyoudonotneedtotakeanyfurtheraction.
However,withthestandaloneApplicationServer(non-root)installer,youmustsettheprivilegesmanuallybeforecreatingadatabase.
SymptomsofInsufficientPrivilegesIfNSUPexecutablesdonothavetheproperprivileges,youmightnoticesymptomsofresourcestarvationsuchas:PerformanceissuesorHIGHLOADmessagesintheHADBhistorylog.
Falsenetworkpartitioningandnoderestarts,precededbyawarning"Processblockedforxseconds"inHADBhistoryfiles.
Abortedtransactionsandotherexceptions.
RestrictionsIfNSUPcannotsetthereal-timepriorityerrnoissettoEPERMonSolarisandLinux.
OnWindowsitissuesthewarning"Couldnotsetrealtimepriority".
Theerroriswrittentothema.
logfile,andtheprocesscontinueswithoutreal-timepriority.
Settingreal-timeprioritiesisnotpossiblewhen:HADBisinstalledinSolaris10non-globalzonesPRIV_PROC_LOCK_MEMORY(allowaprocesstolockpagesinphysicalmemory)and/orPRIV_PROC_PRIOCNTLprivilegesarerevokedinSolaris10UsersturnoffsetuidpermissionUsersinstallthesoftwareastarfiles(thenon-rootinstallationoptionfortheApplicationServer)InstallationSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200742ToGiveNodeSupervisorProcessesRootPrivilegesLoginasroot.
ChangeyourworkingdirectorytoHADB_install_dir/lib/server.
TheNSUPexecutablefileisclu_nsup_srv.
Setthefile'ssuidbitwiththiscommand:chownrootclu_nsup_srvSetthefile'sownershiptorootwiththiscommand:chmodu+sclu_nsup_srvThisstartstheclu_nsup_srvprocessasroot,andenablestheprocesstogiveitselfrealtimepriority.
Toavoidanysecurityimpact,thereal-timepriorityissetimmediatelyaftertheprocessisstartedandtheprocessfallsbacktotheeffectiveUIDoncethepriorityhasbeenchanged.
OtherHADBprocessesrunwithnormalpriority.
SettingupHighAvailabilityThissectionprovidesthestepsforcreatingahighlyavailablecluster,andtestingHTTPsessionpersistence.
Thissectiondiscussesthefollowingtopics:"Prerequisites"onpage34"StartingtheHADBManagementAgent"onpage44"ConfiguringaClusterforHighAvailability"onpage46"ConfiguringanApplicationforHighAvailability"onpage46"RestartingtheCluster"onpage46PrerequisitesBeforeconfiguringHADB,dothefollowing:ToprepareyoursystemforHighAvailabilityInstallApplicationServerinstancesandtheLoadBalancerPlug-in.
Formoreinformation,seetheJavaEnterpriseSystemInstallationGuide(ifyouareusingJavaES)orSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2InstallationGuide(ifyouareusingthestandaloneApplicationServerinstaller).
12341SettingupHighAvailabilityChapter2InstallingandSettingUpHighAvailabilityDatabase43CreateApplicationServerdomainsandclusters.
Formoreinformation,seetheSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
Installandconfigureyourwebserversoftware.
Formoreinformation,see"ConfiguringWebServersforLoadBalancing"onpage107Setupandconfigureloadbalancing.
Formoreinformation,see"SettingUpHTTPLoadBalancing"onpage105.
StartingtheHADBManagementAgentThemanagementagent,ma,executesmanagementcommandsonHADBhostsandensuresavailabilityoftheHADBnodesupervisorprocessesbyrestartingthemiftheyfail.
Foraproductiondeployment,startthemanagementagentasaservicetoensureitsavailability.
Thissectionprovidesabbreviatedinstructionsforstartingthemanagementagentasaservicewithitsdefaultconfiguration.
Formoredetails,includinginstructionsonstartingthemanagementagentinconsolemodefortestingorevaluationandinformationoncustomizingitsconfiguration,see"UsingtheHADBManagementAgent"onpage51.
ThissectiondescribeshowtostartthemanagementagentasaservicewithdefaultconfigurationwhenusingJavaEnterpriseSystem.
ToStarttheManagementAgentwithJavaEnterpriseSystemonSolarisorLinuxCreatethefollowingsoftlinkstothefile/etc/init.
d/ma-initd:/etc/rc0.
d/K20ma-initd/etc/rc1.
d/K20ma-initd/etc/rc2.
d/K20ma-initd/etc/rc3.
d/S99ma-initd/etc/rc5.
d/S99ma-initd/etc/rcS.
d/K20ma-initdRebootthemachine.
Todeactivateautomaticstartandstopoftheagent,removethelinksorchangethelettersKandSinthelinknamestolowercase.
23412SettingupHighAvailabilitySunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200744ToStarttheManagementAgentwithJavaEnterpriseSystemonWindowsOpenacommandwindow.
Enterthecommand:HADB_install_dir\bin\ma-i.
Thisinstallsandstartsthemanagementagentwithitsdefaultconfiguration.
Tostopthemanagementagentandremove(deregister)itasaservice,usethecommand:HADB_install_dir\bin\ma-rToStarttheManagementAgentwithStandaloneApplicationServeronSolarisorLinuxInashell,changeyourcurrentdirectorytoHADB_install_dir/bin.
Edittheshellscriptma-initd.
ReplacethedefaultvaluesofHADB_ROOTandHADB_MA_CFGinthescripttoreflectyourinstallation:HADB_ROOTistheHADBinstallationdirectory,HADB_install_dir.
HADB_MA_CFGisthelocationofthemanagementagentconfigurationfile.
Formoreinformation,see"CustomizingManagementAgentConfiguration"onpage53Copyma-initdtothedirectory/etc/init.
dCreatethefollowingsoftlinkstothefile/etc/init.
d/ma-initd:/etc/rc0.
d/K20ma-initd/etc/rc1.
d/K20ma-initd/etc/rc2.
d/K20ma-initd/etc/rc3.
d/S99ma-initd/etc/rc5.
d/S99ma-initd/etc/rcS.
d/K20ma-initdToStarttheManagementAgentwithStandaloneApplicationServeronWindowsOpenacommandwindow.
Enterthecommand:HADB_install_dir\bin\ma-ima.
cfgNowiftheprocessfailsorthemachinereboots,themanagementagentwillautomaticallyrestart.
12NextSteps123412SettingupHighAvailabilityChapter2InstallingandSettingUpHighAvailabilityDatabase45Tostopthemanagementagentandremove(deregister)itasaservice,usethecommand:HADB_install_dir\bin\ma-rma.
cfgConfiguringaClusterforHighAvailabilityBeforestartingthissection,youmusthavecreatedoneormoreApplicationServerclusters.
Forinformationonhowtocreateacluster,see"ToCreateaCluster"onpage136.
FromthemachineonwhichtheDomainAdministrationServerisrunning,configuretheclustertouseHADBusingthiscommand:asadminconfigure-ha-cluster--useradmin--hostshadb_hostname,hadb_hostname--devicesize256clusterNameReplacehadb_hostnamewiththehostnameofthemachinewhereHADBisrunning,andclusterNamewiththenameofthecluster.
Ifyouareusingjustonemachine,youmustprovidethehostnametwice.
ThissimplifiedexamplerunstwonodesofHADBonthesamemachine.
Inproductionsettings,usingmorethanonemachineisrecommended.
ConfiguringanApplicationforHighAvailabilityInAdminConsole,selecttheapplicationunderApplications>EnterpriseApplications.
SetAvailabilityEnabledandthenclickSave.
RestartingtheClusterTorestartaclusterinAdminConsole,chooseClusters>cluster-name.
ClickStopInstances.
Oncetheinstanceshavestopped,click"StartInstances.
"Alternatively,usetheseasadmincommands:asadminstop-cluster--useradmincluster-nameasadminstart-cluster--useradmincluster-nameFormoreinformationonthesecommands,seestop-cluster(1)andstart-cluster(1).
RestartingtheWebServerTorestarttheWebServer,typethisWebServercommand:web_server_root/https-hostname/reconfigNextStepsSettingupHighAvailabilitySunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200746Replaceweb_server_rootwithyourWebServerrootdirectoryandhostnamewiththenameofyourhostmachine.
ToCleanUptheWebServerInstanceActingasLoadBalancerDeletetheLoadBalancerconfiguration:asadmindelete-http-lb-ref--useradmin--configMyLbConfigFirstClusterasadmindelete-http-lb-config--useradminMyLbConfigIfyoucreatedanewWebServerinstanceyoucandeleteitby:a.
LogontotheWebServer'sAdministrationConsole.
b.
Stoptheinstance.
Deletetheinstance.
UpgradingHADBHADBisdesignedtoprovide"alwayson"servicethatisuninterruptedbyupgradingthesoftware.
ThissectiondescribeshowtoupgradetoanewversionofHADBwithouttakingthedatabaseofflineorincurringanylossofavaiability.
ThefollowingsectionsdescribehowtoupgradeyourHADBinstallation:"ToupgradeHADBtoanewerversion"onpage47"RegisteringHADBPackages"onpage48"UnregisteringHADBPackages"onpage49"ReplacingtheManagementAgentStartupScript"onpage50ToupgradeHADBtoanewerversionInstallnewversionofHADB.
UnregisteryourexistingHADBinstallationasdescribedin"UnregisteringHADBPackages"onpage491212UpgradingHADBChapter2InstallingandSettingUpHighAvailabilityDatabase47RegisterthenewHADBversion,asdescribedin"RegisteringHADBPackages"onpage48RegisteringtheHADBpackageintheHADBmanagementdomainmakesiteasytoupgradeorchangeHADBpackages.
Themanagementagentkeepstrackofwherethesoftwarepackagesarelocated,aswellastheversioninformationforthehostsinthedomain.
ThedefaultpackagenameisastringstartingwithVandcontainingtheversionnumberofthehadbmprogram.
Changethepackagethedatabaseuses.
Enterthefollowingcommand:hadbmsetPackageName=packagewherepackageistheversionnumberofthenewHADBpacakge.
Ifneccessary,replacethemanagementagentstartupscript.
Formoreinformation,see"ReplacingtheManagementAgentStartupScript"onpage50RegisteringHADBPackagesUsethehadbmregisterpackagecommandtoregistertheHADBpackagesthatareinstalledonthehostsinthemanagementdomain.
HADBpackagescanalsoberegisteredwhencreatingadatabasewithhadbmcreate.
Beforeusingthehadmregisterpackagecommand,ensurethatallmanagementagentsareconfiguredandrunningonallthehostsinthehostlist,themanagementagent'srepositoryisavailableforupdates,andnosoftwarepackageisalreadyregisteredwiththesamepackagename.
Thecommandsyntaxis:hadbmregisterpackage--packagepath=path[--hosts=hostlist][--adminpassword=password|--adminpasswordfile=file][--agent=maurl][[package-name]]Thepackage-nameoperandisthenameofthepackage.
Thefollowingtabledescribesthespecialhadbmregisterpackagecommandoption.
See"SecurityOptions"onpage60and"GeneralOptions"onpage61foradescriptionofothercommandoptions.
345UpgradingHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200748TABLE2–1hadbmregisterpackageOptionsOptionDescription--hosts=hostlist-HListofhosts,eithercomma-separatedorenclosedindoublequotesandspaceseparated.
--packagepath=path-LPathtotheHADBsoftwarepackage.
Forexample,thefollowingcommandregisterssoftwarepackagev4onhostshost1,host2,andhost3:hadbmregisterpackage--packagepath=hadb_install_dir/SUNWHadb/4.
4--hosts=host1,host2,host3v4Theresponseis:Packagesuccessfullyregistered.
Ifyouomitthe--hostsoption,thecommandregistersthepackageonallenabledhostsinthedomain.
UnregisteringHADBPackagesUsethehadbmunregisterpackagecommandtoremoveHADBpackagesthatareregisteredwiththemanagementdomain.
Beforeusingthehadbmunregisterpackagecommand,ensurethatallmanagementagentsareconfiguredandrunningonallthehostsinthehostlist,themanagementagent'srepositoryisavailableforupdates,thepackageisregisteredinthemanagementdomain,andnoexistingdatabasesareconfiguredtorunonthepackageabouttobeunregistered.
Thecommandsyntaxis:hadbmunregisterpackage--hosts=hostlist[--adminpassword=password|--adminpasswordfile=file][--agent=maurl][package-name]Thepackage-nameoperandisthenameofthepackage.
UpgradingHADBChapter2InstallingandSettingUpHighAvailabilityDatabase49See"RegisteringHADBPackages"onpage48aboveforadescriptionofthe--hostsoption.
Ifyouomitthe--hostsoption,thehostlistdefaultstotheenabledhostswherethepackageisregistered.
See"SecurityOptions"onpage60and"GeneralOptions"onpage61foradescriptionofothercommandoptions.
EXAMPLE2–2ExampleofunregisteringHADBTounregistersoftwarepackagev4fromspecifichostsinthedomain:hadbmunregisterpackage--hosts=host1,host2,host3v4Theresponseis:Packagesuccessfullyunregistered.
ReplacingtheManagementAgentStartupScriptWhenyouinstallanewversionofHADB,youmayneedtoreplacethemanagementagentstartupscriptin/etc/init.
d/ma-initd.
Checkthecontentsofthefile,HADB_install_dir/lib/ma-initd.
Ifitisdifferentfromtheoldma-initdfile,replacetheoldfilewiththenewfile.
UpgradingHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200750AdministeringHighAvailabilityDatabaseThischapterdescribesthehighavailabilitydatabase(HADB)intheSunJavaSystemApplicationServerEnterpriseEditionenvironment.
ItexplainshowtoconfigureandadministertheHADB.
BeforeyoucancreateandadministertheHADB,youmustfirstdeterminethetopologyofyoursystemsandinstalltheHADBsoftwareonthevariousmachines.
Thischapterdiscussesthefollowingtopics:"UsingtheHADBManagementAgent"onpage51"UsingthehadbmManagementCommand"onpage59"ConfiguringHADB"onpage64"ManagingHADB"onpage78"ExpandingHADB"onpage87"MonitoringHADB"onpage92"MaintainingHADBMachines"onpage99UsingtheHADBManagementAgentThemanagementagent,ma,executesmanagementcommandsonHADBhosts.
ThemanagementagentalsoensuresavailabilityoftheHADBnodesupervisorprocessesbyrestartingthemiftheyfail.
"ManagementAgentCommandSyntax"onpage51"CustomizingManagementAgentConfiguration"onpage53"StartingtheManagementAgent"onpage54ManagementAgentCommandSyntaxThesyntaxofthemanagementagentmacommandis:3CHAPTER351ma[common-options][service-options]config-fileWhere:common-optionsisoneormoreofthecommonoptionsdescribedin"ManagementAgentCommandSyntax"onpage51.
service-optionsisoneoftheWindowsserviceoptionsdescribedin"ManagementAgentCommandSyntax"onpage51.
config-fileisthefullpathtothemanagementagentconfigurationfile.
Formoreinformation,see"CustomizingManagementAgentConfiguration"onpage53.
TABLE3–1ManagementAgentCommonOptionsOptionDescriptionDefault--definename=value-DAssignvaluetopropertyname,wherepropertyisoneofthepropertiesdefinedin"ConfigurationFile"onpage53.
Thisoptioncanberepeatedmultipletimes.
None--help-Displayhelpinformation.
False--javahomepath-jUseJavaRuntimeEnvironment(1.
4orlater)locatedatpath.
None--systemrootpath-yPathtotheoperatingsystemrootasnormallysetin%SystemRoot%.
None--version-VDisplayversioninformation.
False"ManagementAgentCommandSyntax"onpage51describesoptionsforstartingthemanagementagentasaWindowsservice.
The-i,-r,and-soptionsaremutuallyexclusive;thatis,useonlyoneofthematatime.
OnWindows,whenspecifyingpathsforpropertyvaluesintheconfigurationfileoronthecommandline,escapefilepathscontainingspaceswithdoublequotes(").
Escapecolon(:)driveseparators,,andbackslash(\)directoryseparators,withdoublequotesandabackslash,likethis:"\:and"\\.
TABLE3–2ManagementAgentServiceOptions(WindowsOnly)OptionDescriptionDefault--install-iInstalltheagentasaWindowsserviceandstarttheservice.
Useonlyoneof-i,-r,and-soptions.
False--nameservicename-nUsespecifiednamefortheservicewhenrunningmultipleagentsonahost.
HADBMgmtAgentUsingtheHADBManagementAgentSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200752TABLE3–2ManagementAgentServiceOptions(WindowsOnly)(Continued)OptionDescriptionDefault--remove-rStoptheserviceanddeletetheagentfromtheWindowsservicemanger.
Useonlyoneof-i,-r,and-soptions.
False--service-sRuntheagentasaWindowsservice.
Useonlyoneof-i,-r,and-soptions.
FalseCustomizingManagementAgentConfigurationHADBincludesaconfigurationfilethatyoucanusetocustomizethemanagementagentsettings.
Whenyoustartthemanagementagentwithoutspecifyingaconfigurationfile,itusesdefaultvalues.
Ifyouspecifyaconfigurationfile,themanagementagentwillusethesettingsinthatfile.
Youcanre-usetheconfigurationfileonallhostsinadomain.
TocustomizethemanagementagentconfigurationoneachHADBhostEditthemanagementagentconfigurationfileandsetthevaluesasdesired.
Startthemanagementagent,specifyingthecustomizedconfigurationfileastheargument.
ConfigurationFileWithJavaEnterpriseSystem,alltheentriesintheconfigurationfilearecommentedout.
Nochangesarerequiredtousethedefaultconfiguration.
Tocustomizethemanagementagentconfiguration,removethecommentsfromthefile,changethevaluesasdesired,thenstartthemanagementagentspecifyingtheconfigurationfileasanargument.
Themanagementagentconfigurationfileisinstalledto:SolarisandLinux:/etc/opt/SUNWhadb/mgt.
cfg.
Windows:install_dir\lib\mgt.
cfg.
Withthestandaloneinstaller,themanagementagentconfigurationfileisinstalledto:SolarisandLinux:HADB_install_dir/bin/ma.
cfg.
Windows:HADB_install_dir\bin\ma.
cfg.
Thefollowingtabledescribesthesettingsintheconfigurationfile.
12UsingtheHADBManagementAgentChapter3AdministeringHighAvailabilityDatabase53TABLE3–3ConfigurationFileSettingsSettingNameDescriptionDefaultconsole.
loglevelConsoleloglevel.
ValidvaluesareSEVERE,ERROR,WARNING,INFO,FINE,FINER,FINESTWARNINGlogfile.
loglevelLogfileloglevel.
ValidvaluesareSEVERE,ERROR,WARNING,INFO,FINE,FINER,FINESTINFOlogfile.
nameNameandlocationoflogfile.
Mustbeavalidpathwithread/writeaccess.
SolarisandLinux:/var/opt/SUNWhadb/ma/ma.
logWindows:HADB_install_dir\ma.
logma.
server.
typeClientprotocol.
OnlyJMXMPissupported.
jmxmpma.
server.
jmxmp.
portPortnumberforinternal(UDP)andexternal(TCP)communication.
Mustbeapositiveinteger.
Recommendedrangeis1024-49151.
1862ma.
server.
mainternal.
interfacesInterfacesforinternalcommunicationformachineswithmultipleinterfaces.
MustbeavalidIPv4addressmask.
AllmanagementagentsinadomainmustusethesamesubnetForexample,ifahosthastwointerfaces,10.
10.
116.
61and10.
10.
124.
61,use10.
10.
116.
0/24tousethefirstinterface.
Thenumberaftertheslashindicatesthenumberofbitsinthesubnetmask.
Nonema.
server.
dbdevicepathPathtostoreHADBdeviceinformation.
SolarisandLinux:/var/opt/SUNWhadb/4Windows:HADB_install_dir\devicema.
server.
dbhistorypathPathtostoreHADBhistoryfiles.
SolarisandLinux:/var/opt/SUNWhadbWindows:REPLACEDIR(replacedbytheactualURLatruntime.
)ma.
server.
dbconfigpathPathtostorenodeconfigurationdata.
SolarisandLinux:/var/opt/SUNWhadb/dbdefWindows:C:\Sun\SUNWhadb\dbdefrepository.
dr.
pathPathtodomainrepositoryfiles.
SolarisandLinux:/var/opt/SUNWhadb/repositoryWindows:C:\Sun\SUNWhadb\repositoryStartingtheManagementAgentYoucanstartthemanagementagenttwoways:UsingtheHADBManagementAgentSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200754Asaservice,forproductionuse.
See"StartingtheManagementAgentasaService"onpage55Toensureavailabilityofthemanagementagent,makesureitisrestartedautomaticallywhenthesystemreboots.
See"EnsuringAutomaticRestartoftheManagementAgent"onpage56.
Asaregularprocess(inconsolemode),forevaluation,testing,ordevelopment.
See"StartingtheManagementAgentinConsoleMode"onpage58.
Ineachcase,theproceduresaredifferentdependingonwhetheryouareusingJavaEnterpriseSystemorthestandaloneApplicationServer.
StartingtheManagementAgentasaServiceStartingthemanagementagentasaserviceensuresthatitwillcontinuetorununtilthesystemshutsdownoryouexplicitlystopit.
StartingtheManagementAgentasaServicewithJavaEnterpriseSystemonSolarisorLinuxTostartthemanagementagentasaservice,usethiscommand:/etc/init.
d/ma-initdstartTostoptheservice,usethiscommand:/etc/init.
d/ma-initdstopStartingtheManagementAgentasaServicewithJavaEnterpriseSystemonWindowsTostartthemanagementagentasaWindowsservice,usethiscommand:HADB_install_dir\bin\ma-i[config-file]Theoptionalargumentconfig-filespecifiesthemanagementagentconfigurationfile.
Useaconfigurationfileonlyifyouwanttochangethedefaultmanagementagentconfiguration.
Tostopthemanagementagentandremove(deregister)itasaservice,usethecommand:HADB_install_dir\bin\ma-r[config-file]Toperformadministration,chooseAdministrativeTools|Services,whichenablesyoutostartandstoptheservice,disableautomaticstartup,andsoon.
UsingtheHADBManagementAgentChapter3AdministeringHighAvailabilityDatabase55StartingtheManagementAgentasaServicewithStandaloneApplicationServeronSolarisorLinuxTostartthemanagementagentasaservice,usethiscommand:HADB_install_dir/bin/ma-initdstartTostoptheservice,usethiscommand:HADB_install_dir/bin/ma-initdstopStartingtheManagementAgentasaServicewithStandaloneApplicationServeronWindowsTostartthemanagementagentasaWindowsservice,usethiscommand:HADB_install_dir\bin\ma-i[config-file]Theoptionalargumentconfig-filespecifiesthemanagementagentconfigurationfile.
Useaconfigurationfileonlyifyouwanttochangethedefaultmanagementagentconfiguration.
Tostopthemanagementagentandremove(deregister)itasaservice,usethecommand:HADB_install_dir\bin\ma-r[config-file]Toperformadministration,chooseAdministrativeTools|Services,whichenablesyoutostartandstoptheservice,disableautomaticstartup,andsoon.
EnsuringAutomaticRestartoftheManagementAgentOnWindowsplatforms,onceyouhavestartedthemanagementagentasaservice,usetheWindowsadministrativetoolstosettheserviceStartuptypeto"Automatic,"andthedesiredRecoveryoptions.
OnSolarisandLinuxplatforms,usetheproceduresinthissectiontoensuretheavailabilityofthemanagementagentincasethemaprocessfailsortheoperatingsystemreboots.
Doingsoisappropriateforaproductiondeployment.
Thefollowingproceduresensurethemanagementagentstartsonlywhenthesystementers:Runlevel3onSolaris(thedefault).
Runlevel5onRedHatLinux(thedefaultingraphicalmode).
Enteringotherrunlevelsstopsthemanagementagent.
UsingtheHADBManagementAgentSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200756ToConfigureautomaticrestartwithJavaEnterpriseSystemonSolarisorLinuxThissectionassumesyouhaveabasicunderstandingofoperatingsysteminitializationandrunlevels.
Forinformationonthesetopics,seeyouroperatingsystemdocumentation.
Ensurethatyoursystemhasadefaultrunlevelof3or5.
Tocheckthedefaultrunlevelofyoursystem,inspectthefile/etc/inittab,andlookforalinenearthetopsimilartothis:id:5:initdefault:Thisexampleshowsadefaultrunlevelof5.
Createthefollowingsoftlinkstothefile/etc/init.
d/ma-initd:/etc/rc0.
d/K20ma-initd/etc/rc1.
d/K20ma-initd/etc/rc2.
d/K20ma-initd/etc/rc3.
d/S99ma-initd/etc/rc5.
d/S99ma-initd/etc/rcS.
d/K20ma-initdRebootthemachine.
Todeactivateautomaticstartandstopoftheagent,removethelinksorchangethelettersKandSinthelinknamestolowercase.
ToConfigureautomaticrestartwithStandaloneApplicationServeronSolarisorLinuxInashell,changeyourcurrentdirectorytoHADB_install_dir/bin.
Edittheshellscriptma-initd.
MakesurethedefaultvaluesofHADB_ROOTandHADB_MA_CFGinthescripttoreflectyourinstallation:HADB_ROOTistheHADBinstallationdirectory,HADB_install_dir.
HADB_MA_CFGisthelocationofthemanagementagentconfigurationfile.
Formoreinformation,see"CustomizingManagementAgentConfiguration"onpage53Copyma-initdtothedirectory/etc/init.
dBeforeYouBegin123NextSteps123UsingtheHADBManagementAgentChapter3AdministeringHighAvailabilityDatabase57Createthefollowingsoftlinkstothefile/etc/init.
d/ma-initd:/etc/rc0.
d/K20ma-initd/etc/rc1.
d/K20ma-initd/etc/rc2.
d/K20ma-initd/etc/rc3.
d/S99ma-initd/etc/rc5.
d/S99ma-initd/etc/rcS.
d/K20ma-initdTodeactivateautomaticstartandstopoftheagent,removethelinksorchangethelettersKandSinthelinknamestolowercase.
StartingtheManagementAgentinConsoleModeYoumaywishtostartthemanagementagentmanuallyinconsolemodeforevaluationortesting.
Donotstartthemanagementagentthiswayinaproductionenvironment,becausethemaprocesswillnotrestartafterasystemorprocessfailureandwillterminatewhenthecommandwindowisclosed.
StartingmanagementagentinConsoleModewithJavaEnterpriseSystemonSolarisorLinuxTostarttheHADBmanagementagentinconsolemode,usethecommand:opt/SUNWhadb/bin/ma[config-file]Thedefaultmanagementagentconfigurationfileis/etc/opt/SUNWhadb/mgt.
cfgTostopthemanagementagent,killtheprocessorclosetheshellwindow.
StartingmanagementagentinConsoleModewithJavaEnterpriseSystemonWindowsTostartthemanagementagentinconsolemode,usethecommand:HADB_install_dir\bin\ma[config-file]Theoptionalargumentconfig-fileisthenameofthemanagementagentconfigurationfile.
Formoreinformationontheconfigurationfile,see"CustomizingManagementAgentConfiguration"onpage53.
Tostoptheagent,killtheprocess.
4NextStepsUsingtheHADBManagementAgentSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200758StartingmanagementagentinConsolemodewithStandaloneApplicationServeronWindowsTostartthemanagementagentinconsolemode,usethecommand:HADB_install_dir\bin\ma[config-file]Theoptionalargumentconfig-fileisthenameofthemanagementagentconfigurationfile;formoreinformation,see"CustomizingManagementAgentConfiguration"onpage53Tostopthemanagementagent,killtheprocess.
StartingmanagementagentinConsoleModewithStandaloneApplicationServeronSolarisorLinuxTostarttheHADBmanagementagentinconsolemode,usethecommand:HADB_install_dir/bin/ma[config-file]ThedefaultmanagementagentconfigurationfileisHADB_install_dir/bin/ma.
cfgTostopthemanagementagent,killtheprocessorclosetheshellwindow.
UsingthehadbmManagementCommandUsethehadbmcommand-lineutilitytomanageanHADBdomain,itsdatabaseinstances,andnodes.
Thehadbmutility(alsocalledthemanagementclient)sendsmanagementrequeststothespecifiedmanagementagent,actingasamanagementserver,whichhasaccesstothedatabaseconfigurationfromtherepository.
Thissectiondescribesthehadbmcommand-lineutility,withthefollowingtopics:"CommandSyntax"onpage59"SecurityOptions"onpage60"GeneralOptions"onpage61"EnvironmentVariables"onpage62CommandSyntaxThehadbmutilityislocatedintheHADB_install_dir/bindirectory.
Thegeneralsyntaxofthehadbmcommandis:hadbmsubcommand[-short-option[option-value]][--long-option[option-value]][operands]UsingthehadbmManagementCommandChapter3AdministeringHighAvailabilityDatabase59Thesubcommandidentifiestheoperationortasktoperform.
Subcommandsarecase-sensitive.
Mostcommandshaveoneoperand(usuallydbname),butsomehavenone,andsomehavetwo.
Optionsmodifyhowhadbmperformsasubcommand.
Optionsarecase-sensitive.
Eachoptionhasalongformandashortform.
Precedetheshortformwithasingledash(-);precedethelongformswithtwodashes(--).
Mostoptionsrequireargumentvalues,exceptforbooleanoptions,whichmustbepresenttoswitchafeatureon.
Optionsarenotrequiredforsuccessfulexecutionofthecommand.
Ifasubcommandrequiresadatabasename,andyoudonotspecifyone,hadbmwillusethedefaultdatabase,hadb.
EXAMPLE3–1ExampleofhadbmcommandThefollowingillustratesthestatussubcommand:hadbmstatus--nodesSecurityOptionsForsecurityreasons,allhadbmcommandsrequireanadministratorpassword.
Usethe--adminpasswordoptiontosetthepasswordwhenyoucreateadatabaseordomain.
Fromthenon,youmustspecifythatpasswordwhenyouperformoperationsonthedatabaseordomain.
Forenhancedsecurity,usethe--adminpasswordfileoptiontospecifyafilecontainingthepassword,insteadofenteringitonthecommandline.
Definethepasswordinthepasswordfilewiththefollowingline:HADBM_ADMINPASSWORD=passwordReplacepasswordwiththepassword.
Anyothercontentinthefileisignored.
Ifyouspecifyboththe--adminpasswordand--adminpasswordfileoptions,the--adminpasswordtakesprecedence.
Ifapasswordisrequired,butisnotspecifiedinthecommand,hadbmpromptsyouforapassword.
Note–Youcanchangetheadministratorpassword,ifrequired,usingthecommandsetadminpassword.
Formoreinformationaboutthecommand,seethemanpageforthecommandsetadminpassword.
Inadditiontotheadministratorpassword,HADBalsorequiresadatabasepasswordtoperformoperationsthatmodifythedatabaseschema.
Youmustusebothpasswordswhenusingthefollowingcommands:hadbmcreate,hadbmaddnodes,andhadbmrefragment.
UsingthehadbmManagementCommandSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200760Specifythedatabasepasswordonthecommandlinewiththe--dbpasswordoption.
Similartotheadministratorpassword,youcanalsoputthepasswordinafileandusethe--dbpasswordfileoption,specifyingthefilelocation.
Setthepasswordinthepasswordfilewiththefollowingline:HADBM_DBPASSWORD=passwordFortestingorevaluation,youcanturnoffpasswordauthenticationwiththe--no-adminauthenticationoptionwhenyoucreateadatabaseordomain.
Formoreinformation,see"CreatingaDatabase"onpage65and"CreatingaManagementDomain"onpage64Thefollowingtablesummarizesthehadbmsecuritycommandlineoptions.
TABLE3–4hadbmSecurityOptionsOption(ShortForm)Description--adminpassword=password-wSpecifiesadministratorpasswordforthedatabaseordomain.
Ifyouusethisoptionwhenyoucreateadatabaseordomain,thenyoumustprovidethepasswordeachtimeyouusehadbmtooperateonthedatabaseordomain.
Useeitherthisoptionor--adminpasswordfile,butnotboth.
--adminpasswordfile=filepath-WSpecifiesfilethatcontainstheadministratorpasswordforthedatabaseordomain.
Ifyouusethisoptionwhenyoucreateadatabaseordomain,thenyoumustprovidethepasswordeachtimeyouusehadbmtooperateonthedatabaseordomain.
Useeitherthisoptionor--adminpassword,butnotboth.
--no-adminauthentication-UUsethisoptionwhenyoucreateadatabaseordomaintospecifythatnoadministratorpasswordisrequired.
Forsecurityreasons,donotusethisoptioninaproductiondeployment.
--dbpassword=password-pSpecifiesthedatabasepassword.
Ifyouusethisoptionwhenyoucreatethedatabase,thenyoumustprovidethepasswordeachtimeyouuseanhadbmcommandtooperateonthedatabase.
CreatesapasswordfortheHADBsystemuser.
Mustbeatleast8characters.
Useeitherthisoptionor--dbpasswordfile,butnotboth.
--dbpasswordfile=filepath-PSpecifiesafilethatcontainsthepasswordfortheHADBsystemuser.
Useeitherthisoptionor--dbpassword,butnotboth.
GeneralOptionsGeneralcommandoptionscanbeusedwithanyhadbmsubcommand.
Allarebooleanoptionsthatarefalsebydefault.
Thefollowingtabledescribesthehadbmgeneralcommandoptions.
UsingthehadbmManagementCommandChapter3AdministeringHighAvailabilityDatabase61TABLE3–5hadbmGeneralOptionsOption(ShortForm)Description--quiet-qExecutethesubcommandsilentlywithoutanydescriptivemessages.
--help-Displayabriefdescriptionofthiscommandandallthesupportedsubcommands.
Nosubcommandisrequired.
--version-VDisplaytheversiondetailsofthehadbmcommand.
Nosubcommandisrequired.
--yes-yExecutethesubcommandinnon-interactivemode.
--force-fExecutethecommandnon-interactivelyanddoesnotthrowanerrorifthecommand'spostconditionisalreadyachieved.
--echo-eDisplaythesubcommandwithalltheoptionsandtheiruser-definedvaluesorthedefaultvalues,thenexecutesthesubcommand.
--agent=URL-mURLtothemanagementagents.
URLis:hostlist:port,wherehostlistisacommaseparatedlistofhostnamesorIP-addresses,andportistheportnumberonwhichthemanagementagentisoperating.
Defaultislocalhost:1862.
NOTE:Thisoptionisnotvalidwithhadbmaddnodes.
EnvironmentVariablesForconvenience,youcansetanenvironmentvariableinsteadofspecifyingacommandoption.
Thefollowingtabledescribesenvironmentvariablesthatcorrespondtohadbmcommandoptions.
TABLE3–6HADBOptionsandEnvironmentVariablesLongFormShortFormDefaultEnvironmentVariable--adminpassword-wnone$HADBM_ADMINPASSWORD--agent--mlocalhost:1862$HADBM_AGENT--datadevices-a1$HADBM_DATADEVICESdbnamenonehadb$HADBM_DBUsingthehadbmManagementCommandSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200762TABLE3–6HADBOptionsandEnvironmentVariables(Continued)LongFormShortFormDefaultEnvironmentVariable--dbpassword-pnone$HADBM_DBPASSWORD--dbpasswordfile-Pnone$HADBM_DBPASSWORDFILE--devicepath-dSolarisandLinux:/var/opt/SUNWhadbWindows:C:\Sun\AppServer\SUNWhadb\vers,whereversistheHADBversionnumber.
$HADBM_DEVICEPATH--devicesize-znone$HADBM_DEVICESIZE--echo-eFalse$HADBM_ECHO--fast-FFalse$HADBM_FAST--force-fFalse$HADBM_FORCE--help-False$HADBM_HELP--historypath-tSolarisandLinux:/var/opt/SUNWhadbWindows:REPLACEDIR,replacedbytheactualURLatruntime.
$HADBM_HISTORYPATH--hosts-Hnone$HADBM_HOSTS--interactive-iTrue$HADBM_INTERACTIVE--no-refragment-rFalse$HADBM_NOREFRAGMENT--portbase-b15200$HADBM_PORTBASE--quiet-qFalse$HADBM_QUIET--repair-RTrue$HADBM_REPAIR--rolling-gTrue$HADBM_ROLLING--saveto-onone$HADBM_SAVETO--set-Snone$HADBM_SET--spares-s0$HADBM_SPARES--startlevel-lnormal$HADBM_STARTLEVEL--version-VFalse$HADBM_VERSION--yes-yFalse$HADBM_YESUsingthehadbmManagementCommandChapter3AdministeringHighAvailabilityDatabase63ConfiguringHADBThissectiondescribesthefollowingbasicHADBconfigurationtasks:"CreatingaManagementDomain"onpage64"CreatingaDatabase"onpage65"ViewingandModifyingConfigurationAttributes"onpage70"ConfiguringtheJDBCConnectionPool"onpage75CreatingaManagementDomainThecommandhadbmcreatedomaincreatesamanagementdomaincontainingthespecifiedHADBhosts.
Thecommandinitializesinternalcommunicationchannelsbetweenhostsandthepersistenceconfigurationstore.
Thesyntaxofthecommandis:hadbmcreatedomain[--adminpassword=password|--adminpasswordfile=file|--no-adminauthentication][--agent=maurl]hostlistThehostlistoperandisacomma-separatedlistofHADBhosts,eachofwhichisavalidIPv4networkaddress.
Includeallthehoststhatyouwanttobeinthenewdomaininthehostlist.
See"GeneralOptions"onpage61foradescriptionofthecommandoptions.
Beforeusingthiscommand,besureanHADBmanagementagentisrunningoneveryhostinthehostlist.
Additionally,themanagementagentsmust:Notbemembersofanexistingdomain.
Beconfiguredtousethesameport.
BeabletoreacheachotheroverUDP,TCP,andwithIPmulticast.
Afterhadbmcreatesthemanagementdomain,itenablesallthehostsinthedomain.
Thenthemanagementagentsarereadytomanagedatabases.
AftercreatingHADBdomains,thenextstepistocreatetheHADBdatabase.
FormoreinformationoncreatingHADBdatabases,see"CreatingaDatabase"onpage65.
EXAMPLE3–2CreatinganHADBManagementDomainThefollowingexamplecreatesamanagementdomainonthefourspecifiedhosts:hadbmcreatedomain--adminpassword=passwordhost1,host2,host3,host4Afterhadbmsuccessfullyexecutesthecommand,youwillseethemessage:Domainhost1,host2,host3,host4created.
ConfiguringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200764EXAMPLE3–2CreatinganHADBManagementDomain(Continued)AftercreatingHADBdomains,registerthepathandversionoftheHADBpackageswiththemanagementagents.
CreatingaDatabaseUsethehadbmcreatecommandtocreateadatabasemanually.
Beforeyouusethiscommandtocreateadatabase,createthemanagementdomainandregistertheHADBpackage.
Ifyouhavenotperformedthesetwostepswhenyourunhadbmcreate,itimplicitlyperformsthem.
Althoughthismightseemlikelesswork,failuresinanyofthecommandscanmakedebuggingdifficult.
Besides,hadbmcreateisnotatomic,thatis,ifoneoftheimplicitcommandsfails,thecommandsthatexecutedsuccessfullywillnotberolledback.
Therefore,itisbesttocreatethedatabaseonlyaftercreatingthedomainandregisteringtheHADBpackage.
Forexample,ifhadbmcreatedomainandhadbmregisterpackageexecutesuccessfullybuthadbmcreatedatabasefails,thechangesmadebyhadbmcreatedomainandhadbmregisterpackagewillpersist.
TocreateadatabaseCreatethemanagementdomain.
Formoreinformation,see"CreatingaManagementDomain"onpage64RegistertheHADBpackage.
Formoreinformation,see"RegisteringHADBPackages"onpage48formoreinformation.
Usethehadbmcreatecommandtocreatethedatabase.
Forinformationoncommandsyntax,seethefollowingsection.
hadbmcreateCommandSyntaxhadbmcreate[--package=name][--packagepath=path][--historypath=path][--devicepath=path][--datadevices=number][--portbase=number][--spares=number][--set=attr-val-list][--agent=maurl][--no-cleanup][--no-clear][--devicesize=size][--dbpassword=password|--dbpasswordfile=file]--hosts=hostlist[--adminpassword=password|--adminpasswordfile=file|--no-adminauthentication][dbname]Thedbnameoperandspecifiesthedatabasename,whichmustbeunique.
Tomakesurethedatabasenameisunique,usethehadbmlistcommandtolistexistingdatabasenames.
Usethe123ConfiguringHADBChapter3AdministeringHighAvailabilityDatabase65defaultdatabasenameunlessyouneedtocreatemultipledatabases.
Forexample,tocreatemultipleclusterswithindependentdatabasesonthesamesetofHADBmachines,useaseparatedatabasenameforeachcluster.
Thehadbmcreatecommandwriteserrormessagestotheconsole,notlogfiles.
Table3–7describesthespecialhadbmcreatecommandoptions.
See"GeneralOptions"onpage61foradescriptionofadditionalcommandoptions.
TABLE3–7hadbmcreateOptionsOption(ShortForm)DescriptionDefault--datadevices=number-aNumberofdatadevicesoneachnode,betweenoneandeightinclusive.
Datadevicesarenumberedstartingat0.
1--devicepath=path-dPathtothedevices.
Therearefourdevices:DataDeviceNiLogDevice(nodeinternallogdevice)RelalgDevice(relationalalgebraquerydevice)NoManDevice(nodemanagerdevice).
Thispathmustexistandbewritable.
Tosetthispathdifferentlyforeachnodeoreachdevice,see"SettingHeterogeneousDevicePaths"onpage68SolarisandLinux:/var/opt/SUNWhadbWindows:C:\Sun\AppServer\SUNWhadb\vers,whereversistheHADBversionnumber.
Defaultisspecifiedbyma.
server.
dbdevicepathinmanagementagentconfigurationfile.
Formoredetails,see"ConfigurationFile"onpage53--devicesize=size-zDevicesizeforeachnode.
Formoreinformation,see"SpecifyingDeviceSize"onpage68.
Increasethedevicesizeasdescribedin"AddingStorageSpacetoExistingNodes"onpage871024MBMaximumsizeislesserofmaximumoperatingsystemfilesizeor256GB.
Minimumsizeis:(4xLogbufferSize+16MB)/nWherenisthenumberofdatadevicesgivenbytheoption--datadevices.
--historypath=path-tPathtothehistoryfiles.
Thispathmustalreadyexistandbewritable.
Formoreinformationonhistoryfiles,see"ClearingandArchivingHistoryFiles"onpage101Defaultisspecifiedbyma.
server.
dbhistorypathinmanagementagentconfigurationfile.
Fordetails,see"ConfigurationFile"onpage53SolarisandLinux:/var/opt/SUNWhadbOnWindows:REPLACEDIR(replacedbytheactualURLatruntime.
)ConfiguringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200766TABLE3–7hadbmcreateOptions(Continued)Option(ShortForm)DescriptionDefault--hosts=hostlist-HComma-separatedlistofhostnamesorIPaddresses(IPv4only)forthenodesinthedatabase.
UseIPaddressestoavoiddependenceonDNSlookups.
Hostnamesmustbeabsolute.
Youcannotuselocalhostor127.
0.
0.
1asahostname.
See"SpecifyingHosts"onpage68formoreinformation.
None--package=name-kNameoftheHADBpackage(version).
Ifthepackageisnotfound,adefaultpackageisregistered.
Thisoptionisdeprecated.
Usethehadbmregisterpackagecommandtoregisterapackageinthedomain.
None--packagepath=path-LPathtotheHADBsoftwarepackage.
Useonlyifthepackageisnotregisteredinthedomain.
Thisoptionisdeprecated.
Usethehadbmregisterpackagecommandtoregisterapackageinthedomain.
None--portbase=number-bPortbasenumberusedfornode0.
Successivenodesareautomaticallyassignedportbasenumbersinstepsof20fromthisnumber.
Eachnodeusesitsportbasenumberandthenextfiveconsecutivelynumberedports.
Torunseveraldatabasesonthesamemachine,haveaplanforallocatingportnumbersexplicitly.
15200--spares=number-sNumberofsparenodes.
Thisnumbermustbeevenandmustbelessthanthenumberofnodesspecifiedinthe--hostsoption.
0--set=attr-val-list-SComma-separatedlistofdatabaseconfigurationattributesinname=valueformat.
Forexplanationsofdatabaseconfigurationattributes,see"ClearingandArchivingHistoryFiles"onpage101NoneEXAMPLE3–3ExampleofcreatingadatabaseThefollowingcommandisanexampleofcreatingadatabase:ConfiguringHADBChapter3AdministeringHighAvailabilityDatabase67EXAMPLE3–3Exampleofcreatingadatabase(Continued)hadbmcreate--spares2--devicesize1024--dbpasswordsecret123--hostsn0,n1,n2,n3,n4,n5SpecifyingHostsUsethe--hostsoptiontospecifyacomma-separatedlistofhostnamesorIPaddressesforthenodesinthedatabase.
Thehadbmcreatecommandcreatesonenodeforeachhostname(orIPaddress)inthelist.
Thenumberofnodesmustbeeven.
Useduplicatehostnamestocreatemultiplenodesonthesamemachinewithdifferentportnumbers.
Makesurethatnodesonthesamemachinearenotmirrornodes.
Nodesarenumberedstartingatzerointheorderlistedinthisoption.
Thefirstmirroredpairarenodeszero(0)andone(1),thesecondtwo(2)andthree(3),andsoon.
OddnumberednodesareinoneDRU,evennumberednodesintheother.
With--sparesoption,sparenodesarethosewiththehighestnumbers.
Forinformationaboutconfiguringdoublenetworkinterfaces,see"ConfiguringNetworkRedundancy"onpage35SpecifyingDeviceSizeSpecifythedevicesizeusingthe--devicesizeoption.
Therecommendeddevicesizeis:(4x/nd+4l/d)/0.
99Wherexisthetotalsizeofuserdatanisthenumberofnodes(givenbythe--hostsoption)disthenumberofdevicespernode(givenbythe--datadevicesoption)listhelogbuffersize(givenbytheattributeLogBufferSize)Ifrefragmentationmightoccur(forexample,usinghadbmaddnodes),thentherecommendeddevicesizeis:(8x/nd+4l/d)/0.
99SettingHeterogeneousDevicePathsTosetadifferentdevicepathforeachnodeorservice,usethe--setoptionofhadbmcreate.
Therearefourtypesofdevices:theDataDevice,theNiLogDevice(nodeinternallogdevice),theRelalgDevice(relationalalgebraquerydevice),andtheNoManDevice(nodemanagerdevice).
Thesyntaxforeachname=valuepairisasfollows,where-devnoisrequiredonlyifthedeviceisDataDevice:ConfiguringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200768node-nodeno.
device-devno.
DevicepathForexample:--setNode-0.
DataDevice-0.
DevicePath=/disk0,Node-1.
DataDevice-0.
DevicePath=/disk1Youcanalsosetaheterogeneouspathtohistoryfiles,asfollows:node-nodeno.
historypath=pathForinformationonhistoryfiles,see"ClearingandArchivingHistoryFiles"onpage101Anydevicepaththatisnotsetforaparticularnodeordevicedefaultstothe--devicepathvalue.
Note–Changedevicepathsandlocationofhistoryfilesusinghadbmsetandhadbmaddnodescommands.
TroubleshootingIfyouhavedifficultycreatingadatabase,checkthefollowing:EnsureyouhavestartedthemanagementagentsonallthehostsanddefinedanHADBdomain.
Fordetails,see"StartingtheManagementAgent"onpage54Fileanddirectorypermissionsmustbesettoallowread,write,andexecuteaccesstotheinstall,history,device,andconfigpathsforthefollowingusers:SunJavaSystemApplicationServeradministrativeuser(setduringinstallation)HADBsystemuserFordetailsaboutsettinguserpermissions,see"PreparingforHADBSetup"onpage34ApplicationServerandHADBportassignmentsmustnotconflictwithotherportassignmentsonthesamemachine.
Defaultrecommendedportassignmentsare:SunJavaSystemMessageQueue:7676IIOP:3700HTTPserver:80Administrationserver:4848HADBnodes:Eachnodeusessixconsecutiveports.
Forexample,fordefaultport15200,node0uses15200through15205,node1uses15220through15225,andsoon.
Diskspacemustbeadequate;seetheSunJavaSystemApplicationServerReleaseNotes.
ConfiguringHADBChapter3AdministeringHighAvailabilityDatabase69ViewingandModifyingConfigurationAttributesYoucanviewandmodifydatabaseconfigurationattributeswiththehadbmgetandhadbmsetcommands,respectively.
GettingtheValuesofConfigurationAttributesTogetthevaluesofconfigurationattributes,usethehadbmgetcommand.
Foralistofvalidattributes,see"ConfigurationAttributes"onpage71.
Thecommandsyntaxis:hadbmgetattribute-list|--all[dbname][--adminpassword=password|--adminpasswordfile=file][--agent=maurl]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
Theattribute-listoperandisacomma-separatedorquote-enclosedspace-separatedlistofattributes.
The--alloptiondisplaysvaluesforallattributes.
Foralistofallattributesforhadbmget,see"ConfigurationAttributes"onpage71.
See"GeneralOptions"onpage61foradescriptionofcommandoptions.
EXAMPLE3–4ExampleofusinghadbmgethadbmgetJdbcUrl,NumberOfSessionsSettingtheValuesofConfigurationAttributesTosetthevaluesofconfigurationattributes,usethehadbmsetcommand.
Foralistofvalidattributes,see"ConfigurationAttributes"onpage71hadbmset[dbname]attribute=value[,attribute=value.
.
.
][--adminpassword=password|--adminpasswordfile=file][--agent=maurl]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
Theattribute=valuelistisacomma-separatedorquote-enclosedspace-separatedlistofattributes.
See"GeneralOptions"onpage61foradescriptionofcommandoptions.
Ifthiscommandexecutessuccessfully,itrestartsthedatabaseinthestateitwasinpreviously,orinabetterstate.
Forinformationaboutdatabasestates,see"GettingtheStatusofHADB"onpage92restarttheHADBasdescribedin"RestartingaDatabase"onpage83.
ConfiguringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200770Youcannotsetthefollowingattributeswithhadbmset.
Instead,setthemwhenyoucreateadatabase(see"CreatingaDatabase"onpage65).
DatabaseNameDevicePathHistoryPathNumberOfDatadevicesPortbaseJdbcUrl(itsvalueissetduringdatabasecreationbasedonthe--hostsand--portbaseoptions).
Note–Usinghadbmsettosetanyconfigurationattribute,exceptConnectionTraceorSQLTraceMode,causesarollingrestartofHADB.
Inarollingrestart,eachnodeisstopped,andstartedwiththenewconfiguration,oneatatime;HADBservicesarenotinterrupted.
IfyousetConnectionTraceorSQLTraceMode,norollingrestartoccurs,butthechangeonlytakeseffectfornewHADBconnectionsmadefromanApplicationServerinstance.
ConfigurationAttributesThefollowingtableliststheconfigurationattributesthatyoucanmodifywithhadbmsetandretrievewithhadbmget.
TABLE3–8ConfigurationAttributesAttributeDescriptionDefaultRangeConnectionTraceIftrue,recordsamessageintheHADBhistoryfileswhenaclientconnection(JDBC,ODBC)isinitiatedorterminated.
FalseTrueorFalseCoreFileDonotchangethedefaultvalue.
FalseTrueorFalseDatabaseNameNameofthedatabase.
hadbDataBufferPoolSizeSizeofthedatabufferpoolallocatedinsharedmemory.
200MB16-2047MBConfiguringHADBChapter3AdministeringHighAvailabilityDatabase71TABLE3–8ConfigurationAttributes(Continued)AttributeDescriptionDefaultRangeDataDeviceSizeSpecifiesthedevicesizeforthenode.
ForinformationontherecommendedDataDeviceSize,see"SpecifyingDeviceSize"onpage68Themaximumvalueisthesmallerof256GBorthemaximumoperatingsystemfilesize.
Theminimumvalueis:(4xLogbufferSize+16MB)/nwherenisnumberofdatadevices.
1024MB32-262144MBPackageNameNameofHADBsoftwarepackageusedbythedatabase.
V4.
x.
x.
xNoneDevicePathLocationofthedevices.
Devicesare:Datadevice(DataDevice)Nodeinternallogdevice(NiLogDevice)Relationalalgebraquerydevice(RelalgDevice)SolarisandLinux:/var/opt/SUNWhadbWindows:C:\Sun\AppServer\SUNWhadb\vers,whereversistheHADBversionnumber.
EagerSessionThresholdDetermineswhethernormaloreageridlesessionexpirationisused.
Innormalidlesessionexpiration,sessionsthatareidleformorethanSessionTimeoutsecondsareexpired.
WhenthenumberofconcurrentsessionsexceedstheEagerSessionThresholdpercentageofthemaximumnumberofsessions,sessionsthatareidleformorethanEagerSessionTimeoutsecondsareexpired.
HalfofNumberOfSessionsattribute0-100EagerSessionTimeoutThetimeinsecondsadatabaseconnectioncanbeidlebeforeitexpireswheneagersessionexpirationisused.
120seconds0-2147483647secondsConfiguringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200772TABLE3–8ConfigurationAttributes(Continued)AttributeDescriptionDefaultRangeEventBufferSizeSizeoftheeventbuffer,wheredatabaseeventsarelogged.
Ifsetto0,noeventbufferloggingisperformed.
Duringfailures,theeventbufferisdumped.
Thisgivesvaluableinformationonthecauseofthefailuresandisusefulduringtrialdeployment.
Writingeventstomemoryhasaperformancepenalty.
0MB0-2097152MBHistoryPathLocationoftheHADBhistoryfiles,whichcontaininformation,warnings,anderrormessages.
Thisisaread-onlyattribute.
SolarisandLinux:/var/opt/SUNWhadbWindows:REPLACEDIR(replacedbytheactualURLatruntime.
)InternalLogbufferSizeSizeofthenodeinternallogdevice,whichkeepstrackofoperationsrelatedtostoringdata.
12MB4-128MBJdbcUrlTheJDBCconnectionURLforthedatabase.
Thisisaread-onlyattribute.
noneLogbufferSizeSizeofthelogbuffer,whichkeepstrackofoperationsrelatedtodata.
48MB4-2048MBMaxTablesMaximumnumberoftablesallowedinanHADBdatabase.
1100100-1100NumberOfDatadevicesNumberofdatadevicesusedbyanHADBnode.
Thisisaread-onlyattribute.
11-8NumberOfLocksNumberoflocksallocatedbyanHADBnode.
5000020000-1073741824NumberOfSessionsMaximumnumberofsessions(databaseconnections)thatcanbeopenedforanHADBnode.
1001-10000PortBaseBaseportnumberusedtocreatedifferentportnumbersfordifferentHADBprocesses.
Thisisaread-onlyattribute.
1520010000-63000RelalgDeviceSizeSizeofthedeviceusedinrelationalalgebraqueries.
128MB32-262144MBConfiguringHADBChapter3AdministeringHighAvailabilityDatabase73TABLE3–8ConfigurationAttributes(Continued)AttributeDescriptionDefaultRangeSessionTimeoutAmountoftimeadatabaseconnectioncanbeidlebeforeitexpireswhennormalsessionexpirationisused.
1800seconds0-2147483647secondsSQLTraceModeAmountofinformationaboutexecutedSQLquerieswrittentothehistoryfiles.
IfSHORT,loginandlogoutofSQLsessionsarerecorded.
IfFULL,allSQLqueriesbeingpreparedandexecuted,includingparametervalues,arerecorded.
NONENONE/SHORT/FULLStartRepairDelayMaximumtimeasparenodeallowsforafailedactivenodetoperformanoderecovery.
Ifthefailednodecannotrecoverwithinthistimeinterval,thesparenodestartscopyingdatafromthefailednode'smirrorandbecomesactive.
Changingthedefaultvalueisnotrecommended.
20seconds0-100000secondsStatIntervalIntervalatwhichanHADBnodewritesthroughputandresponsetimestatisticstoitshistoryfile.
Todisable,setto0.
Hereisanexampleofastatisticsline:Req-replytime:#123,min=69avg=1160max=9311%=100.
0Thenumberafterthehassign(#)isthenumberofrequestsservicedovertheStatInterval.
Thenextthreenumbersaretheminimum,average,andmaximumtimeinmicrosecondstakenbytransactionscompletedovertheStatInterval.
Thenumberaferthepercentsign(%)isthenumberoftransactionscompletedsuccessfullywithin15millisecondsovertheStatInterval.
600seconds0-600secondsSyslogFacilityFacilityusedwhenreportingtosyslog.
Thesyslogdaemonshouldbeconfigured(seemansyslogd.
conffordetails).
Useafacilitythatisnotusedbyotherapplicationsrunningonthesamemachine.
Settononetodisablesysloglogging.
local0local0,local1,local2,local3,local4,local5,local6,local7,kern,user,mail,daemon,auth,syslog,lpr,news,uucp,cron,noneSysLoggingIftrue,anHADBnodewritesinformationtotheoperatingsystem'ssyslogfiles.
TrueTrueorFalseConfiguringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200774TABLE3–8ConfigurationAttributes(Continued)AttributeDescriptionDefaultRangeSysLogLevelMinimumlevelofHADBmessagesavedtooperatingsystem'ssyslogfiles.
Allmessagesofthatlevelorhigherwillbelogged.
Forexample,"info"logsallmessages.
warningnonealerterrorwarninginfoSyslogPrefixTextstringinsertedbeforeallsyslogmessageswrittenbytheHADB.
hadb-dbnameTakeoverTimeTimebetweenwhenanodefailsandwhenitsmirrortakesover.
Donotchangethedefaultvalue.
10000(milliseconds)500-16000millisecondsConfiguringtheJDBCConnectionPoolApplicationServercommunicateswithHADBusingtheJavaDatabaseConnectivity(JDBC)API.
Theasadminconfigure-ha-clustercommandautomaticallycreatesaJDBCconnectionpoolforusewithHADB(foraclustercluster-name).
Thenameoftheconnectionpooliscluster-name-hadb-pool.
TheJNDIURLofJDBCresourceisjdbc/cluster-name-hastore.
Theinitialconfigurationoftheconnectionpoolisnormallysufficient.
Whenyouaddanode,changethesteadypoolsizesothatthereareeightconnectionsforeachHADBactivenode.
See"AddingNodes"onpage88.
Thischaptercoversthefollowingtopics:"GettingtheJDBCURL"onpage75"CreatingaConnectionPool"onpage76Example3–5"CreatingaJDBCResource"onpage77ForgeneralinformationaboutconnectionpoolsandJDBCresources,seeAdministrationGuide.
GettingtheJDBCURLBeforeyoucansetuptheJDBCconnectionpool,youneedtodeterminetheJDBCURLofHADBusingthehadbmgetcommandasfollows:hadbmgetJdbcUrl[dbname]Forexample:hadbmgetJdbcUrlThiscommanddisplaystheJDBCURL,whichisofhefollowingform:ConfiguringHADBChapter3AdministeringHighAvailabilityDatabase75jdbc:sun:hadb:host:port,host:port,.
.
.
Removethejdbc:sun:hadb:prefixandusethehost:port,host:port.
.
.
partasthevalueoftheserverListconnectionpoolproperty,describedinTable3–10.
CreatingaConnectionPoolThefollowingtablesummarizesconnectionpoolsettingsrequiredfortheHADB.
ChangetheSteadyPoolSizewhenaddingnodes,butdonotchangeothersettings.
TABLE3–9HADBConnectionPoolSettingsSettingRequiredValueforHADBNameTheHADBJDBCresource'sPoolNamesettingmustrefertothisnameDatabaseVendorHADB4.
4GlobalTransactionSupportUnchecked/falseDataSourceClassnamecom.
sun.
hadb.
jdbc.
ds.
HadbDataSourceSteadyPoolSizeUse8connectionsforeachactiveHADBnode.
Formoredetailedinformation,seetheSystemDeploymentGuide.
ConnectionValidationRequiredChecked/trueValidationMethodmeta-dataTableNameDonotspecifyFailAllConnectionsUnchecked/falseTransactionIsolationrepeatable-readGuaranteeIsolationLevelChecked/trueThefollowingtablesummarizesconnectionpoolpropertiesrequiredfortheHADB.
ChangeserverListwhenaddingnodes,butdonotchangeotherproperties.
TABLE3–10HADBConnectionPoolPropertiesPropertyDescriptionusernameNameofthestoreusertouseintheasadmincreate-session-storecommand.
passwordPassword(storepassword)tousintheasadmincreate-session-storecommand.
ConfiguringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200776TABLE3–10HADBConnectionPoolProperties(Continued)PropertyDescriptionserverListJDBCURLoftheHADB.
Todeterminethisvalue,see"GettingtheJDBCURL"onpage75Youmustchangethisvalueifyouaddnodestothedatabase.
See"AddingNodes"onpage88.
cacheDatabaseMetaDataWhenfalse,asrequired,ensuresthatcallstoConnection.
getMetaData()makecallstothedatabase,whichensuresthattheconnectionisvalid.
eliminateRedundantEndTransactionWhentrue,asrequired,improvesperformancebyeliminatingredundantcommitandrollbackrequestsandignoringtheserequestsifnotransactionisopen.
maxStatementMaximumnumberofstatementsperopenconnectionthatarecachedinthedriverstatementpool.
Setthispropertyto20.
EXAMPLE3–5CreatingaConnectionPoolHereisanexampleasadmincreate-jdbc-connection-poolcommandthatcreatesanHADBJDBCconnectionpool:asadmincreate-jdbc-connection-pool--useradminname--passwordsecret--datasourceclassnamecom.
sun.
hadb.
jdbc.
ds.
HadbDataSource--steadypoolsize=32--isolationlevel=repeatable-read--isconnectvalidatereq=true--validationmethod=meta-data--propertyusername=storename:password=secret456:serverList=host\:port,host\:port,host\\:port,host\:port,host\:port,host\:port:cacheDatabaseMetaData=false:eliminateRedundantEndTransaction=truehadbpoolOnSolaris,escapecoloncharacters(:)withinpropertyvalueswithdoublebackslashes(\\).
OnWindows,escapecoloncharacters(:)withsinglebackslashes(\).
CreatingaJDBCResourceThefollowingtablesummarizesJDBCresourcesettingsrequiredforHADB.
ConfiguringHADBChapter3AdministeringHighAvailabilityDatabase77TABLE3–11HADBJDBCResourceSettingsSettingDescriptionJNDINameThefollowingJNDInameisthedefaultinthesessionpersistenceconfiguration:jdbc/hastore.
Youcanusethedefaultnameoradifferentname.
YoumustalsospecifythisJNDInameasthevalueofthestore-pool-jndi-namePersistenceStorepropertywhenyouactivatetheavailabilityservice.
PoolNameSelectfromthelistthename(orID)oftheHADBconnectionpoolusedbythisJDBCresource.
Formoreinformation,see"ConfiguringNetworkRedundancy"onpage35DataSourceEnabledChecked/trueManagingHADBYougenerallyneedtoperformmanagementoperationswhenyoureplaceorupgradeyournetwork,hardware,operatingsystem,orHADBsoftware.
Thefollowingsectionsexplainvariousmanagementoperations:"ManagingDomains"onpage78"ManagingNodes"onpage79"ManagingDatabases"onpage82"RecoveringfromSessionDataCorruption"onpage86ManagingDomainsYoucanperformthefollowingoperationsonanHADBdomain:CreatingaDomain:Formoreinformation,see"CreatingaManagementDomain"onpage64"ExtendingaDomain"onpage78"DeletingaDomain"onpage79"ListingHostsinaDomain"onpage79"RemovingHostsfromaDomain"onpage79See"SecurityOptions"onpage60and"GeneralOptions"onpage61foradescriptionofcommandoptions.
ExtendingaDomainUseextenddomaintoaddhoststoanexistingmanagementdomain.
Thecommandsyntaxis:hadbmextenddomain[--adminpassword=password|--adminpasswordfile=file][--agent=maurl]hostlistManagingHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200778IPaddressesofHADBhostsmustbeIPv4addresses.
Formoreinformation,seehadbm-extenddomain(1).
DeletingaDomainUsedeletedomaintoremoveamanagementdomain.
Thecommandsyntaxis:hadbmdeletedomain[--adminpassword=password|--adminpasswordfile=file][--agent=maurl]Formoreinformation,seehadbm-deletedomain(1).
RemovingHostsfromaDomainUsereducedomaintoremovehostsfromthemanagementdomain.
Thecommandsyntaxis:hadbmreducedomain[--adminpassword=password|--adminpasswordfile=file][--agent=maurl]host_listFormoreinformation,seehadbm-reducedomain(1).
ListingHostsinaDomainUselistdomaintolistallhostsdefinedinthemanagementdomain.
Thecommandsyntaxis:hadbmlistdomain[--adminpassword=password|--adminpasswordfile=file][--agent=maurl]Formoreinformation,seehadbm-listdomain(1).
ManagingNodesYoucanperformthefollowingoperationsonindividualnodes:"StartingaNode"onpage80"StoppingaNode"onpage81"RestartingaNode"onpage81ManagingHADBChapter3AdministeringHighAvailabilityDatabase79StartingaNodeYoumightneedtomanuallystartanHADBnodethatwasstoppedbecauseitshostwastakenoff-lineforahardwareorsoftwareupgradeorreplacement.
Also,youmightneedtomanuallystartanodeifitfailstorestartforsomereason(otherthanadoublefailure).
Formoreinformationonhowtorecoverfromdoublefailures,see"Clearingadatabase"onpage84.
Inmostcases,youshouldfirstattempttostartthenodeusingthenormalstartlevel.
Youmustusetherepairstartlevelifthenormalstartlevelfailsortimesout.
Tostartanodeinthedatabase,usethehadbmstartnodecommand.
Thesyntaxis:hadbmstartnode[--adminpassword=password|--adminpasswordfile=file][--agent=maurl][--startlevel=level]nodeno[dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
Thenodenooperandspecifiesthenumberofthenodetostart.
Usehadbmstatustodisplaythenumbersofallnodesinadatabase.
Formoreinformation,seehadbm-startnode(1).
StartleveloptionThehadbmstartnodecommandhasonespecialoption,--startlevel(shortform-l),thatspecifiesthelevelatwhichtostartthenode.
Nodestartlevelsare:normal(default):startsthenodewiththedatafoundlocallyonthenode(inthememoryandinthedatadevicefileonthedisk)andsynchronizesitwiththemirrorforrecentupdatesitmissed.
repair:forcesthenodetodiscardlocaldataandcopyitfromitsmirror.
clear:reinitializesthedevicesforthenodeandforcesarepairofdatafromitsmirrornode.
Usewhenthedevicefilesneedtobeinitialized,necessaryiftheyaredamagedorthediskthatcontainedthedevicefilesisreplaced.
See"GeneralOptions"onpage61foradescriptionofothercommandoptions.
EXAMPLE3–6Exampleofstartinganodehadbmstartnode1ManagingHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200780StoppingaNodeYoumightneedtostopanodetorepairorupgradethehostmachine'shardwareorsoftware.
Tostopanode,usethehadbmstopnodecommand.
Thecommandsyntaxis:hadbmstopnode[--adminpassword=password|--adminpasswordfile=file][--agent=maurl][--no-repair]nodeno[dbname]Thenodenooperandspecifiesthenumberofthenodetostop.
Themirrornodeofthisnodenumbermustberunning.
Usehadbmstatustodisplaythenumbersofallnodesinadatabase.
Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
Thehadbmstopnodecommandhasonespecialoption,--no-repair(shortform-R)thatindicatesnosparenodeistoreplacethestoppednode.
Withoutthisoption,asparenodestartsupandtakesoverthefunctioningofthestoppednode.
See"GeneralOptions"onpage61foradescriptionofothercommandoptions.
Formoreinformation,seehadbm-stopnode(1).
EXAMPLE3–7Exampleofstoppinganodehadbmstopnode1RestartingaNodeYoumighthavetorestartanodeifyounoticeunusualbehaviorsuchasexcessiveCPUconsumption.
Torestartanodeinthedatabase,usethehadbmrestartnodecommand.
Thecommandsyntaxis:hadbmrestartnode[--adminpassword=password|--adminpasswordfile=file][--agent=maurl][--startlevel=level]nodeno[dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
Thenodenooperandspecifiesthenumberofthenodetorestart.
Usehadbmstatustodisplaythenumbersofallnodesinadatabase.
ManagingHADBChapter3AdministeringHighAvailabilityDatabase81Thehadbmrestartnodecommandhasonespecialoption,--startlevel(shortform-l),thatspecifiesthelevelatwhichtostartthenode.
See"Startleveloption"onpage80formoreinformation.
See"GeneralOptions"onpage61foradescriptionofothercommandoptions.
Formoreinformation,seehadbm-restartnode(1).
EXAMPLE3–8Exampleofrestartinganodehadbmrestartnode1ManagingDatabasesYoucanperformthefollowingoperationsonHADBdatabases:"StartingaDatabase"onpage82"StoppingaDatabase"onpage83"RestartingaDatabase"onpage83"ListingDatabases"onpage84"Clearingadatabase"onpage84"RemovingaDatabase"onpage85StartingaDatabaseTostartadatabase,usethehadbmstartcommand.
Thiscommandstartsallnodesthatwererunningbeforethedatabasewasstopped.
Individuallystopped(offline)nodesarenotstartedwhenthedatabaseisstartedafterastop.
Thecommandsyntaxis:hadbmstart[--adminpassword=password|--adminpasswordfile=file][--agent=maurl][dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
See"GeneralOptions"onpage61foradescriptionofcommandoptions.
Formoreinformation,seehadbm-start(1).
EXAMPLE3–9ExampleofstartingadatabasehadbmstartManagingHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200782StoppingaDatabaseWhenyoustopandstartadatabaseinseparateoperations,dataisunavailablewhileitisstopped.
Tokeepdataavailable,youcanrestartadatabaseasdescribedin"RestartingaDatabase"onpage83.
Stopadatabaseto:Removethedatabase.
PerformsystemmaintenancethataffectsallHADBnodes.
Beforestoppingadatabase,eitherstopdependentApplicationServerinstancesthatareusingthedatabase,orconfigurethemtouseaPersistenceTypeotherthanha.
Whenyoustopthedatabase,alltherunningnodesinthedatabasearestoppedandthestatusofthedatabasebecomesStopped.
Formoreinformationaboutdatabasestates,see"GettingtheStatusofHADB"onpage92.
Tostopadatabase,usethehadbmstopcommand.
Thecommandsyntaxis:hadbmstop[--adminpassword=password|--adminpasswordfile=file][--agent=maurl][dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
See"GeneralOptions"onpage61foradescriptionofcommandoptions.
Formoreinformation,seehadbm-stop(1).
EXAMPLE3–10ExampleofstoppingadatabasehadbmstopRestartingaDatabaseYoumightwanttorestartadatabaseifyounoticestrangebehavior(forexampleconsistenttimeoutproblems).
Insomecases,arestartmaysolvetheproblem.
Whenyourestartadatabase,y,thedatabaseanditsdataremainavailable.
WhenyoustopandstartHADBinseparateoperations,dataanddatabaseservicesareunavailablewhileHADBisstopped.
Thisisbecausebydefaulthadbmrestartperformsarollingrestartofnodes:itstopsandstartsthenodesonebyone.
Incontrast,hadbmstopstopsallnodessimultaneously.
Torestartadatabase,usethehadbmrestartcommand.
Thecommandsyntaxis:hadbmrestart[--adminpassword=password|--adminpasswordfile=file]ManagingHADBChapter3AdministeringHighAvailabilityDatabase83[--agent=maurl][--no-rolling][dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
Thiscommandhasonespecialoption,--no-rolling(shortform-g),thatspecifiestorestartallnodesatonce,whichcauseslossofservice.
Withoutthisoption,thiscommandrestartseachofthenodesinthedatabasetothecurrentstateorabetterstate.
See"GeneralOptions"onpage61foradescriptionofothercommandoptions.
Formoreinformation,seehadbm-restart(1).
Forexample:hadbmrestartListingDatabasesTolistallthedatabasesinanHADBinstance,usethehadbmlistcommand.
Thecommandsyntaxis:hadbmlist[--agent=maurl][--adminpassword=password|--adminpasswordfile=file]See"GeneralOptions"onpage61foradescriptionofcommandoptions.
Formoreinformation,seehadbm-list(1).
ClearingadatabaseClearadatabasewhen:Thehadbmstatuscommandrevealsthatthedatabaseisnon-operationalorifSee"GettingtheStatusofHADB"onpage92.
Multiplenodesdonotrespondandareinwaitingstateforalongtime.
Recoveringfromsessiondatacorruption.
See"RecoveringfromSessionDataCorruption"onpage86Thehadbmclearcommandstopsthedatabasenodes,clearsthedatabasedevices,thenstartsthenodes.
ThiscommanderasestheApplicationServerschemadatastoreinHADB,includingtables,usernames,andpasswords.
Afterrunninghadbmclear,useasadminconfigure-ha-clustertorecreatethedataschema,reconfiguretheJDBCconnectionpool,andreloadthesessionpersistencestore.
Thecommandsyntaxis:ManagingHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200784hadbmclear[--fast][--spares=number][--dbpassword=password|--dbpasswordfile=file][--adminpassword=password|--adminpasswordfile=file][--agent=maurl][dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
Thefollowingtabledescribesthespecialhadbmclearcommandoptions.
See"GeneralOptions"onpage61foradescriptionofotheroptions.
Formoreinformation,seehadbm-clear(1).
TABLE3–12hadbmclearOptionsOptionDescriptionDefault--fast-FSkipsdeviceinitializationwhileinitializingthedatabase.
Donotuseifthediskstoragedeviceiscorrupted.
Notapplicable--spares=number-sNumberofsparenodesthereinitializeddatabasewillhave.
Mustbeevenandlessthanthenumberofnodesinthedatabase.
PreviousnumberofsparesForexample:hadbmclear--fast--spares=2--dbpasswordsecret123RemovingaDatabaseToremoveanexistingdatabase,usethehadbmdeletecommand.
Thiscommanddeletesthedatabase'sconfigurationfiles,devicefiles,andhistoryfiles,andfreessharedmemoryresources.
Thedatabaseyouwanttoremovemustexistandmustbestopped.
See"StoppingaDatabase"onpage83.
Thecommandsyntaxis:hadbmdelete[--adminpassword=password|--adminpasswordfile=file][--agent=maurl][dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
See"GeneralOptions"onpage61foradescriptionofcommandoptions.
Formoreinformation,seehadbm-delete(1).
ManagingHADBChapter3AdministeringHighAvailabilityDatabase85EXAMPLE3–11ExampleofremovingadatabaseThecommand:hadbmdeletedeletesthedefaultdatabase,hadb.
RecoveringfromSessionDataCorruptionThefollowingareindicationsthatsessiondatamaybecorrupted:ErrormessagesappearintheApplicationServersystemlog(server.
log)everytimeanapplicationtriestosavesessionstate.
Errormessagesintheserverlogindicatethatthesessioncouldnotbefoundorcouldnotbeloadedduringsessionactivation.
Sessionsthatareactivatedafterpreviouslybeingpassivatedcontainemptyorincorrectsessiondata.
Whenaninstancefails,failed-oversessionscontainemptyorincorrectsessiondata.
Whenaninstancefails,instancesthattrytoloadafailed-oversessioncauseanerrorintheserverlogindicatingthesessioncouldnotbefoundorcouldnotbeloaded.
TobringthesessionstorebacktoaconsistentstateIfyoudeterminethatthesessionstorehasbeencorrupted,bringitbacktoaconsistentstatebyfollowingthisprocedure:Clearthesessionstore.
Determineifthisactioncorrectstheproblem.
Ifitdoes,thenstop.
Ifnot—forexample,ifyoucontinuetoseeerrorsintheserverlog—thencontinue.
Re-initializethedataspaceonallthenodesandclearthedatainthedatabase.
See"Clearingadatabase"onpage84.
Determineifthisactioncorrectstheproblem.
Ifitdoes,thenstop.
Ifnot—forexample,ifyoucontinuetoseeerrorsintheserverlog—thencontinue.
Deleteandthenrecreatethedatabase.
See"RemovingaDatabase"onpage85and"CreatingaDatabase"onpage65123ManagingHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200786ExpandingHADBTherearetworeasonstoexpandyouroriginalHADBconfiguration:Volumeofsessiondatabeingsavedincreasesbeyondexistingstoragespaceindatadevices.
Transactionsmaystartabortingduetofulldatadevices.
Userloadincreases,exhaustingsystemresources.
Youneedtoaddmorehosts.
ThissectiondescribeshowyoucanexpandHADBwithoutshuttingdownyourApplicationServerclusterordatabase,inparticular:"AddingStorageSpacetoExistingNodes"onpage87"AddingMachines"onpage88"AddingNodes"onpage88"RefragmentingtheDatabase"onpage90"AddingNodesbyRecreatingtheDatabase"onpage91Alsoseerelatedinformationin"MaintainingHADBMachines"onpage99.
AddingStorageSpacetoExistingNodesAddHADBstoragespace:Ifusertransactionsrepeatedlyabortwithoneofthefollowingerrormessages:4592:Nofreeblocksondatadevices4593:NounreservedblocksondatadevicesIfthehadbmdeviceinfocommandconsistentlyreportsinsufficientfreesize.
See"GettingDeviceInformation"onpage94.
Youmayalsowanttoaddstoragespacetoexistingnodesifthereisunuseddiskspaceonthenodesorwhenyouadddiskcapacity.
Forinformationontherecommendeddatadevicesize,see"SpecifyingDeviceSize"onpage68Toaddstoragespacetonodes,usethehadbmsetcommandtoincreasedatadevicesize.
Thecommandsyntaxis:hadbmsetDataDeviceSize=sizewheresizeisthedatadevicesizeinMBytes.
See"GeneralOptions"onpage61foradescriptionofcommandoptions.
ChangingthedatadevicesizeforadatabaseinaFaultTolerantorhigherstateupgradesthesystemwithoutlossofdataoravailability.
Thedatabaseremainsinoperationalduringthereconfiguration.
ChangingdevicesizeonasystemthatisnotFaultTolerantorbettercauseslossofdata.
Formoreinformationaboutdatabasestates,see"DatabaseStates"onpage93.
ExpandingHADBChapter3AdministeringHighAvailabilityDatabase87EXAMPLE3–12ExampleofsettingdatadevicesizeThefollowingcommandisanexampleofsettingdatadevicesize:hadbmsetDataDeviceSize=1024AddingMachinesYoumaywanttoaddmachinesifHADBrequiresmoreprocessingorstoragecapacity.
ToaddanewmachineonwhichtorunHADB,installHADBpackageswithorwithouttheApplicationServerasdescribedinChapter2,"InstallingandSettingUpHighAvailabilityDatabase.
"Foranexplanationofnodetopologyalternatives,seeChapter3,"SelectingaTopology,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2DeploymentPlanningGuide.
ToaddnewmachinestoanexistingHADBinstanceStartmanagementagentsonthenewnodes.
Extendthemanagementdomaintothenewhosts.
Fordetails,seehadbmextenddomaincommand.
Startthenewnodesonthesehosts.
Fordetails,see"AddingNodes"onpage88AddingNodesToincreaseprocessingandstoragecapacityofanHADBsystem,createnewnodesandaddthemtothedatabase.
Afteryouaddnodes,updatethefollowingpropertiesoftheHADBJDBCconnectionpool:Theserverlistproperty.
Steadypoolsize.
Generally,youadd8moreconnectionsforeachnewnode.
Formoreinformation,see"SystemSizing"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2DeploymentPlanningGuide.
Toaddnodes,usethehadbmaddnodescommand.
Thecommandsyntaxis:hadbmaddnodes[--no-refragment][--spares=sparecount][--historypath=path][--devicepath=path][--set=attr-name-value-list][--dbpassword=password|--dbpasswordfile=file]123ExpandingHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200788[--adminpassword=password|--adminpasswordfile=file]--hosts=hostlist[dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
ThedatabasemustbeinHAFaultTolerantorFaultTolerantstate.
Formoreinformationaboutdatabasestates,see"GettingtheStatusofHADB"onpage92.
Ifyoudonotspecifythe--devicepathand--historypathoptions,thenewnodeswillhavethesamedevicepathandusethesamehistoryfilesastheexistingdatabase.
Addingnodesperformsarefragmentationandredistributionoftheexistingdatatoincludethenewnodesinthesystem.
OnlinerefragmentingrequiresthatthedisksfortheHADBnodeshaveenoughspacetocontaintheolddataandthenewdatasimultaneouslyuntilrefragmentingisfinished,thatis,theuserdatasizemustnotexceed50%ofthespaceavailableforuserdata.
Fordetails,see"GettingDeviceInformation"onpage94Note–Thebesttimetoaddnodesiswhenthesystemislightlyloaded.
EXAMPLE3–13ExampleofaddingnodesForexample:hadbmaddnodes--dbpasswordsecret123-adminpassword=password--hostsn6,n7,n8,n9Thefollowingtabledescribesthespecialhadbmaddnodescommandoptions.
See"GeneralOptions"onpage61foradescriptionofotheroptions.
TABLE3–13hadbmaddnodesOptionsOptionDescriptionDefault--no-refragment-rDonotrefragmentthedatabaseduringnodecreation;Inthiscase,refragmentthedatabaselaterusingthehadbmrefragmentcommandtousethenewnodes.
Fordetailsaboutrefragmentation,see"RefragmentingtheDatabase"onpage90Ifyoudonothavesufficientdevicespaceforrefragmentation,recreatethedatabasewithmorenodes.
See"AddingNodesbyRecreatingtheDatabase"onpage91Notapplicable--spares=number-sNumberofnewsparenodesinadditiontothosethatalreadyexist.
Mustbeevenandnotgreaterthanthenumberofnodesadded.
0ExpandingHADBChapter3AdministeringHighAvailabilityDatabase89TABLE3–13hadbmaddnodesOptions(Continued)OptionDescriptionDefault--devicepath=path-dPathtothedevices.
Devicesare:DataDeviceNiLogDevice(nodeinternallogdevice)RelalgDevice(relationalalgebraquerydevice)Thispathmustalreadyexistandbewritable.
Tosetthispathdifferentlyforeachnodeoreachdevice,see"SettingHeterogeneousDevicePaths"onpage68SolarisandLinux:HADB_install_dir/deviceWindows:C:\Sun\AppServer\SUNWhadb\vers,whereversistheHADBversionnumber.
--hosts=hostlist-HComma-separatedlistofnewhostnamesforthenewnodesinthedatabase.
Onenodeiscreatedforeachcomma-separatediteminthelist.
Thenumberofnodesmustbeeven.
IPaddressesofHADBhostsmustbeIPv4addresses.
Usingduplicatehostnamescreatesmultiplenodesonthesamemachinewithdifferentportnumbers.
Makesurethatnodesonthesamemachinearenotmirrornodes.
OddnumberednodesareinoneDRU,evennumberednodesintheother.
If--sparesisused,newsparenodesarethosewiththehighestnumbers.
Ifthedatabasewascreatedwithdoublenetworkinterfaces,thenewnodesmustbeconfiguredinthesameway.
See"ConfiguringNetworkRedundancy"onpage35.
NoneRefragmentingtheDatabaseRefragmentthedatabasetostoredatainnewly-creatednodes.
Refragmentationdistributesdataevenlyacrossallactivenodes.
Torefragmentthedatabase,usethehadbmrefragmentcommand.
Thecommandsyntaxis:hadbmrefragment[--dbpassword=password|--dbpasswordfile=file][--adminpassword=password|--adminpasswordfile=file][--agent=maurl][dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
ThedatabasemustbeinHAFaultTolerantorFaultTolerantstate.
Formoreinformationaboutdatabasestates,see"GettingtheStatusofHADB"onpage92.
See"GeneralOptions"onpage61foradescriptionofcommandoptions.
Formoreinformation,seehadbm-refragment(1).
ExpandingHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200790OnlinerefragmentationrequiresthatthedisksfortheHADBnodeshaveenoughspacetocontaintheolddataandthenewdatasimultaneouslyuntilrefragmentingisfinished,thatis,theuserdatasizemustnotexceed50%ofthespaceavailableforuserdata.
Fordetails,see"GettingDeviceInformation"onpage94Note–Thebesttimetorefragmentthedatabaseiswhenthesystemislightlyloaded.
Ifthiscommandfailsaftermultipleattempts,see"AddingNodesbyRecreatingtheDatabase"onpage91EXAMPLE3–14ExampleofrefragmentingthedatabaseForexample:hadbmrefragment--dbpasswordsecret123AddingNodesbyRecreatingtheDatabaseIfonlinerefragmentationfailspersistentlywhenyouaddnewnodes(eitherduetolackofdatadevicespaceorotherreasons),recreatethedatabasewithnewnodes.
Thiswillleadtothelossofexistinguserdataandschemadata.
ToaddnodesbyrecreatingthedatabaseThisprocedureenablesyoutomaintainHADBavailabilitythroughouttheprocess.
ForeachApplicationServerinstance:a.
DisabletheApplicationServerinstanceintheloadbalancer.
b.
Disablesessionpersistence.
c.
RestarttheApplicationServerinstance.
d.
Re-enabletheApplicationServerinstanceintheloadbalancer.
Ifyoudonotneedtomaintainavailability,youcandisableandre-enablealltheserverinstancesatonceintheloadbalancer.
Thissavestimeandpreventsfailoverofoutdatedsessiondata.
Stopthedatabaseasdescribedin"StoppingaDatabase"onpage83.
Deletethedatabaseasdescribedin"RemovingaDatabase"onpage85.
123ExpandingHADBChapter3AdministeringHighAvailabilityDatabase91Recreatethedatabasewiththeadditionalnodesasdescribedin"CreatingaDatabase"onpage65ReconfiguretheJDBCconnectionpoolasdescribedin"ConfiguringtheJDBCConnectionPool"onpage75Reloadthesessionpersistencestore.
ForeachApplicationServerinstance:a.
DisabletheApplicationServerinstanceintheloadbalancer.
b.
Enablesessionpersistence.
c.
RestarttheApplicationServerinstance.
d.
Re-enabletheApplicationServerinstanceintheloadbalancer.
Ifyoudonotneedtomaintainavailability,youcandisableandre-enablealltheserverinstancesatonceintheloadbalancer.
Thissavestimeandpreventsfailoverofoutdatedsessiondata.
MonitoringHADBYoucanmonitortheactivitiesofHADBby:"GettingtheStatusofHADB"onpage92"GettingDeviceInformation"onpage94"GettingRuntimeResourceInformation"onpage96Thesesectionsbrieflydescribethehadbmstatus,hadbmdeviceinfo,andhadbmresourceinfocommands.
ForinformationoninterpretingHADBinformation,see"Performance"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2PerformanceTuningGuide.
GettingtheStatusofHADBUsethehadbmstatuscommandtodisplaythestatusofthedatabaseoritsnodes.
Thecommandsyntaxis:hadbmstatus[--nodes][--adminpassword=password|--adminpasswordfile=file][--agent=maurl][dbname]4567MonitoringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200792Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
The--nodesoption(shortform-n)displaysinformationoneachnodeinthedatabase.
Formoreinformation,see"NodeStatus"onpage93.
See"GeneralOptions"onpage61foradescriptionofothercommandoptions.
Formoreinformation,seehadbm-status(1).
EXAMPLE3–15ExampleofgettingHADBstatusForexample:hadbmstatus--nodesDatabaseStatesAdatabase'sstatesummarizesitscurrentcondition.
Thefollowingtabledescribesthepossibledatabasestates.
TABLE3–14HADBStatesDatabaseStateDescriptionHigh-AvailabilityFaultTolerant(HAFaultTolerant)DatabaseisfaulttolerantandhasatleastonesparenodeoneachDRU.
FaultTolerantAllthemirrorednodepairsareupandrunning.
OperationalAtleastonenodeineachmirrorednodepairisrunning.
NonOperationalOneormoremirrorednodepairsismissingbothnodes.
Ifthedatabaseisnon-operational,clearthedatabaseasdescribedin"Clearingadatabase"onpage84.
StoppedNonodesarerunninginthedatabase.
UnknownCannotdeterminethestateofthedatabase.
NodeStatusUsethe--nodesoptiontomakethehadbmstatuscommanddisplaythefollowinginformationforeachnodeinthedatabase:NodenumberNameofthemachinewherethenodeisrunningPortnumberofthenodeRoleofthenode.
Foralistofrolesandtheirmeanings,see"RolesofaNode"onpage94Stateofthenode.
Foralistofstatesandtheirmeanings,see"StatesofaNode"onpage94Numberofthecorrespondingmirrornode.
MonitoringHADBChapter3AdministeringHighAvailabilityDatabase93Anode'sroleandstatecanchangeasdescribedinthesesections:"RolesofaNode"onpage94"StatesofaNode"onpage94RolesofaNodeAnodeisassignedaroleduringitscreationandcantakeanyoneoftheseroles:Active:Storesdataandallowsclientaccess.
Activenodesareinmirroredpairs.
Spare:Allowsclientaccess,butdoesnotstoredata.
Afterinitializingdatadevices,monitorsotherdatanodestoinitiaterepairifanothernodebecomesunavailable.
Offline:Providenoservicesuntiltheirrolechanges.
Whenplacedbackonline,itsrolecanchangebacktoitsformerrole.
Shutdown:Anintermediatestepbetweenactiveandoffline,waitingforasparenodetotakeoveritsfunctioning.
Afterthesparenodehastakenover,thenodeistakenoffline.
StatesofaNodeAnodecanbeinanyoneofthefollowingstates:Starting:Thenodeisstarting.
Waiting:Thenodecannotdecideitsstartlevelandisoffline.
Ifasinglenodeisinthisstateformorethantwominutes,stopthenodeandthenstartitattherepairlevel;see"StoppingaNode"onpage81and"StartingaNode"onpage80"Clearingadatabase"onpage84.
Running:Thenodeisprovidingallservicesthatareappropriateforitsrole.
Stopping:Thenodeisintheprocessofstopping.
Stopped:Thenodeisinactive.
Repairofastoppednodeisprohibited.
Recovering:Thenodeisbeingrecovered.
Whenanodefails,themirrornodetakesoverthefunctionsofthefailednode.
Thefailednodetriestorecoverbyusingthedataandlogrecordsinmainmemoryorondisk.
Thefailednodeusesthelogrecordsfromthemirrornodetocatchupwiththetransactionsperformedwhenitwasdown.
Ifrecoveryissuccessful,thenodebecomesactive.
Ifrecoveryfails,thenodestatechangestorepairing.
Repairing:Thenodeisbeingrepaired.
Thisoperationreinitializesthenodeandcopiesthedataandlogrecordsfromthemirrornode.
Repairismoretimeconsumingthanrecovery.
GettingDeviceInformationMonitorfreespaceinHADBdata(diskstorage)devices:Routinely,tocheckthetrendindiskspaceuse.
Aspartofpreventivemaintenance:iftheuserloadhasincreasedandyouwanttoresizeorscalethedatabaseconfiguration.
MonitoringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200794Aspartofscalingupthedatabase:Beforerunninghadbmaddnodestoaddnewnodestothesystem,checkwhetherthereisenoughdevicespace.
Remember,youneedaround40-50%freespaceontheexistingnodestoaddnodes.
Whenyouseemessagesinthehistoryfilesandserver.
logfilesuchasNofreeblocksondatadevicesNounreservedblocksondatadevices.
Usethehadbmdeviceinfocommandtogetinformationaboutfreespaceindatadevices.
Thiscommanddisplaysthefollowinginformationforeachnodeofthedatabase:Totaldevicesizeallocated,inMB(Totalsize).
FreespaceinMB(Freesize).
Percentofdevicecurrentlybeingused(Usage)Thecommandsyntaxis:hadbmdeviceinfo[--details][--adminpassword=password|--adminpasswordfile=file][--agent=maurl][dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
The--detailsoptiondisplaysthefollowingadditionalinformation:Numberofreadoperationsbythedevice.
Numberofwriteoperationsbythedevice.
Nameofthedevice.
See"GeneralOptions"onpage61foradescriptionofothercommandoptions.
Formoreinformation,seehadbm-deviceinfo(1).
Todeterminethespaceavailableforuserdata,takethetotaldevicesize,thensubtractthespacereservedforHADB:fourtimestheLogBufferSize+1%ofthedevicesize.
Ifyoudonotknowthesizeofthelogbuffer,usethecommandhadbmgetlogbufferSize.
Forexample,ifthetotaldevicesizeis128MBandtheLogBufferSizeis24MB,thespaceavailableforuserdatais128–(4x24)=32MB.
Ofthe32MB,halfisusedforreplicateddataandaroundonepercentisusedfortheindices,andonly25percentisavailablefortherealuserdata.
Thespaceavailableforuserdataisthedifferencebetweenthetotalsizeandreservedsize.
Ifthedataisrefragmentedinthefuture,thefreesizemustbeapproximatelyequalto50%ofthespaceavailableforuserdata.
Ifrefragmentationisnotrelevant,thedatadevicescanbeexploitedtotheirmaximum.
Resourceconsumptionwarningsarewrittentothehistoryfileswhenthesystemisrunningshortondevicespace.
FormoreinformationabouttuningHADB,seetheSunJavaSystemApplicationServerPerformanceTuningGuide.
MonitoringHADBChapter3AdministeringHighAvailabilityDatabase95EXAMPLE3–16ExampleofgettingdeviceinformationThefollowingcommand:hadbmdeviceinfo--detailsDisplaysthefollowingexampleresults:NodeNOTotalsizeFreesizeUsageNReadsNWritesDeviceName01281206%100005000C:\Sun\SUNWhadb\hadb.
data.
011281243%100005000C:\Sun\SUNWhadb\hadb.
data.
121281262%95004500C:\Sun\SUNWhadb\hadb.
data.
231281262%95004500C:\Sun\SUNWhadb\hadb.
data.
3GettingRuntimeResourceInformationThehadbmresourceinfocommanddisplaysHADBruntimeresourceinformation.
Youcanusethisinformationtohelpidentifyresourcecontention,andreduceperformancebottlenecks.
Fordetails,see"TuningHADB"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2PerformanceTuningGuide.
Thecommandsyntaxis:hadbmresourceinfo[--databuf][--locks][--logbuf][--nilogbuf][--adminpassword=password|--adminpasswordfile=file][--agent=maurl][dbname]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
Thefollowingtabledescribesthehadbmresourceinfospecialcommandoptions.
See"GeneralOptions"onpage61foradescriptionofothercommandoptions.
Formoreinformation,seehadbm-resourceinfo(1).
TABLE3–15hadbmresourceinfoCommandOptionsOptionDescription--databuf-dDisplaydatabufferpoolinformation.
See"DataBufferPoolInformation"onpage97belowformoreinformation.
--locks-lDisplaylockinformation.
See"LockInformation"onpage97belowformoreinformation.
MonitoringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200796TABLE3–15hadbmresourceinfoCommandOptions(Continued)OptionDescription--logbuf-bDisplaylogbufferinformation.
See"LogBufferInformation"onpage98belowformoreinformation.
--nilogbuf-nDisplaynodeinternallogbufferinformation.
See"NodeInternalLogBufferInformation"onpage98belowformoreinformation.
DataBufferPoolInformationDatabufferpoolinformationcontainsthefollowing:NodeNo:Nodenumber.
Avail:Totalspaceavailableinthepool,inMBytes.
Free:Freespaceavailable,inMBytes.
Access:Cumulativenumberofaccessestothedatabufferfromdatabase,fromstartuntilnow.
Misses:Cumulativenumberofpagefaultsthathaveoccurredfromdatabasestartuntilnow.
Copy-on-Write:Cumulativenumberofpagescopiedinternallyinthedatabufferduetocheckpointing.
Whenausertransactionperformsanoperationonarecord,thepagecontainingtherecordmustbeinthedatabufferpool.
Ifitisnot,amissorapagefaultoccurs.
Thetransactionthenhastowaituntilthepageisretrievedfromthedatadevicefileonthedisk.
Ifthemissrateishigh,increasethedatabufferpool.
Sincethemissesarecumulative,runhadbmresourceinfoperiodicallyandusethedifferencebetweentworunstoseethetrendofmissrate.
Donotbeconcernediffreespaceisverysmall,sincethecheckpointingmechanismwillmakenewblocksavailable.
EXAMPLE3–17ExampledatabufferpoolinformationForexample:NodeNOAvailFreeAccessMissesCopy-on-Write0256128100000500001000125612811000045000950LockInformationLockinformationisasfollows:NodeNo:NodeNumber.
Avail:Totalnumberoflocksavailableonthenode.
Free:Numberoffreelocks.
MonitoringHADBChapter3AdministeringHighAvailabilityDatabase97Waits:Numberoftransactionswaitingtoacquirelocks.
Thisiscumulative.
Onesingletransactioncannotusemorethan25%oftheavailablelocksonanode.
Therefore,transactionsperformingoperationsinlargescaleshouldbeawareofthislimitation.
Itisbesttoperformsuchtransactionsinbatches,whereeachbatchmustbetreatedasaseparatetransaction,thatis,eachbatchcommits.
Thisisneededbecausereadoperationsrunningwithrepeatablereadisolationlevel,anddelete,insert,andupdateoperationsuselocksthatarereleasedonlyafterthetransactionterminates.
TochangetheNumberOfLocks,see"ClearingandArchivingHistoryFiles"onpage101EXAMPLE3–18ExamplelockinformationForexample:NodeNOAvailFreeWaits0500002000010150000200000LogBufferInformationLogbufferinformationis:NodeNo:NodeNumberAvailable:amountofmemoryallocatedforthelogbufferinMBFree:amountoffreememoryinMBDonotworryiffreespaceisverysmall,sinceHADBstartscompressingthelogbuffer.
HADBstartscompressionfromtheheadoftheringbufferandperformsitonconsecutivelogrecords.
CompressioncannotproceedwhenHADBencountersalogrecordthathasnotbeenexecutedbythenodeandreceivedbythemirrornodeEXAMPLE3–19ExampleoflogbufferinformationForexample:NodeNOAvailFree01621163NodeInternalLogBufferInformationNodeinternallogbufferinformationis:NodeNumberAvailable:amountofmemoryallocatedforthelogdeviceinMBFree:amountoffreememoryinMBMonitoringHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust200798EXAMPLE3–20ExampleofinternallogbufferinformationForexample:NodeNOAvailFree01621163MaintainingHADBMachinesHADBachievesfaulttolerancebyreplicatingdataonmirrornodes.
Inaproductionenvironment,amirrornodeisonaseparateDRUfromthenodeitmirrors,asdescribedinSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2DeploymentPlanningGuide.
Afailureisanunexpectedeventsuchasahardwarefailure,powerfailure,oroperatingsystemreboot.
TheHADBtoleratessinglefailures:ofonenode,onemachine(thathasnomirrornodepairs),oneormoremachinesbelongingtothesameDRU,orevenoneentireDRU.
However,HADBdoesnotautomaticallyrecoverfromadoublefailure,whichisthesimultaneousfailureofoneormoremirrornodepairs.
Ifadoublefailureoccurs,youmustclearHADBandrecreateitssessionstore,whicherasesallitsdata.
Therearedifferentmaintenanceprocedures,dependingonwhetheryouneedtoworkonasinglemachineormultiplemachines.
ToperformmaintenanceonasinglemachineThisprocedureisapplicabletobothplannedandunplannedmaintenance,anddoesnotinterruptHADBavailability.
Performthemaintenanceprocedureandgetthemachineupandrunning.
Ensurethatmaisrunning.
IfmarunsasaWindowsserviceorunderinit.
dscripts(recommendedfordeployment),itshouldhavebeenstartedbytheoperatingsystem.
Ifnotstartitmanually.
See"StartingtheManagementAgent"onpage54.
Startallnodesonthemachine.
Formoreinformation,see"StartingaNode"onpage80.
Checkwhetherthenodesareactiveandrunning.
Formoreinformation,see"GettingtheStatusofHADB"onpage921234MaintainingHADBMachinesChapter3AdministeringHighAvailabilityDatabase99ToperformplannedmaintenanceonallHADBmachinesPlannedmaintenanceincludesoperationssuchashardwareandsoftwareupgrades.
ThisproceduredoesnotinterruptHADBavailability.
ForeachsparemachineinthefirstDRU,repeatthesinglemachineprocedureasdescribedin"Toperformmaintenanceonasinglemachine"onpage99,onebyone,foreachmachine.
ForeachactivemachineinthefirstDRU,repeatthesinglemachineprocedureasdescribedin"Toperformmaintenanceonasinglemachine"onpage99,onebyone,foreachmachine.
Repeatstep1andstep2forthesecondDRU.
ToperformplannedmaintenanceonallHADBmachinesThisprocedureisapplicablewhenHADBisonsingleormultiplemachines.
ItinterruptsHADBserviceduringthemaintenanceprocedure.
StopHADB.
See"StoppingaDatabase"onpage83.
Performthemaintenanceprocedureandgetallthemachinesupandrunning.
Ensuremaisrunning.
StartHADB.
Formoreinformation,see"StartingaDatabase"onpage82.
Afteryoucompletethelaststep,HADBdatabecomesavailableagain.
1231234MaintainingHADBMachinesSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007100ToperformunplannedmaintenanceintheeventofafailureCheckthedatabasestate.
See"GettingtheStatusofHADB"onpage92IfthedatabasestateisOperationalorbetter:Themachinesneedingunplannedmaintenancedonotincludemirrornodes.
Followthesinglemachineprocedureforeachfailedmachine,oneDRUatatime.
HADBserviceisnotinterrupted.
IfthedatabasestateisNon-Operational:Themachinesneedingunplannedmaintenanceincludemirrornodes.
OnesuchcaseiswhentheentireHADBisonasinglefailedmachine.
Getallthemachinesupandrunningfirst.
ThenclearHADBandrecreatethesessionstore.
See"Clearingadatabase"onpage84.
ThisinterruptsHADBservice.
ClearingandArchivingHistoryFilesHADBhistoryfilesrecordalldatabaseoperationsanderrormessages.
HADBappendstotheendofexistinghistoryfiles,sothefilesgrowovertime.
Tosavediskspaceandpreventfilesfromgettingtoolarge,periodicallyclearandarchivehistoryfiles.
Toclearadatabase'shistoryfiles,usethehadbmclearhistorycommand.
Thecommandsyntaxis:hadbmclearhistory[--saveto=path][dbname][--adminpassword=password|--adminpasswordfile=file][--agent=maurl]Thedbnameoperandspecifiesthedatabasename.
Thedefaultishadb.
Usethe--savetooption(shortform-o)tospecifythedirectoryinwhichtostoretheoldhistoryfiles.
Thisdirectorymusthaveappropriatewritepermissions.
See"GeneralOptions"onpage61foradescriptionofothercommandoptions.
Formoreinformation,seehadbm-clearhistory(1).
The--historypathoptionofthehadbmcreatecommanddeterminesthelocationofthehistoryfiles.
Thenamesofthehistoryfilesareoftheformatdbname.
out.
nodeno.
Forinformationonhadbmcreate,see"CreatingaDatabase"onpage65MaintainingHADBMachinesChapter3AdministeringHighAvailabilityDatabase101HistoryFileFormatEachmessageinthehistoryfilecontainsthefollowinginformation:TheabbreviatednameoftheHADBprocessthatproducedthemessage.
Thetypeofmessage:INF-generalinformationWRN-warningsERR-errorsDBG-debuginformationAtimestamp.
Thetimeisobtainedfromthehostmachinesystemclock.
Theservicesetchangesoccurringinthesystemwhenanodestopsorstarts.
Messagesaboutresourceshortagescontainthestring"HIGHLOAD.
"Youdonotneedadetailedknowledgeofallentriesinthehistoryfile.
Ifforanyreasonyouneedtostudyahistoryfileingreaterdetail,contactSuncustomersupport.
MaintainingHADBMachinesSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007102ConfiguringLoadBalancingandFailoverThissectiondescribestheHTTPloadbalancerplug-in.
Itincludesthefollowingtopics:"HowtheLoadBalancerWorks"onpage103"SettingUpHTTPLoadBalancing"onpage105"ConfiguringWebServersforLoadBalancing"onpage107"ConfiguringtheLoadBalancer"onpage116"ConfiguringHTTPandHTTPSFailover"onpage123"UpgradingApplicationsWithoutLossofAvailability"onpage125HowtheLoadBalancerWorksTheloadbalancerattemptstoevenlydistributetheworkloadamongmultipleApplicationServerinstances(eitherstand-aloneorclustered),therebyincreasingtheoverallthroughputofthesystem.
Usingaloadbalanceralsoenablesrequeststofailoverfromoneserverinstancetoanother.
ForHTTPsessioninformationtopersist,configureHTTPsessionpersistence.
Formoreinformation,seeChapter8,"ConfiguringHighAvailabilitySessionPersistenceandFailover"Forcompleteinstructionsonconfiguringloadbalancing,seetheSunJavaSystemApplicationServerHighAvailabilityAdministrationGuide.
Usetheasadmintool,nottheAdminConsole,toconfigureHTTPloadbalancing.
"AssignedRequestsandUnassignedRequests"onpage104"HTTPLoadBalancingAlgorithm"onpage104"SampleApplications"onpage104SeeAlso:"PrerequisitesforSettingUpLoadBalancing"onpage105"AssignedRequestsandUnassignedRequests"onpage1044CHAPTER4103"HTTPLoadBalancingAlgorithm"onpage104"ProceduretoSetUpLoadBalancing"onpage106AssignedRequestsandUnassignedRequestsWhenarequestfirstcomesinfromanHTTPclienttotheloadbalancer,itisarequestforanewsession.
Arequestforanewsessioniscalledanunassignedrequest.
Theloadbalancerroutesthisrequesttoanapplicationserverinstanceintheclusteraccordingtoaround-robinalgorithm.
Onceasessioniscreatedonanapplicationserverinstance,theloadbalancerroutesallsubsequentrequestsforthissessiononlytothatparticularinstance.
Arequestforanexistingsessioniscalledanassignedorastickyrequest.
HTTPLoadBalancingAlgorithmTheSunJavaSystemApplicationServerloadbalancerusesastickyroundrobinalgorithmtoloadbalanceincomingHTTPandHTTPSrequests.
Allrequestsforagivensessionaresenttothesameapplicationserverinstance.
Withastickyloadbalancer,thesessiondataiscachedonasingleapplicationserverratherthanbeingdistributedtoallinstancesinacluster.
Therefore,thestickyroundrobinschemeprovidessignificantperformancebenefitsthatnormallyoverridethebenefitsofamoreevenlydistributedloadobtainedwithapureroundrobinscheme.
WhenanewHTTPrequestissenttotheloadbalancerplug-in,it'sforwardedtoanapplicationserverinstancebasedonasimpleroundrobinscheme.
Subsequently,thisrequestis"stuck"tothisparticularapplicationserverinstance,eitherbyusingcookies,orexplicitURLrewriting.
Fromthestickyinformation,theloadbalancerplug-infirstdeterminestheinstancetowhichtherequestwaspreviouslyforwarded.
Ifthatinstanceisfoundtobehealthy,theloadbalancerplug-inforwardstherequesttothatspecificapplicationserverinstance.
Therefore,allrequestsforagivensessionaresenttothesameapplicationserverinstance.
Theloadbalancerplug-inusesthefollowingmethodstodeterminesessionstickiness:CookieMethod:theloadbalancerplug-inusesaseparatecookietorecordtherouteinformation.
TheHTTPclientmustsupportcookiestousethecookiebasedmethod.
ExplicitURLRewriting:thestickyinformationisappendedtotheURL.
ThismethodworkseveniftheHTTPclientdoesnotsupportcookies.
SampleApplicationsThefollowingdirectoriescontainsampleapplicationsthatdemonstrateloadbalancingandfailover:HowtheLoadBalancerWorksSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007104install_dir/samples/ee-samples/highavailabilityinstall_dir/samples/ee-samples/failoverTheee-samplesdirectoryalsocontainsinformationforsettingupyourenvironmenttorunthesamples.
SettingUpHTTPLoadBalancingThissectiondescribeshowtosetuptheLoadBalancerplug-inandincludesthefollowingsections:"PrerequisitesforSettingUpLoadBalancing"onpage105"HTTPLoadBalancerDeployments"onpage105"ProceduretoSetUpLoadBalancing"onpage106PrerequisitesforSettingUpLoadBalancingBeforeconfiguringyourloadbalancer,youmust:Installawebserver.
Installtheloadbalancerplug-in.
Forinformationontheinstallationprocedure,seetheSunJavaSystemApplicationServerInstallationGuide(ifusingthestand-aloneApplicationServer)ortheSunJavaEnterpriseSystemInstallationGuide(ifusingJavaEnterpriseSystem).
Configurethewebserver.
Formoreinformation,see"ConfiguringWebServersforLoadBalancing"onpage107CreateApplicationServerclustersorserverinstancestoparticipateinloadbalancing.
Deployapplicationstotheseclustersorinstances.
HTTPLoadBalancerDeploymentsYoucanconfigureyourloadbalancerindifferentways,dependingonyourgoalsandenvironment,asdescribedinthefollowingsections:"UsingClusteredServerInstances"onpage106"UsingaSingle,Stand-AloneInstancewithLoadBalancerUsedasaReverse-ProxyPlug-in"onpage106"UsingMultipleStand-AloneInstances"onpage106SettingUpHTTPLoadBalancingChapter4ConfiguringLoadBalancingandFailover105UsingClusteredServerInstancesThemostcommonwaytodeploytheloadbalanceriswithaclusterorclustersofserverinstances.
Bydefaultalltheinstancesinaclusterhavethesameconfigurationandthesameapplicationsdeployedtothem.
Theloadbalancerdistributestheworkloadbetweentheserverinstancesandrequestsfailoverfromanunhealthyinstancetoahealthyone.
Ifyou'veconfiguredHTTPsessionpersistence,sessioninformationpersistswhentherequestisfailedover.
Ifyouhavemultipleclusters,requestsareonlyloadbalancedandfailedoverbetweentheinstancesinasinglecluster.
Usemultipleclustersinaloadbalancertoeasilyenablerollingupgradesofapplications.
Formoreinformation,see"UpgradingApplicationsWithoutLossofAvailability"onpage125.
UsingaSingle,Stand-AloneInstancewithLoadBalancerUsedasaReverse-ProxyPlug-inYoucanalsoconfigureyourloadbalancertousestand-aloneserverinstanceinsteadofacluster.
Thisconfigurationresultsintheloadbalancerplug-inworkingasareverse-proxyplug-in(sometimescalledapass-throughplug-in).
Whenthewebserverreceivesrequestsforapplicationsenabledintheloadbalancer,itforwardstherequestsdirectlytotheApplicationServer.
Usethesameprocedurestoconfiguretheloadbalancerforapass-throughplug-inasyouusetoconfigureitforaclusterofserverinstances.
UsingMultipleStand-AloneInstancesItisalsopossibletoconfigureyourloadbalancertousemultiplestand-aloneinstances,andloadbalanceandfail-overrequestsbetweenthem.
However,inthisconfiguration,youmustmanuallyensurethatthestand-aloneinstanceshavehomogenousenvironmentsandthesameapplicationsdeployedtothem.
Becauseclustersautomaticallymaintainahomogenousenvironment,formostsituationsitisbetterandeasiertouseclusters.
ProceduretoSetUpLoadBalancingUsetheasadmintooltoconfigureloadbalancinginyourenvironment.
Formoreinformationontheasadmincommandsusedinthesesteps,see"ConfiguringtheLoadBalancer"onpage116ToSetUpLoadBalancingCreatealoadbalancerconfigurationusingtheasadmincommandcreate-http-lb-config.
1SettingUpHTTPLoadBalancingSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007106Addareferencetoaclusterorstand-aloneserverinstancefortheloadbalancertomanageusingasadmincreate-http-lb-ref.
Ifyoucreatedtheloadbalancerconfigurationwithatarget,andthattargetistheonlyclusterorstand-aloneserverinstancetheloadbalancerreferences,skipthisstep.
Enabletheclusterorstand-aloneserverinstancereferencedbytheloadbalancerusingasadminenable-http-lb-server.
Enableapplicationsforloadbalancingusingasadminenable-http-lb-application.
Theseapplicationsmustalreadybedeployedandenabledforuseontheclustersorstand-aloneinstancesthattheloadbalancerreferences.
Enablingforloadbalancingisaseparatestepfromenablingthemforuse.
Createahealthcheckerusingasadmincreate-health-checker.
Thehealthcheckermonitorsunhealthyserverinstancessothatwhentheybecomehealthyagain,theloadbalancercansendnewrequeststothem.
Generatetheloadbalancerconfigurationfileusingasadminexport-http-lb-config.
Thiscommandgeneratesaconfigurationfiletousewiththeloadbalancerplug-inshippedwiththeSunJavaSystemApplicationServer.
Copytheloadbalancerconfigurationfiletoyourwebserverconfigdirectorywheretheloadbalancerplug-inconfigurationfilesarestored.
ConfiguringWebServersforLoadBalancingTheloadbalancerplug-ininstallationprogrammakesafewmodificationstothewebserver'sconfigurationfiles.
Thechangesmadedependuponthewebserver.
Note–Theloadbalancerplug-incanbeinstalledeitheralongwithSunJavaSystemApplicationServerEnterpriseEdition,orseparately,onamachinerunningthesupportedwebserver.
Forcompletedetailsontheinstallationprocedure,seeChapter1,"InstallingApplicationServerSoftware,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2InstallationGuide(ifusingthestandaloneApplicationServer)orSunJavaEnterpriseSystem2005Q5InstallationGuide(ifusingJavaEnterpriseSystem).
"ModificationstoSunJavaSystemWebServer"onpage108"UsingApacheWebServer"onpage108"Installation"onpage41"ConfiguringMultipleWebServerInstances"onpage115234567ConfiguringWebServersforLoadBalancingChapter4ConfiguringLoadBalancingandFailover107ModificationstoSunJavaSystemWebServerTheinstallationprogramaddsthefollowingentriestotheSunJavaSystemWebServer'sconfigurationfiles:Tothewebserverinstance'smagnus.
conffile,itadds:##EElb-pluginInitfn="load-modules"shlib="web_server_install_dir/plugins/lbplugin/bin/libpassthrough.
so"funcs="init-passthrough,service-passthrough,name-trans-passthrough"Thread="no"Initfn="init-passthrough"##endadditionforEElb-pluginTothewebserverinstance'sobj.
conffile,itadds:NameTransfn="name-trans-passthrough"name="lbplugin"config-file="web_server_install_dir/web_server_instance/config/loadbalancer.
xml"ObjectTypefn="force-type"type="magnus-internal/lbplugin"PathCheckfn="deny-existence"path="*/WEB-INF/*"Servicetype="magnus-internal/lbplugin"fn="service-passthrough"Errorreason="BadGateway"fn="send-error"uri="$docroot/badgateway.
html"Intheabovecode,lbpluginisanamethatuniquelyidentifiestheObject,andweb_server_install_dir/web_server_instance/config/loadbalancer.
xmlisthelocationoftheXMLconfigurationfileforthevirtualserveronwhichtheloadbalancerisconfiguredtorun.
Afterinstalling,configuretheloadbalancerasdescribedin"SettingUpHTTPLoadBalancing"onpage105UsingApacheWebServerTouseApacheWebServer,youmustperformcertainconfigurationstepsbeforeinstallingtheloadbalancerplug-in.
Theloadbalancerplug-ininstallationalsomakesadditionalmodificationstotheApacheWebServer.
Aftertheplug-inisinstalled,youmustperformadditionalconfigurationsteps.
ConfiguringWebServersforLoadBalancingSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007108Note–OnApache1.
3,whenmorethanoneApachechildprocessesruns,eachprocesshasitsownloadbalancingroundrobinsequence.
Forexample,iftherearetwoApachechildprocessesrunning,andtheloadbalancerplug-inloadbalancesontotwoapplicationserverinstances,thefirstrequestissenttoinstance#1andthesecondrequestisalsosenttoinstance#1.
Thethirdrequestissenttoinstance#2andthefourthrequestissenttoinstance#2again.
Thispatternisrepeated(instance1,instance1,instance2,instance2,etc.
)Thisbehaviorisdifferentfromwhatyoumightexpect,thatis,instance1,instance2,instance1,instance2,etc.
InSunJavaSystemApplicationServer,theloadbalancerplug-inforApacheinstantiatesaloadbalancerinstanceforeachApacheprocess,creatinganindependentloadbalancingsequence.
Apache2.
0hasmultithreadedbehaviorifcompiledwiththe--with-mpm=workeroption.
"RequirementsforUsingApacheWebServer"onpage109"ConfigurationbeforeInstallingtheLoadBalancerPlug-in"onpage110"ModificationsMadebytheApplicationServerInstaller"onpage112"ToconfigureApacheSecurityFilestoworkwiththeLoadBalancer"onpage113RequirementsforUsingApacheWebServerFortheApacheWebServer,yourinstallationmustmeettheminimumrequirements,dependingontheversionofApache.
RequirementsforApache1.
3WithApache1.
3,theloadbalancerplug-inrequires:openssl-0.
9.
7e(source)mod_ssl-2.
8.
16-1.
3.
x(source),wherexrepresentstheversionofApache.
Themod_sslversionmustmatchtheApacheversion.
gcc-3.
3-sol9-sparc-localpackages(forSolarisSPARC)gcc-3.
3-sol9-intel-localpackages(forSolarisx86)flex-2.
5.
4a-sol9-sparc-localpackages(forSolarisSPARC)flex-2.
5.
4a-sol9-intel-localpackages(forSolarisx86)Thesoftwaresourcesareavailableathttp://www.
sunfreeware.
comInaddition,beforecompilingApache:OntheLinuxplatform,installSunJavaSystemApplicationServeronthesamemachine.
OntheSolarisoperatingsystem,ensurethatgccversion3.
3andmakeareinthePATH,andflexisinstalled.
OntheSolaris10operatingsystem,beforerunningmakeforOpenSSL,runmkheaders,locatedin/usr/local/lib/gcc-lib/sparc-sun-solaris2.
9/3.
3/install-toolsonSolarisSPARCor/usr/local/lib/gcc-lib/i386-pc-solaris2.
9/3.
3/install-toolsonSolarisx86.
ConfiguringWebServersforLoadBalancingChapter4ConfiguringLoadBalancingandFailover109IfyouareusinggcconRedHatEnterpriseLinuxAdvancedServer2.
1,theversionmustbelaterthangcc3.
0.
Note–TouseCcompilerotherthangcc,setthepathoftheCcompilerandmakeutilityinthePATHenvironmentvariable.
Forexample,withtheshshell:exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:appserver_installdir/libMinimumRequirementsforApache2WithApache2.
0,theloadbalancerplug-inrequires:openssl-0.
9.
7e(source)httpd-2.
0.
49(source)gcc-3.
3-sol9-sparc-localpackages(forSolarisSPARC).
gcc-3.
3-sol9-intel-localpackages(forSolarisx86)flex-2.
5.
4a-sol9-sparc-localpackages(forSolarisSPARC)flex-2.
5.
4a-sol9-intel-localpackages(forSolarisx86)Thesoftwaresourcesareavailableathttp://www.
sunfreeware.
comInaddition,beforecompilingApache:OntheLinuxplatform,installSunJavaSystemApplicationServeronthesamemachine.
OntheSolarisoperatingsystem,ensurethatgccversion3.
3andmakeareinthePATH,andflexisinstalled.
OntheSolaris10operatingsystem,beforerunningmakeforOpenSSL,runmkheaders,locatedin/usr/local/lib/gcc-lib/sparc-sun-solaris2.
9/3.
3/install-toolsonSolarisSPARCor/usr/local/lib/gcc-lib/i386-pc-solaris2.
9/3.
3/install-toolsonSolarisx86.
IfyouareusinggcconRedHatEnterpriseLinuxAdvancedServer2.
1,theversionmustbelaterthangcc3.
0.
Note–TouseaCcompilerotherthangcc,setthepathoftheCcompilerandmakeutilityinthePATHenvironmentvariable.
Forexample,withtheshshell:exportLD_LIBRARY_PATH=app_server_install_dir/lib:$LD_LIBRARY_PATH.
ConfigurationbeforeInstallingtheLoadBalancerPlug-inBeforeinstallingtheloadbalancerplug-inforApache,installtheApacheWebServer.
TheApachesourcemustbecompiledandbuilttorunwithSSL.
Thissectiondescribestheminimumrequirementsandhigh-levelstepsneededtosuccessfullycompileApacheWebServertoruntheloadbalancerplug-in.
TheserequirementsandstepsonlyapplytotheSolarisandLinuxversionsofthesoftware.
ForinformationontheWindowsversionofApache,seetheApachewebsite.
ConfiguringWebServersforLoadBalancingSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007110ToInstallSSL-awareApacheYoumusthavealreadydownloadedanduncompressedtheApachesoftware.
DownloadandunpacktheOpenSSLsource.
CompileandbuildOpenSSL.
ThisstepisnotrequiredontheLinuxplatformifOpenSSL0.
9.
7.
eisinstalled.
Enterthesecommands:cdopenssl-0.
9.
7emakemakeinstallFormoreinformationaboutOpenSSL,seethehttp://www.
openssl.
org/.
Followoneoftheseprocedures,dependingontheversionofApache:ForApache1.
3,configureApachewithmod_sslwiththefollowingsteps:a.
Unpackthemod_sslsource.
b.
cdmod_ssl-2.
8.
14–1.
3.
xc.
.
/configure–with-apache=.
.
/apache_1.
3.
x--with-ssl=.
.
/openssl-0.
9.
7e--prefix=install_path--enable-module=ssl--enable-shared=ssl--enable-rule=SHARED_CORE--enable-module=soIntheabovecommands,xistheApacheversionnumber,andinstall_pathisthedirectoryinwhichtoinstallApache.
Formoreinformationonmod_ssl,seehttp://www.
modssl.
org.
ForApache2.
0,configurethesourcetree:a.
cdhttp-2.
0_x.
b.
Run.
/configure--with-ssl=open_ssl_install_path--prefix=install_path--enable-ssl--enable-soIntheabovecommands,xistheApacheversionnumber,open_ssl_install_pathisthedirectorywhereOpenSSLisinstalled,andinstall_pathisthedirectoryinwhichtoinstallApache.
ForApacheonLinux2.
1,beforecompiling:a.
Opensrc/MakeFileandfindtheendoftheautomaticallygeneratedsection.
BeforeYouBegin1234ConfiguringWebServersforLoadBalancingChapter4ConfiguringLoadBalancingandFailover111b.
Addthefollowinglinesafterthefirstfourlinesaftertheautomaticallygeneratedsection:LIBS+=-licuuc-licui18n-lnspr4-lpthread-lxerces-c-lsupport-lnsprwrap-lns-httpd40LDFLAGS+=-L/appserver_installdir/lib-L/opt/sun/private/libNotethat-L/opt/sun/private/libisonlyrequiredifyouinstalledApplicationServeraspartofaJavaEnterpriseSysteminstallation.
Forexample:##(Endofautomaticallygeneratedsection)##CFLAGS=$(OPTIM)$(CFLAGS1)$(EXTRA_CFLAGS)LIBS=$(EXTRA_LIBS)$(LIBS1)INCLUDES=$(INCLUDES1)$(INCLUDES0)$(EXTRA_INCLUDES)LDFLAGS=$(LDFLAGS1)$(EXTRA_LDFLAGS)"LIBS+=-licuuc-licui18n-lnspr4-lpthread-lxerces-c-lsupport-lnsprwrap-lns-httpd40LDFLAGS+=-L/appserver_installdir/lib-L/opt/sun/private/libc.
SetenvironmentvariableLD_LIBRARY_PATH.
Withallinstallations,setitto:appserver_install_dir/libWithJavaEnterpriseSystemInstallations,setittoappserver_install_dir/lib:opt/sun/private/lib.
CompileApacheasdescribedintheinstallationinstructionsfortheversionyouareusing.
Formoreinformation,seethehttp://httpd.
apache.
org/Ingeneralthestepsare:a.
makeb.
makecertificate(Apache1.
3only)c.
makeinstallThecommandmakecertificateasksforasecurepassword.
RememberthispasswordasitisrequiredforstartingsecureApache.
ConfigureApacheforyourenvironment.
ModificationsMadebytheApplicationServerInstallerTheloadbalancerplug-ininstallationprogramextractsthenecessaryfilestoadirectoryinthewebserver'srootdirectory:ForApache1.
3,thedirectoryislibexec.
56ConfiguringWebServersforLoadBalancingSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007112ForApache2.
0,thedirectoryismodules.
Itaddsthefollowingentriestothewebserverinstance'shttpd.
conffile:##AdditionforEElb-pluginLoadFile/usr/lib/libCstd.
so.
1LoadModuleapachelbplugin_modulelibexec/mod_loadbalancer.
so#AddModulemod_apachelbplugin.
cppconfig-filewebserver_instance/conf/loadbalancer.
xmllocaleenDocumentRoot"webserver_instance/htdocs"ServerNameserver_name##ENDEELBPluginParametersVersion7ToconfigureApacheSecurityFilestoworkwiththeLoadBalancerApacheWebServermusthavethecorrectsecurityfilestoworkwellwiththeloadbalancerplug-in.
Createadirectorycalledsec_db_filesunderapache_install_dir.
Copyapplication_server_domain_dir/config/*.
dbtoapache_install_dir/sec_db_files.
Dependingontheplatform,performadditionalconfiguration.
OntheSolarisplatform:Addthepath/usr/lib/mps/secv1toLD_LIBRARY_PATHintheapache_install_dir/bin/apachectlscript.
Thepathmustbeaddedbefore/usr/lib/mps.
OnLinux:Addthepath/opt/sun/private/libtoLD_LIBRARY_PATHintheapache_install_dir/bin/apachectlscript.
Thepathmustbeaddedbefore/usr/lib.
OnMicrosoftWindows:a.
AddanewpathtothePathenvironmentvariable.
ClickStart->Settings->ControlPanel->System->Advanced->EnvironmentVariables->SystemVariables.
Addapplication_server_install_dir/bintothePathenvironmentvariable.
123ConfiguringWebServersforLoadBalancingChapter4ConfiguringLoadBalancingandFailover113b.
SettheenvironmentvariableNSPR_NATIVE_THREADS_ONLYto1.
IntheEnvironmentVariableswindow,underSystemVariables,clickNew.
EnterVariablenameofNSPR_NATIVE_THREADS_ONLYandVariablevalueof1.
c.
Restartthemachine.
ModificationstoMicrosoftIISToconfigureMicrosoftInternetInformationServices(IIS)tousetheloadbalancerplug-in,modifycertainpropertiesinWindowsInternetServicesManager.
TheInternetServicesManagerislocatedintheAdministrativeToolsfolderintheControlPanelfolder.
MakethesemodificationsafterinstallingtheSunJavaSystemApplicationServer.
ToConfigureMicrosoftIIStousetheLoadBalancerPlug-inOpentheInternetServicesManager.
Selectthewebsiteforwhichyouwanttoenabletheplug-in.
ThiswebsiteistypicallynamedtheDefaultWebSite.
RightclickonthewebsiteandselectPropertiestoopenthePropertiesnotebook.
AddanewISAPIfilter,followingthesesteps:a.
OpentheISAPIFilterstab.
b.
ClickAdd.
c.
IntheFilterNamefield,enterApplicationServerd.
IntheExecutablefield,typeC:\Inetpub\wwwroot\sun-passthrough\sun-passthrough.
dlle.
ClickOK,andclosethePropertiesnotebook.
Createandconfigureanewvirtualdirectory:a.
Rightclickonthedefaultwebsite,selectNew,andthenVirtualDirectory.
TheVirtualDirectoryCreationWizardopens.
b.
IntheAliasfield,typesun-passthrough.
12345ConfiguringWebServersforLoadBalancingSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007114c.
IntheDirectoryfield,typeC:\Inetpub\wwwroot\sun-passthrough.
d.
ChecktheExecutePermissioncheckbox.
Leaveallotherpermission-relatedcheckboxesareleftunchecked.
e.
ClickFinish.
Addthepathofsun-passthrough.
dllfileandapplication_server_install_dir/bintothesystem'sPATHenvironmentvariable.
Restartthemachine.
Stopandstartthewebserverforthenewsettingstotakeeffect.
Tostopthewebserver,rightclickonthewebsiteandselectStop.
Tostartthewebserver,rightclickonthewebsiteandselectStart.
Verifythatthewebserver,loadbalancerplug-in,andApplicationServerareoperatingcorrectly.
Typethefollowinginawebbrowsertoaccessthewebapplicationcontextroot:http://webserver_name/web_application,wherewebserver_nameisthehostnameorIPaddressofthewebserverandweb_applicationisthecontextrootthatyoulistedintheC:\Inetpub\wwwroot\sun-passthrough\sun-passthrough.
propertiesfile.
AutomaticallyconfiguredSun-passthroughpropertiesTheinstallerautomaticallyconfiguresthefollowingpropertiesinsun-passthrough.
properties.
Youcanchangethedefaultvalues.
PropertyDefinitionDefaultValuelb-config-filePathtotheloadbalancerconfigurationfileIIS_www_root\sun-passthrough\loadbalancer.
xmllog-filePathtotheloadbalancerlogfileIIS_www_root\sun-passthrough\lb.
loglog-levelLoglevelforthewebserverINFOConfiguringMultipleWebServerInstancesTheSunJavaSystemApplicationServerinstallerdoesnotallowtheinstallationofmultipleloadbalancerplug-insonasinglemachine.
Tohavemultiplewebserverswiththeloadbalancerplug-inonasinglemachine,ineitherasingleclusterormultipleclusters,afewmanualstepsarerequiredtoconfiguretheloadbalancerplug-in.
6789ConfiguringWebServersforLoadBalancingChapter4ConfiguringLoadBalancingandFailover115ToConfigureMultipleWebServerInstancesConfigurethenewwebserverinstancetousetheloadbalancerplug-in.
Followthestepsin"ModificationstoSunJavaSystemWebServer"onpage108or"UsingApacheWebServer"onpage108,or"Installation"onpage41CopytheDTDfile.
Copysun-loadbalancer_1_1.
dtdfromtheexistingwebserverinstance'sconfigdirectorytothenewinstance'sconfigdirectory.
Setuptheloadbalancerconfigurationfile.
Either:Copytheexistingloadbalancerconfiguration.
Useanexistingloadbalancerconfiguration,copytheloadbalancer.
xmlfilefromtheexistingwebserverinstance'sconfigdirectorytothenewinstance'sconfigdirectory.
Createanewloadbalancerconfiguration:a.
Useasadmincreate-http-lb-configtocreateanewloadbalancerconfiguration.
b.
Exportthenewconfigurationtoaloadbalancer.
xmlfileusingasadminexporthttp-lb-config.
c.
Copythatloadbalancer.
xmlfiletothenewwebserver'sconfigdirectory.
Forinformationoncreatingaloadbalancerconfigurationandexportingittoaloadbalancer.
xmlfile,see"CreatinganHTTPLoadBalancerConfiguration"onpage117ConfiguringtheLoadBalancerAloadbalancerconfigurationisanamedconfigurationinthedomain.
xmlfile.
Loadbalancerconfigurationisextremelyflexible:Eachloadbalancerconfigurationcanhavemultipleloadbalancersassociatedwithit,thougheachloadbalancerhasonlyoneloadbalancerconfiguration.
Aloadbalancerservicesonlyonedomain,thoughadomaincanhavemultipleloadbalancersassociatedwithit.
Thissectiondescribeshowtocreate,modify,andusealoadbalancerconfiguration,includingthefollowingtopics:"CreatinganHTTPLoadBalancerConfiguration"onpage117"CreatinganHTTPLoadBalancerReference"onpage117123ConfiguringtheLoadBalancerSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007116"EnablingServerInstancesforLoadBalancing"onpage118"EnablingApplicationsforLoadBalancing"onpage118"CreatingtheHTTPHealthChecker"onpage118"ExportingtheLoadBalancerConfigurationFile"onpage120"ChangingtheLoadBalancerConfiguration"onpage121"EnablingDynamicReconfiguration"onpage121"Disabling(Quiescing)aServerInstanceorCluster"onpage121"Disabling(Quiescing)anApplication"onpage122CreatinganHTTPLoadBalancerConfigurationCreatealoadbalancerconfigurationusingtheasadmincommandcreate-http-lb-config.
"CreatinganHTTPLoadBalancerConfiguration"onpage117describestheparameters.
Formoreinformationseethedocumentationforcreate-http-lb-config,delete-http-lb-config,andlist-http-lb-configs.
TABLE4–1LoadBalancerConfigurationParametersParameterDescriptionresponsetimeoutTimeinsecondswithinwhichaserverinstancemustreturnaresponse.
Ifnoresponseisreceivedwithinthetimeperiod,theserverisconsideredunhealthy.
Thedefaultis60.
HTTPSroutingWhetherHTTPSrequeststotheloadbalancerresultinHTTPSorHTTPrequeststotheserverinstance.
Formoreinformation,see"ConfiguringHTTPSRouting"onpage123.
reloadintervalIntervalbetweenchecksforchangestotheloadbalancerconfigurationfileloadbalancer.
xml.
Whenthecheckdetectschanges,theconfigurationfileisreloaded.
Avalueof0disablesreloading.
Formoreinformation,see"EnablingDynamicReconfiguration"onpage121monitorWhethermonitoringisenabledfortheloadbalancer.
routecookieNameofthecookietheloadbalancerplug-inusestorecordtherouteinformation.
TheHTTPclientmustsupportcookies.
Ifyourbrowserissettoaskbeforestoringacookie,thenameofthecookieisJROUTE.
targetTargetfortheloadbalancerconfiguration.
Ifyouspecifyatarget,itisthesameasaddingareferencetoit.
Targetscanbeclustersorstand-aloneinstances.
CreatinganHTTPLoadBalancerReferenceWhenyoucreateareferenceintheloadbalancertoastand-aloneserverorcluster,theserverorclusterisaddedtothelistoftargetserversandclusterstheloadbalancercontrols.
Thereferencedserverorclusterstillneedstobeenabled(usingenable-http-lb-server)beforerequeststoitareloadbalanced.
Ifyoucreatedtheloadbalancerconfigurationwithatarget,thattargetisalreadyaddedasareference.
ConfiguringtheLoadBalancerChapter4ConfiguringLoadBalancingandFailover117Createareferenceusingcreate-http-lb-ref.
Youmustsupplytheloadbalancerconfigurationnameandthetargetserverinstanceorcluster.
Todeleteareference,usedelete-http-lb-ref.
Beforeyoucandeleteareference,thereferencedserverorclustermustbedisabledusingdisable-http-lb-server.
Formoreinformation,seethedocumentationforcreate-http-lb-refanddelete-http-lb-ref.
EnablingServerInstancesforLoadBalancingAftercreatingareferencetotheserverinstanceorcluster,enabletheserverinstanceorclusterusingenable-http-lb-server.
Ifyouusedaserverinstanceorclusterasthetargetwhenyoucreatedtheloadbalancerconfiguration,youmustenableit.
Formoreinformation,seethedocumentationforenable-http-lb-server.
EnablingApplicationsforLoadBalancingAllserversmanagedbyaloadbalancermusthavehomogenousconfigurations,includingthesamesetofapplicationsdeployedtothem.
Onceanapplicationisdeployedandenabledforaccess(thishappensduringorafterthedeploymentstep)youmustenableitforloadbalancing.
Ifanapplicationisnotenabledforloadbalancing,requeststoitarenotloadbalancedandfailedover,evenifrequeststotheserverstheapplicationisdeployedtoareloadbalancedandfailedover.
Whenenablingtheapplication,specifytheapplicationnameandtarget.
Iftheloadbalancermanagesmultipletargets(forexample,twoclusters),enabletheapplicationonalltargets.
Formoreinformation,seetheonlinehelpforenable-http-lb-application.
Ifyoudeployanewapplication,youmustalsoenableitforloadbalancingandexporttheloadbalancerconfigurationagain.
CreatingtheHTTPHealthCheckerTheloadbalancer'shealthcheckerperiodicallychecksalltheconfiguredApplicationServerinstancesthataremarkedasunhealthy.
Ahealthcheckerisnotrequired,butifnohealthcheckerexists,orifthehealthcheckerisdisabled,theperiodichealthcheckofunhealthyinstancesisnotperformed.
Theloadbalancer'shealthcheckmechanismcommunicateswiththeapplicationserverinstanceusingHTTP.
ThehealthcheckersendsanHTTPrequesttotheURLspecifiedandwaitsforaresponse.
AstatuscodeintheHTTPresponseheaderbetween100and500meanstheinstanceishealthy.
ConfiguringtheLoadBalancerSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007118CreatingaHealthCheckerTocreatethehealthchecker,usetheasadmincreate-http-health-checkercommand.
Specifythefollowingparameters:TABLE4–2HealthCheckerParametersParameterDescriptionDefaulturlSpecifiesthelistener'sURLthattheloadbalancercheckstodetermineitsstateofhealth.
"/"intervalSpecifiestheintervalinsecondsatwhichhealthchecksofinstancesoccur.
Specifying0disablesthehealthchecker.
30secondstimeoutSpecifiesthetimeoutintervalinsecondswithinwhicharesponsemustbeobtainedforalistenertobeconsideredhealthy.
10secondsIfanapplicationserverinstanceismarkedasunhealthy,thehealthcheckerpollstheunhealthyinstancestodetermineiftheinstancehasbecomehealthy.
ThehealthcheckerusesthespecifiedURLtocheckallunhealthyapplicationserverinstancestodetermineiftheyhavereturnedtothehealthystate.
Ifthehealthcheckerfindsthatanunhealthyinstancehasbecomehealthy,thatinstanceisaddedtothelistofhealthyinstances.
Formoreinformationseethedocumentationforcreate-http-health-checkeranddelete-http-health-checker.
AdditionalHealthCheckPropertiesforHealthyInstancesThehealthcheckercreatedbycreate-http-health-checkeronlychecksunhealthyinstances.
Toperiodicallycheckhealthyinstancessetsomeadditionalpropertiesinyourexportedloadbalancer.
xmlfile.
Note–Thesepropertiescanonlybesetbymanuallyeditingloadbalancer.
xmlafteryou'veexportedit.
Thereisnoequivalentasadmincommandtouse.
Tocheckhealthyinstances,setthefollowingproperties:ConfiguringtheLoadBalancerChapter4ConfiguringLoadBalancingandFailover119TABLE4–3Health-checkerManualPropertiesPropertyDefinitionactive-healthcheck-enabledTrue/falseflagindicatingwhethertopinghealthyserverinstancestodeterminewhethertheyarehealthy.
Topingserverinstances,settheflagtotrue.
number-healthcheck-retriesSpecifieshowmanytimestheloadbalancer'shealthcheckerpingsanunresponsiveserverinstancebeforemarkingitunhealthy.
Validrangeisbetween1and1000.
Adefaultvaluetosetis3.
Setthepropertiesbyeditingtheloadbalancer.
xmlfile.
Forexample:Ifyouaddtheseproperties,thensubsequentlyeditandexporttheloadbalancer.
xmlfileagain,youmustaddthesepropertiestothefileagain,sincethenewlyexportedconfigurationwon'tcontainthem.
ExportingtheLoadBalancerConfigurationFileTheloadbalancerplug-inshippedwithSunJavaSystemApplicationServerusesaconfigurationfilecalledloadbalancer.
xml.
Usetheasadmintooltocreatealoadbalancerconfigurationinthedomain.
xmlfile.
Afterconfiguringtheloadbalancingenvironment,exportittoafile.
ToexporttheloadbalancerconfigurationExportaloadbalancer.
xmlfileusingtheasadmincommandexport-http-lb-config.
Exporttheloadbalancer.
xmlfileforaparticularloadbalancerconfiguration.
Youcanspecifyapathandadifferentfilename.
Ifyoudon'tspecifyafilename,thefileisnamedloadbalancer.
xml.
load_balancer_config_name.
Ifyoudon'tspecifyapath,thefileiscreatedintheapplication_server_install_dir/domains/domain_name/generateddirectory.
TospecifyapathonWindows,usequotesaroundthepath.
Forexample,"c:\sun\AppServer\loadbalancer.
xml".
Copytheexportedloadbalancerconfigurationfiletothewebserver'sconfigurationdirectory.
Forexample,fortheSunJavaSystemWebServer,thatlocationmightbeweb_server_root/config.
Theloadbalancerconfigurationfileinthewebserver'sconfigurationdirectorymustbenamedloadbalancer.
xml.
Ifyourfilehasadifferentname,suchasloadbalancer.
xml.
load_balancer_config_name,youmustrenameit.
12ConfiguringtheLoadBalancerSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007120ChangingtheLoadBalancerConfigurationIfyouchangealoadbalancerconfigurationbycreatingordeletingreferencestoservers,deployingnewapplications,enablingordisablingserversorapplications,andsoon,exporttheloadbalancerconfigurationfileagainandcopyittothewebserver'sconfigdirectory.
Formoreinformation,see"ExportingtheLoadBalancerConfigurationFile"onpage120Theloadbalancerplug-inchecksforanupdatedconfigurationperiodicallybasedonthereloadintervalspecifiedintheloadbalancerconfiguration.
Afterthespecifiedamountoftime,iftheloadbalancerdiscoversanewconfigurationfile,itstartsusingthatconfiguration.
EnablingDynamicReconfigurationWithdynamicreconfiguration,theloadbalancerplug-inperiodicallychecksforanupdatedconfiguration.
Toenabledynamicreconfiguration:Whencreatingaloadbalancerconfiguration,usethe--reloadintervaloptionwithasadmincreate-http-lb-config.
Thisoptionsetstheamountoftimebetweenchecksforchangestotheloadbalancerconfigurationfileloadbalancer.
xml.
Avalueof0disablesdynamicreconfiguration.
Bydefault,dynamicreconfigurationisenabled,withareloadintervalof60seconds.
Ifyouhavepreviouslydisabledit,ortochangethereloadinterval,usetheasadminsetcommand.
Afterchangingthereloadinterval,exporttheloadbalancerconfigurationfileagainandcopyittothewebserver'sconfigdirectory,thenrestartthewebserver.
Note–Iftheloadbalancerencountersaharddiskreaderrorwhileattemptingtoreconfigureitself,thenitusestheconfigurationthatiscurrentlyinmemory.
TheloadbalanceralsoensuresthatthemodifiedconfigurationdataiscompliantwiththeDTDbeforeoverwritingtheexistingconfiguration.
Ifadiskreaderrorisencountered,awarningmessageisloggedtothewebserver'serrorlogfile.
TheerrorlogforSunJavaSystemWebServer'isat:web_server_install_dir/webserver_instance/logs/.
Disabling(Quiescing)aServerInstanceorClusterBeforestoppinganapplicationserverforanyreason,youwanttheinstancetocompleteservingrequests.
Theprocessofgracefullydisablingaserverinstanceorclusteriscalledquiescing.
Theloadbalancerusesthefollowingpolicyforquiescingapplicationserverinstances:ConfiguringtheLoadBalancerChapter4ConfiguringLoadBalancingandFailover121Ifaninstance(eitherstand-aloneorpartofacluster)isdisabled,andthetimeouthasnotexpired,stickyrequestscontinuetobedeliveredtothatinstance.
Newrequests,however,arenotsenttothedisabledinstance.
Whenthetimeoutexpires,theinstanceisdisabled.
Allopenconnectionsfromtheloadbalancertotheinstanceareclosed.
Theloadbalancerdoesnotsendanyrequeststothisinstance,evenifallsessionsstickingtothisinstancewerenotinvalidated.
Instead,theloadbalancerfailsoverstickyrequeststoanotherhealthyinstance.
TodisableaserverinstanceorclusterRunasadmindisable-http-lb-server,settingthetimeout(inminutes).
Exporttheloadbalancerconfigurationfileusingasadminexport-http-lb-config.
Copytheexportedconfigurationtothewebserverconfigdirectory.
Stoptheserverinstanceorinstances.
Disabling(Quiescing)anApplicationBeforeyouundeployawebapplication,youwanttotheapplicationtocompleteservingrequests.
Theprocessofgracefullydisablinganapplicationiscalledquiescing.
Whenyouquiesceanapplication,youspecifyatimeoutperiod.
Basedonthetimeoutperiod,theloadbalancerusesthefollowingpolicyforquiescingapplications:Ifthetimeouthasnotexpired,theloadbalancerdoesnotforwardnewrequeststotheapplication,butreturnsthemtothewebserver.
However,theloadbalancercontinuestoforwardstickyrequestsuntilthetimeoutexpires.
Whenthetimeoutexpires,theloadbalancerdoesnotacceptanyrequestsfortheapplication,includingstickyrequests.
Whenyoudisableanapplicationfromeveryserverinstanceorclustertheloadbalancerreferences,theusersofthedisabledapplicationexperiencelossofserviceuntiltheapplicationisenabledagain.
Ifyoudisabletheapplicationfromoneserverinstanceorclusterwhilekeepingitenabledinanotherserverinstanceorcluster,userscanstillaccesstheapplication.
TodisableanapplicationUseasadmindisable-http-lb-application,specifyingthefollowing:Timeout(inminutes).
Nameoftheapplicationtodisable.
12341ConfiguringtheLoadBalancerSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007122Targetclusterorinstanceonwhichtodisableit.
Exporttheloadbalancerconfigurationfileusingasadminexport-http-lb-config.
Copytheexportedconfigurationtothewebserverconfigdirectory.
ConfiguringHTTPandHTTPSFailoverTheloadbalancerplug-infailsoverHTTP/HTTPSsessionstoanotherapplicationserverinstanceiftheoriginalapplicationserverinstancetowhichthesessionwasconnectedbecomesunavailable.
Thissectiondescribeshowtoconfiguretheloadbalancerplug-intoenableHTTP/HTTPSroutingandsessionfailover.
Thissectiondiscussesthefollowingtopics:"HTTPSRouting"onpage123"ConfiguringIdempotentURLs"onpage124HTTPSRoutingTheHTTPSecure(HTTPS)protocolusesSecureSocketsLayer(SSL)toprovideencryptionandecryptionofHTTPrequestsforsecurecommunication.
ForHTTPSroutingtowork,oneormoreHTTPSlistenersmustbeconfigured.
Theloadbalancerplug-inroutesallincomingHTTPorHTTPSrequeststoapplicationserverinstances.
However,ifHTTPSroutingisenabled,anHTTPSrequestwillbeforwardedbytheloadbalancerplug-intotheapplicationserverusinganHTTPSportonly.
HTTPSroutingisperformedonbothnewandstickyrequests.
IfanHTTPSrequestisreceivedandnosessionisinprogress,thentheloadbalancerplug-inselectsanavailableapplicationserverinstancewithaconfiguredHTTPSport,andforwardstherequesttothatinstance.
InanongoingHTTPsession,ifanewHTTPSrequestforthesamesessionisreceived,thenthesessionandstickyinformationsavedduringtheHTTPsessionisusedtoroutetheHTTPSrequest.
ThenewHTTPSrequestisroutedtothesameserverwherethelastHTTPrequestwasserved,butontheHTTPSport.
ConfiguringHTTPSRoutingThehttpsroutingoptionofthecreate-http-lb-configcommandcontrolswhetherHTTPSroutingisturnedonoroffforalltheapplicationserversthatareparticipatinginloadbalancing.
Ifthisoptionissettofalse,allHTTPandHTTPSrequestsareforwardedasHTTP.
Setittotruewhencreatinganewloadbalancerconfiguration,orchangeitlaterusingtheasadminsetcommand.
23ConfiguringtheLoadBalancerChapter4ConfiguringLoadBalancingandFailover123Note–Ifhttps-routingissettotrue,andaneworastickyrequestcomesinwheretherearenohealthyHTTPSlistenersinthecluster,thenthatrequestgeneratesanerror.
KnownIssuesTheLoadBalancerhasthefollowinglimitationswithHTTP/HTTPSrequestprocessing.
IfasessionusesacombinationofHTTPandHTTPSrequests,thenthefirstrequestmustbeanHTTPRequest.
IfthefirstrequestisanHTTPSrequest,itcannotbefollowedbyanHTTPrequest.
ThisisbecausethecookieassociatedwiththeHTTPSsessionisnotreturnedbythebrowser.
Thebrowserinterpretsthetwodifferentprotocolsastwodifferentservers,andinitiatesanewsession.
Thislimitationisvalidonlyifhttpsroutingissettotrue.
IfasessionhasacombinationofHTTPandHTTPSrequests,thentheapplicationserverinstancemustbeconfiguredwithbothHTTPandHTTPSlisteners.
Thislimitationisvalidonlyifhttpsroutingissettotrue.
IfasessionhasacombinationofHTTPandHTTPSrequests,thentheapplicationserverinstancemustbeconfiguredwithHTTPandHTTPSlistenersthatusestandardportnumbers,thatis,80forHTTP,and443forHTTPS.
Thislimitationappliesregardlessofthevaluesetforhttpsrouting.
ConfiguringIdempotentURLsAnidempotentrequestisonethatdoesnotcauseanychangeorinconsistencyinanapplicationwhenretried.
InHTTP,somemethods(suchasGET)areidempotent,whileothermethods(suchasPOST)arenot.
RetryinganidempotentURLmustnotcausevaluestochangeontheserverorinthedatabase.
Theonlydifferenceisachangeintheresponsereceivedbytheuser.
Examplesofidempotentrequestsincludesearchenginequeriesanddatabasequeries.
Theunderlyingprincipleisthattheretrydoesnotcauseanupdateormodificationofdata.
Toenhancetheavailabilityofdeployedapplications,configuretheenvironmenttoretryfailedidempotentHTTPrequestsonalltheapplicationserverinstancesservicedbyaloadbalancer.
Thisoptionisusedforread-onlyrequests,forexample,toretryasearchrequest.
ConfigureidempotentURLsinthesun-web.
xmlfile.
Whenyouexporttheloadbalancerconfiguration,idempotentURLinformationisautomaticallyaddedtotheloadbalancer.
xmlfile.
FormoreinformationonconfiguringidempotentURLs,see"ConfiguringIdempotentURLRequests"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2Developer'sGuide.
ConfiguringtheLoadBalancerSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007124UpgradingApplicationsWithoutLossofAvailabilityUpgradinganapplicationtoanewversionwithoutlossofavailabilitytousersiscalledarollingupgrade.
Carefullymanagingthetwoversionsoftheapplicationacrosstheupgradeensuresthatcurrentusersoftheapplicationcompletetheirtaskswithoutinterruption,whilenewuserstransparentlygetthenewversionoftheapplication.
Witharollingupgrade,usersareunawarethattheupgradeoccurs.
ApplicationCompatibilityRollingupgradesposevaryingdegreesofdifficultydependingonthemagnitudeofchangesbetweenthetwoapplicationversions.
Ifthechangesaresuperficial,forexample,changestostatictextandimages,thetwoversionsoftheapplicationarecompatibleandcanbothrunatonceinthesamecluster.
Compatibleapplicationsmust:UsethesamesessioninformationUsecompatibledatabaseschemasHavegenerallycompatibleapplication-levelbusinesslogicUsethesamephysicaldatasourceYoucanperformarollingupgradeofacompatibleapplicationineitherasingleclusterormultipleclusters.
Formoreinformation,see"UpgradingInaSingleCluster"onpage125Ifthetwoversionsofanapplicationdonotmeetalltheabovecriteria,thentheapplicationsareconsideredincompatible.
Executingincompatibleversionsofanapplicationinoneclustercancorruptapplicationdataandcausesessionfailovertonotfunctioncorrectly.
Theproblemsdependonthetypeandextentoftheincompatibility.
Itisgoodpracticetoupgradeanincompatibleapplicationbycreatinga"shadowcluster"towhichtodeploythenewversionandslowlyquiescetheoldclusterandapplication.
Formoreinformation,see"UpgradingIncompatibleApplications"onpage129Theapplicationdeveloperandadministratorarethebestpeopletodeterminewhetherapplicationversionsarecompatible.
Ifindoubt,assumethattheversionsareincompatible,sincethisisthesafestapproach.
UpgradingInaSingleClusterYoucanperformarollingupgradeofanapplicationdeployedtoasinglecluster,providingthecluster'sconfigurationisnotsharedwithanyothercluster.
UpgradingApplicationsWithoutLossofAvailabilityChapter4ConfiguringLoadBalancingandFailover125ToupgradeanapplicationinasingleclusterSaveanoldversionoftheapplicationorbackupthedomain.
Tobackupthedomainusetheasadminbackup-domaincommand.
Turnoffdynamicreconfiguration(ifenabled)forthecluster.
TodothiswithAdminConsole:a.
ExpandtheConfigurationsnode.
b.
Clickthenameofthecluster'sconfiguration.
c.
OntheConfigurationSystemPropertiespage,unchecktheDynamicReconfigurationEnabledbox.
d.
ClickSaveAlternatively,usethiscommand:asadminset--useruser--passwordfilepassword_filecluster_name-config.
dynamic-reconfiguration-enabled=falseRedeploytheupgradedapplicationtothetargetdomain.
IfyouredeployusingtheAdminConsole,thedomainisautomaticallythetarget.
Ifyouuseasadmin,specifythetargetdomain.
Becausedynamicreconfigurationisdisabled,theoldapplicationcontinuestorunonthecluster.
Enabletheredeployedapplicationfortheinstancesusingasadminenable-http-lb-application.
Quiesceoneserverinstanceintheclusterfromtheloadbalancer.
Followthesesteps:a.
Disabletheserverinstanceusingasadmindisable-http-lb-server.
b.
Exporttheloadbalancerconfigurationfileusingasadminexport-http-lb-config.
c.
Copytheexportedconfigurationfiletothewebserverinstance'sconfigurationdirectory.
Forexample,forSunJavaSystemWebServer,thelocationisweb_server_install_dir/https-host-name/config/loadbalancer.
xml.
Toensurethattheloadbalancerloadsthenewconfigurationfile,besurethatdynamicreconfigurationisenabledbysettingthereloadintervalintheloadbalancerconfiguration.
12345UpgradingApplicationsWithoutLossofAvailabilitySunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007126d.
Waituntilthetimeouthasexpired.
Monitortheloadbalancer'slogfiletomakesuretheinstanceisoffline.
IfusersseearetryURL,skipthequiescingperiodandrestarttheserverimmediately.
Restartthedisabledserverinstancewhiletheotherinstancesintheclusterarestillrunning.
Restartingcausestheservertosynchronizewiththedomainandupdatetheapplication.
Testtheapplicationontherestartedservertomakesureitrunscorrectly.
Re-enabletheserverinstanceinloadbalancer.
Followthesesteps:a.
Enabletheserverinstanceusingasadminenable-http-lb-server.
b.
Exporttheloadbalancerconfigurationfileusingasadminexport-http-lb-config.
c.
Copytheconfigurationfiletothewebserver'sconfigurationdirectoryasdescribedin"UpgradingInaSingleCluster"onpage125of"UpgradingInaSingleCluster"onpage125.
Repeatsteps5through8foreachinstanceinthecluster.
Whenallserverinstanceshavethenewapplicationandarerunning,youcanre-enabledynamicreconfigurationfortheclusteragain.
UpgradinginMultipleClustersToupgradeacompatibleapplicationintwoormoreclusters:Saveanoldversionoftheapplicationorbackupthedomain.
Tobackupthedomainusetheasadminbackup-domaincommand.
Turnoffdynamicreconfiguration(ifenabled)forallclusters.
TodothiswithAdminConsole:a.
ExpandtheConfigurationsnode.
b.
Clickthenameofonecluster'sconfiguration.
c.
OntheConfigurationSystemPropertiespage,unchecktheDynamicReconfigurationEnabledbox.
67891012UpgradingApplicationsWithoutLossofAvailabilityChapter4ConfiguringLoadBalancingandFailover127d.
ClickSavee.
RepeatfortheotherclustersAlternatively,usethiscommand:asadminset--useruser--passwordfilepassword_filecluster_name-config.
dynamic-reconfiguration-enabled=falseRedeploytheupgradedapplicationtothetargetdomain.
IfyouredeployusingtheAdminConsole,thedomainisautomaticallythetarget.
Ifyouuseasadmin,specifythetargetdomain.
Becausedynamicreconfigurationisdisabled,theoldapplicationcontinuestorunontheclusters.
Enabletheredeployedapplicationfortheclustersusingasadminenable-http-lb-application.
Quiesceoneclusterfromtheloadbalancera.
Disabletheclusterusingasadmindisable-http-lb-server.
b.
Exporttheloadbalancerconfigurationfileusingasadminexport-http-lb-config.
c.
Copytheexportedconfigurationfiletothewebserverinstance'sconfigurationdirectory.
Forexample,forSunJavaSystemWebServer,thelocationisweb_server_install_dir/https-host-name/config/loadbalancer.
xml.
Dynamicreconfigurationmustbeenabledfortheloadbalancer(bysettingthereloadintervalintheloadbalancerconfiguration),sothatthenewloadbalancerconfigurationfileisloadedautomatically.
d.
Waituntilthetimeouthasexpired.
Monitortheloadbalancer'slogfiletomakesuretheinstanceisoffline.
IfusersseearetryURL,skipthequiescingperiodandrestarttheserverimmediately.
Restartthedisabledclusterwhiletheotherclustersarestillrunning.
Restartingcausestheclustertosynchronizewiththedomainandupdatetheapplication.
Testtheapplicationontherestartedclustertomakesureitrunscorrectly.
Re-enabletheclusterinloadbalancer:a.
Enabletheclusterusingasadminenable-http-lb-server.
b.
Exporttheloadbalancerconfigurationfileusingasadminexport-http-lb-config.
345678UpgradingApplicationsWithoutLossofAvailabilitySunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007128c.
Copytheconfigurationfiletothewebserver'sconfigurationdirectory.
Repeatsteps5through8fortheotherclusters.
Whenallserverinstanceshavethenewapplicationandarerunning,youcanreenabledynamicreconfigurationforallclustersagain.
UpgradingIncompatibleApplicationsForinformationonwhatmakesapplicationscompatible,see"ApplicationCompatibility"onpage125thenewversionoftheapplicationisincompatiblewiththeold.
Also,youmustupgradeincompatibleapplicationintwoormoreclusters.
Ifyouhaveonlyonecluster,createa"shadowcluster"fortheupgrade,asdescribedbelow.
Whenupgradinganincompatibleapplication:Givethenewversionoftheapplicationadifferentnamefromtheoldversionoftheapplication.
Thestepsbelowassumethattheapplicationisrenamed.
Ifthedataschemasareincompatible,usedifferentphysicaldatasourcesafterplanningfordatamigration.
Deploythenewversiontoadifferentclusterfromtheclusterwheretheoldversionisdeployed.
Setanappropriatelylongtimeoutfortheclusterrunningtheoldapplicationbeforeyoutakeitoffline,becausetherequestsfortheapplicationwon'tfailovertothenewcluster.
Theseusersessionswillsimplyfail.
ToupgradeanincompatibleapplicationbycreatingasecondclusterSaveanoldversionoftheapplicationorbackupthedomain.
Tobackupthedomainusetheasadminbackup-domaincommand.
Createa"shadowcluster"onthesameoradifferentsetofmachinesastheexistingcluster.
a.
UsetheAdminConsoletocreatethenewclusterandreferencetheexistingcluster'snamedconfiguration.
Customizetheportsforthenewinstancesoneachmachinetoavoidconflictwithexistingactiveports.
b.
Forallresourcesassociatedwiththecluster,addaresourcereferencetothenewlycreatedclusterusingasadmincreate-resource-ref.
91012UpgradingApplicationsWithoutLossofAvailabilityChapter4ConfiguringLoadBalancingandFailover129c.
Createareferencetoallotherapplicationsdeployedtothecluster(exceptthecurrentredeployedapplication)fromthenewlycreatedclusterusingasadmincreate-application-ref.
d.
Configuretheclustertobehighlyavailableusingasadminconfigure-ha-cluster.
e.
Createreferencetothenewly-createdclusterintheloadbalancerconfigurationfileusingasadmincreate-http-lb-ref.
Givethenewversionofapplicationadifferentnamefromtheoldversion.
Deploythenewapplicationwiththenewclusterasthetarget.
Useadifferentcontextrootorroots.
Enablethedeployednewapplicationfortheclustersusingasadminenable-http-lb-application.
Startthenewclusterwhiletheotherclusterisstillrunning.
Thestartcausestheclustertosynchronizewiththedomainandbeupdatedwiththenewapplication.
Testtheapplicationonthenewclustertomakesureitrunscorrectly.
Disabletheoldclusterfromtheloadbalancerusingasadmindisable-http-lb-server.
Setatimeoutforhowlonglingeringsessionssurvive.
Enablethenewclusterfromtheloadbalancerusingasadminenable-http-lb-server.
Exporttheloadbalancerconfigurationfileusingasadminexport-http-lb-config.
Copytheexportedconfigurationfiletothewebserverinstance'sconfigurationdirectory.
Forexample,forSunJavaSystemWebServer,thelocationisweb_server_install_dir/https-host-name/config/loadbalancer.
xml.
Dynamicreconfigurationmustbeenabledfortheloadbalancer(bysettingthereloadintervalintheloadbalancerconfiguration),sothatthenewloadbalancerconfigurationfileisloadedautomatically.
Afterthetimeoutperiodexpiresorafterallusersoftheoldapplicationhaveexited,stoptheoldclusteranddeletetheoldapplication.
345678910111213UpgradingApplicationsWithoutLossofAvailabilitySunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007130MonitoringtheHTTPLoadBalancerPlug-in"ConfiguringLogMessages"onpage131"TypesofLogMessages"onpage131"EnablingLoadBalancerLogging"onpage132"UnderstandingMonitoringMessages"onpage133ConfiguringLogMessagesTheloadbalancerplug-inusesthewebserver'sloggingmechanismtowritelogmessages.
ThedefaultloglevelontheApplicationServerissettothedefaultlogginglevelonSunJavaSystemWebServer(INFO),ApacheWebServer(WARN)andMicrosoftIIS(INFO).
Theapplicationserverloglevels-FINE,FINER,andFINESTmaptotheDEBUGlevelonthewebserver.
Theselogmessagesarewrittentothewebserverlogfiles,andareintheformofrawdatathatcanbeparsedusingscripts,orimportedintospreadsheetstocalculaterequiredmetrics.
TypesofLogMessagesTheloadbalancerplug-ingeneratesthefollowingtypesoflogmessages:"LoadBalancerConfiguratorLogMessages"onpage131"RequestDispatchandRuntimeLogMessages"onpage132"ConfiguratorErrorMessages"onpage132LoadBalancerConfiguratorLogMessagesThesemessageswillbeloggedwhenyouareusingidempotentURLsanderrorpagesettings.
AnoutputforidempotentURLpatternconfigurationcontainsthefollowinginformation:WhentheloglevelissettoFINE:CONFxxxx:IdempotentUrlPatternconfiguredforweb-module:WhentheloglevelissettoSEVERE:CONFxxxx:DuplicateentryofIdempotentURLelementforwebModuleinloadbalancer.
xml.
"WhentheloglevelissettoWARN:CONFxxxx:InvalidIdempotentUrlPatternDataforweb-moduleAnoutputforerrorpageURLconfigurationcontainsthefollowinginformation(loglevelsettoWARN):MonitoringtheHTTPLoadBalancerPlug-inChapter4ConfiguringLoadBalancingandFailover131CONFxxxx:Invaliderror-urlforweb-moduleRequestDispatchandRuntimeLogMessagesTheselogmessagesaregeneratedwhilearequestisbeingloadbalancedanddispatched.
Anoutputforstandardloggingforeachmethodstartcontainsthefollowinginformation(loglevelsettoFINE):ROUTxxxx:ExecutingRoutermethodAnoutputforrouterlogsforeachmethodstartcontainsthefollowinginformation(loglevelsettoINFO):ROUTxxxx:SuccessfullySelectedanotherServerInstanceforidempotentrequestAnoutputforruntimelogscontainsthefollowinginformation(loglevelsettoINFO):RNTMxxxx:RetryingIdempotentRequestConfiguratorErrorMessagesTheseerrorsappearifthereareconfigurationproblems,forexample,ifthecustomerrorpagereferencedismissing.
LoglevelsettoINFO:ROUTxxxx:NonIdempotentRequestcannotberetriedForexample:ROUTxxxx:NonIdempotentRequesthttp://sun.
com/addToDBx=11&abc=2cannotberetriedLoglevelsettoFINE:RNTMxxxx:Invalid/MissingCustomerror-url/page:forweb-module:Forexample:RNTMxxxx:Invalid/MissingCustomerror-url/page:myerror1xyzforweb-module:testEnablingLoadBalancerLoggingTheloadbalancerplug-inlogsthefollowinginformation:Requeststart/stopinformationforeveryrequest.
Failed-overrequestinformationwhentherequestfailsoverfromanunhealthyinstancetoahealthyinstance.
Listofunhealthyinstancesattheendofeveryhealthcheckcycle.
MonitoringtheHTTPLoadBalancerPlug-inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007132Note–Whenloadbalancerloggingisenabled,andifthewebserverlogginglevelissettoDEBUGortoprintverbosemessages,theloadbalancerwritesHTTPsessionIDsinthewebserverlogfiles.
Therefore,ifthewebserverhostingtheloadbalancerplug-inisintheDMZ,donotusetheDEBUGorsimilarloglevelinproductionenvironments.
IfyoumustusetheDEBUGlogginglevel,turnoffloadbalancerloggingbysettingrequire-monitor-datapropertytofalseinloadbalancer.
xml.
ToturnonloadbalancerloggingSettheloggingoptionsinthewebserver.
Theproceduredependsonthewebserver:WithSunJavaSystemWebServerIntheserver'sadminconsole,gototheMagnusEditortabandsettheLogVerboseoptiontoOn.
ForApacheWebServer,setthelogleveltoDEBUG.
ForMicrosoftIIS,setthelogleveltoFINEinthesun-passthrough.
propertiesfile.
Settheloadbalancerconfiguration'smonitoroptiontotrue.
Usetheasadmincreate-http-lb-configcommandtosetmonitoringtotruewhenyouinitiallycreatetheloadbalancerconfiguration,orusetheasadminsetcommandtosetittotruelater.
Monitoringisdisabledbydefault.
UnderstandingMonitoringMessagesTheformatoftheloadbalancerplug-inlogmessagesisasfollows.
ThestartofanHTTPrequestcontainsthefollowinginformation:RequestStartSticky(New)ThetimestampvalueisthenumberofmillisecondsfromJanuary1,1970.
Forexample:RequestStartNew123456602983http://austen.
sun.
com/Webapps-simple/servlet/Example1TheendofanHTTPrequestcontainstheRequestExitmessage,asfollows:RequestExitSticky(New)Failure-(incaseofafailure)Forexample:RequestExitNew123456603001http://austen.
sun.
com/Webapps-simple/servlet/Example1http://austen:22221812MonitoringtheHTTPLoadBalancerPlug-inChapter4ConfiguringLoadBalancingandFailover133Note–IntheRequestExitmessage,indicatesthetotalrequestturn-aroundtimeinmilliseconds,fromtheperspectiveoftheloadbalancerplug-in.
Thelistofunhealthyinstances,asfollows:UnhealthyInstances,.
.
.
Forexample:UnhealthyInstancescluster1701923http://austen:2210,http://austen:3010Alistoffailed-overrequests,asfollows:FailedoverRequestForexample:FailedoverRequest239496705623http://austen.
sun.
com/Apps/servlet/SessionTest16dfdac3c7e80a40http://austen:4044http://austen:4045MonitoringtheHTTPLoadBalancerPlug-inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007134UsingApplicationServerClustersThischapterdescribeshowtouseApplicationServerclusters.
Itcontainsthefollowingsections:"OverviewofClusters"onpage135"WorkingwithClusters"onpage135OverviewofClustersAclusterisanamedcollectionofserverinstancesthatsharethesameapplications,resources,andconfigurationinformation.
Youcangroupserverinstancesondifferentmachinesintoonelogicalclusterandadministerthemasoneunit.
Youcaneasilycontrolthelifecycleofamulti-machineclusterwiththeDAS.
Clustersenablehorizontalscalability,loadbalancing,andfailoverprotection.
Bydefinition,alltheinstancesinaclusterhavethesameresourceandapplicationconfiguration.
Whenaserverinstanceoramachineinaclusterfails,theloadbalancerdetectsthefailure,redirectstrafficfromthefailedinstancetootherinstancesinthecluster,andrecoverstheusersessionstate.
Sincethesameapplicationsandresourcesareonallinstancesinthecluster,aninstancecanfailovertoanyotherinstanceinthecluster.
WorkingwithClusters"ToCreateaCluster"onpage136"ToCreateServerInstancesforaCluster"onpage137"ToConfigureaCluster"onpage138"ToDeleteaCluster"onpage141"ToConfigureServerInstancesinaCluster"onpage139"ToConfigureApplicationsforaCluster"onpage140"ToConfigureResourcesforaCluster"onpage140"ToMigrateEJBTimers"onpage1415CHAPTER5135"ToUpgradeComponentsWithoutLossofService"onpage142ToCreateaClusterInthetreecomponent,selecttheClustersnode.
OntheClusterspage,clickNew.
TheCreateClusterpageappears.
IntheNamefield,typeanameforthecluster.
Thenamemust:Consistonlyofuppercaseandlowercaseletters,numbers,underscores,hyphens,andperiods(.
)Beuniqueacrossallnodeagentnames,serverinstancenames,clusternames,andconfigurationnamesNotbedomainIntheConfigurationfield,chooseaconfigurationfromthedrop-downlist.
Tocreateaclusterthatdoesnotuseasharedconfiguration,choosedefault-config.
Leavetheradiobuttonlabeled"MakeacopyoftheselectedConfiguration"selected.
Thecopyofthedefaultconfigurationwillhavethenamecluster_name-config.
Tocreateaclusterthatusesasharedconfiguration,choosetheconfigurationfromthedrop-downlist.
Selecttheradiobuttonlabeled"ReferencetheselectedConfiguration"tocreateaclusterthatusesthespecifiedexistingsharedconfiguration.
Optionally,addserverinstances.
Youcanalsoaddserverinstancesaftertheclusteriscreated.
Beforeyoucreateserverinstancesforthecluster,firstcreateoneormorenodeagentsornodeagentplaceholders.
See"ToCreateaNodeAgentPlaceholder"onpage165Tocreateserverinstances:a.
IntheServerInstancesToBeCreatedarea,clickAdd.
b.
TypeanamefortheinstanceintheInstanceNamefieldc.
ChooseanodeagentfromtheNodeAgentdrop-downlist.
12345WorkingwithClustersSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007136ClickOK.
ClickOKontheClusterCreatedSuccessfullypagethatappears.
Equivalentasadmincommandcreate-cluster"ToConfigureaCluster"onpage138"ToCreateServerInstancesforaCluster"onpage137"ToConfigureApplicationsforaCluster"onpage140"ToConfigureResourcesforaCluster"onpage140"ToDeleteaCluster"onpage141"ToUpgradeComponentsWithoutLossofService"onpage142Formoredetailsonhowtoadministerclusters,serverinstances,andnodeagents,see"DeployingNodeAgents"onpage155.
ToCreateServerInstancesforaClusterBeforeyoucancreateserverinstancesforacluster,youmustfirstcreateanodeagentornodeagentplaceholder.
See"ToCreateaNodeAgentPlaceholder"onpage165Inthetreecomponent,expandtheClustersnode.
Selectthenodeforthecluster.
ClicktheInstancestabtobringuptheClusteredServerInstancespage.
ClickNewtobringuptheCreateClusteredServerInstancepage.
IntheNamefield,typeanamefortheserverinstance.
ChooseanodeagentfromtheNodeAgentsdrop-downlist.
ClickOK.
Equivalentasadmincommandcreate-instance"WhatIsaNodeAgent"onpage153"ToCreateaCluster"onpage13667MoreInformationSeeAlsoBeforeYouBegin1234567MoreInformationSeeAlsoWorkingwithClustersChapter5UsingApplicationServerClusters137"ToConfigureaCluster"onpage138"ToConfigureApplicationsforaCluster"onpage140"ToConfigureResourcesforaCluster"onpage140"ToDeleteaCluster"onpage141"ToUpgradeComponentsWithoutLossofService"onpage142"ToConfigureServerInstancesinaCluster"onpage139ToConfigureaClusterInthetreecomponent,expandtheClustersnode.
Selectthenodeforthecluster.
OntheGeneralInformationpage,youcanperformthesetasks:ClickStartInstancestostarttheclusteredserverinstances.
ClickStopInstancestostoptheclusteredserverinstances.
ClickMigrateEJBTimerstomigratetheEJBtimersfromastoppedserverinstancetoanotherserverinstanceinthecluster.
Equivalentasadmincommandstart-cluster,stop-cluster,migrate-timers"ToCreateaCluster"onpage136"ToCreateServerInstancesforaCluster"onpage137"ToConfigureApplicationsforaCluster"onpage140"ToConfigureResourcesforaCluster"onpage140"ToDeleteaCluster"onpage141"ToUpgradeComponentsWithoutLossofService"onpage142"ToMigrateEJBTimers"onpage141ToStart,Stop,andDeleteClusteredInstancesInthetreecomponent,expandtheClustersnode.
Expandthenodefortheclusterthatcontainstheserverinstance.
ClicktheInstancestabtodisplaytheClusteredServerInstancespage.
Onthispageyoucan:12MoreInformationSeeAlso123WorkingwithClustersSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007138SelectthecheckboxforaninstanceandclickDelete,Start,orStoptoperformtheselectedactiononallthespecifiedserverinstances.
ClickthenameoftheinstancetobringuptheGeneralInformationpage.
ToConfigureServerInstancesinaClusterInthetreecomponent,expandtheClustersnode.
Expandthenodefortheclusterthatcontainstheserverinstance.
Selecttheserverinstancenode.
OntheGeneralInformationpage,youcan:ClickStartInstancetostarttheinstance.
ClickStopInstancetostoparunninginstance.
ClickJNDIBrowsingtobrowsetheJNDItreeforarunninginstance.
ClickViewLogFilestoopentheserverlogviewer.
ClickRotateLogFiletorotatethelogfilefortheinstance.
Thisactionschedulesthelogfileforrotation.
Theactualrotationtakesplacethenexttimeanentryiswrittentothelogfile.
ClickRecoverTransactionstorecoverincompletetransactions.
ClickthePropertiestabtomodifytheportnumbersfortheinstance.
ClicktheMonitortabtochangemonitoringproperties.
"ToCreateaCluster"onpage136"ToConfigureaCluster"onpage138"ToCreateServerInstancesforaCluster"onpage137"ToConfigureApplicationsforaCluster"onpage140"ToConfigureResourcesforaCluster"onpage140"ToDeleteaCluster"onpage141"ToUpgradeComponentsWithoutLossofService"onpage142"RecoveringTransactions"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide1234SeeAlsoWorkingwithClustersChapter5UsingApplicationServerClusters139ToConfigureApplicationsforaClusterInthetreecomponent,expandtheClustersnode.
Selectthenodeforthecluster.
ClicktheApplicationstabtobringuptheApplicationspage.
Onthispage,youcan:FromtheDeploydrop-downlist,selectatypeofapplicationtodeploy.
OntheDeploymentpagethatappears,specifytheapplication.
FromtheFilterdrop-downlist,selectatypeofapplicationtodisplayinthelist.
Toeditanapplication,clicktheapplicationname.
SelectthecheckboxnexttoanapplicationandchooseEnableorDisabletoenableordisabletheapplicationforthecluster.
"ToCreateaCluster"onpage136"ToConfigureaCluster"onpage138"ToCreateServerInstancesforaCluster"onpage137"ToConfigureResourcesforaCluster"onpage140"ToDeleteaCluster"onpage141"ToUpgradeComponentsWithoutLossofService"onpage142ToConfigureResourcesforaClusterInthetreecomponent,expandtheClustersnode.
Selectthenodeforthecluster.
ClicktheResourcestabtobringuptheResourcespage.
Onthispage,youcan:Createanewresourceforthecluster:fromtheNewdrop-downlist,selectatypeofresourcetocreate.
Makesuretospecifytheclusterasatargetwhenyoucreatetheresource.
EnableorDisablearesourceglobally:selectthecheckboxnexttoaresourceandclickEnableorDisalbe.
Thisactiondoesnotremovetheresource.
Displayonlyresourcesofaparticulartype:fromtheFilterdrop-downlist,selectatypeofresourcetodisplayinthelist.
Editaresource:clicktheresourcename.
123SeeAlso123WorkingwithClustersSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007140"ToCreateaCluster"onpage136"ToConfigureaCluster"onpage138"ToCreateServerInstancesforaCluster"onpage137"ToConfigureApplicationsforaCluster"onpage140"ToDeleteaCluster"onpage141ToDeleteaClusterInthetreecomponent,selecttheClustersnode.
OntheClusterspage,selectthecheckboxnexttothenameofthecluster.
ClickDelete.
Equivalentasadmincommanddelete-cluster"ToCreateaCluster"onpage136"ToConfigureaCluster"onpage138"ToCreateServerInstancesforaCluster"onpage137"ToConfigureApplicationsforaCluster"onpage140"ToConfigureResourcesforaCluster"onpage140"ToUpgradeComponentsWithoutLossofService"onpage142ToMigrateEJBTimersIfaserverinstancestopsrunningabnormallyorunexpectedly,itcanbenecessarytomovetheEJBtimersinstalledonthatserverinstancetoarunningserverinstanceinthecluster.
Todoso,performthesesteps:Inthetreecomponent,expandtheClustersnode.
Selectthenodeforthecluster.
OntheGeneralInformationpage,clickMigrateEJBTimers.
OntheMigrateEJBTimerspage:a.
FromtheSourcedrop-downlist,choosethestoppedserverinstancefromwhichtomigratethetimers.
SeeAlso123MoreInformationSeeAlso1234WorkingwithClustersChapter5UsingApplicationServerClusters141b.
(Optional)FromtheDestinationdrop-downlist,choosetherunningserverinstancetowhichtomigratethetimers.
Ifyouleavethisfieldempty,arunningserverinstancewillberandomlychosen.
c.
ClickOK.
StopandrestarttheDestinationserverinstance.
Ifthesourceserverinstanceisrunningorifthedestinationserverinstanceisnotrunning,AdminConsoledisplaysanerrormessage.
Equivalentasadmincommandmigrate-timers"ToConfigureaCluster"onpage138"ConfiguringtheEJBTimerServiceSettings"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuideToUpgradeComponentsWithoutLossofServiceYoucanusetheloadbalancerandmultipleclusterstoupgradecomponentswithintheApplicationServerwithoutanylossofservice.
Acomponentcan,forexample,beaJVM,theApplicationServer,orawebapplication.
Thisapproachisnotpossibleif:Youchangetheschemaofthehigh-availabilitydatabase(HADB).
Formoreinformation,seeChapter3,"AdministeringHighAvailabilityDatabase"Youperformanapplicationupgradethatinvolvesachangetotheapplicationdatabaseschema.
Caution–Upgradeallserverinstancesinaclustertogether.
Otherwise,thereisariskofversionmismatchcausedbyasessionfailingoverfromoneinstancetoanotherwheretheinstanceshavedifferentversionsofcomponentsrunning.
StoponeoftheclustersusingtheStopClusterbuttonontheGeneralInformationpageforthecluster.
Upgradethecomponentinthatcluster.
StarttheclusterusingtheStartClusterbuttonontheGeneralInformationpageforthecluster.
5MoreInformationSeeAlso123WorkingwithClustersSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007142Repeattheprocesswiththeotherclusters,onebyone.
Becausesessionsinoneclusterwillneverfailovertosessionsinanothercluster,thereisnoriskofversionmismatchcausedbyasession'sfailingoverfromaserverinstancethatisrunningoneversionofthecomponenttoanotherserverinstance(inadifferentcluster)thatisrunningadifferentversionofthecomponent.
Aclusterinthiswayactsasasafeboundaryforsessionfailoverfortheserverinstanceswithinit.
"ToCreateaCluster"onpage136"ToConfigureaCluster"onpage138"ToCreateServerInstancesforaCluster"onpage137"ToConfigureApplicationsforaCluster"onpage140"ToConfigureResourcesforaCluster"onpage140"ToDeleteaCluster"onpage1414SeeAlsoWorkingwithClustersChapter5UsingApplicationServerClusters143144ManagingNamedConfigurationsThischapterdescribesadding,changing,andusingnamedserverconfigurationsinApplicationServer.
Itcontainsthefollowingsections:"AboutNamedConfigurations"onpage145"WorkingwithNamedConfigurations"onpage148AboutNamedConfigurations"NamedConfigurations"onpage145"Thedefault-configConfiguration"onpage146"ConfigurationsCreatedwhenCreatingInstancesorClusters"onpage146"UniquePortNumbersandConfigurations"onpage147NamedConfigurationsAnamedconfigurationisasetofserverconfigurationinformation,includingsettingsforthingssuchasHTTPlisteners,ORB/IIOPlisteners,JMSbrokers,theEJBcontainer,security,logging,andmonitoring.
Applicationsandresourcesarenotdefinedinnamedconfigurations.
Configurationsarecreatedintheadministrationdomain.
Multipleserverinstancesorclustersinthedomaincanreferencethesameconfiguration,ortheycanhaveseparateconfigurations.
Forclusters,allserverinstancesintheclusterinheritthecluster'sconfigurationsothatahomogenousenvironmentisassuredinacluster'sinstances.
Becauseanamedconfigurationcontainssomanyrequiredconfigurationsettings,createanewconfigurationbycopyinganexistingnamedconfiguration.
Thenewly-createdconfigurationisidenticaltotheconfigurationyoucopieduntilyouchangeitsconfigurationsettings.
Therearethreewaysinwhichclustersorinstancesuseconfigurations:6CHAPTER6145Stand-alone:Astand-aloneserverinstanceorclusterdoesn'tshareitsconfigurationwithanotherserverinstanceorcluster;thatis,nootherserverinstanceorclusterreferencesthenamedconfiguration.
Youcreateastand-aloneinstanceorclusterbycopyingandrenaminganexistingconfiguration.
Shared:Asharedserverinstanceorclustersharesaconfigurationwithanotherserverinstanceorcluster;thatis,multipleinstancesorclustersreferencethesamenamedconfiguration.
Youcreateasharedserverinstanceorclusterbyreferencing(notcopying)anexistingconfiguration.
Clustered:Aclusteredserverinstanceinheritsthecluster'sconfiguration.
SeeAlso:"Thedefault-configConfiguration"onpage146"ConfigurationsCreatedwhenCreatingInstancesorClusters"onpage146"UniquePortNumbersandConfigurations"onpage147"ToCreateaNamedConfiguration"onpage148"EditingaNamedConfiguration'sProperties"onpage148Thedefault-configConfigurationThedefault-configconfigurationisaspecialconfigurationthatactsasatemplateforcreatingstand-aloneserverinstanceorstand-aloneclusterconfigurations.
Nounclusteredserverinstancesorclustersareallowedtorefertothedefault-configconfiguration;itcanonlybecopiedtocreatenewconfigurations.
Editthedefaultconfigurationtoensurethatnewconfigurationscopiedfromithavethecorrectinitialsettings.
Formoreinformation,see:"ConfigurationsCreatedwhenCreatingInstancesorClusters"onpage146"NamedConfigurations"onpage145"ToCreateaNamedConfiguration"onpage148"EditingaNamedConfiguration'sProperties"onpage148"ToEditPortNumbersforInstancesReferencingaConfiguration"onpage150ConfigurationsCreatedwhenCreatingInstancesorClustersWhencreatinganewserverinstanceoranewcluster,either:Referenceanexistingconfiguration.
Nonewconfigurationisadded.
Makeacopyofanexistingconfiguration.
Anewconfigurationisaddedwhentheserverinstanceorclusterisadded.
AboutNamedConfigurationsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007146Bydefault,newclustersorinstancesarecreatedwithconfigurationscopiedfromthedefault-configconfiguration.
Tocopyfromadifferentconfiguration,specifyitwhencreatinganewinstanceorcluster.
Foraserverinstance,thenewconfigurationisnamedinstance_name-config.
Foracluster,thenewconfigurationisnamedcluster-name-config.
Formoreinformation,see:"Thedefault-configConfiguration"onpage146"NamedConfigurations"onpage145"ToCreateaNamedConfiguration"onpage148"EditingaNamedConfiguration'sProperties"onpage148UniquePortNumbersandConfigurationsIfmultipleinstancesonthesamehostmachinereferencethesameconfiguration,eachinstancemustlistenonauniqueportnumber.
Forexample,iftwoserverinstancesreferenceanamedconfigurationwithanHTTPlisteneronport80,aportconflictpreventsoneoftheserverinstancesfromstarting.
Changethepropertiesthatdefinetheportnumbersonwhichindividualserverinstanceslistensothatuniqueportsareused.
Thefollowingprinciplesapplytoportnumbers:Portnumbersforindividualserverinstancesareinitiallyinheritedfromtheconfiguration.
Iftheportisalreadyinusewhenyoucreateaserverinstance,overridetheinheriteddefaultvalueattheinstanceleveltopreventportconflicts.
Assumeaninstanceissharingaconfiguration.
Theconfigurationhasportnumbern.
Ifyoucreateanewinstanceonthemachineusingthesameconfiguration,thenewinstanceisassignedportnumbern+1,ifitisavailable.
Ifitisnotavailable,thenextavailableportaftern+1ischosen.
Ifyouchangetheportnumberoftheconfiguration,aserverinstanceinheritingthatportnumberautomaticallyinheritsthechangedportnumber.
Ifyouchangeaninstance'sportnumberandyousubsequentlychangetheconfiguration'sportnumber,theinstance'sportnumberremainsunchanged.
Formoreinformation,see:"ToEditPortNumbersforInstancesReferencingaConfiguration"onpage150"EditingaNamedConfiguration'sProperties"onpage148"NamedConfigurations"onpage145AboutNamedConfigurationsChapter6ManagingNamedConfigurations147WorkingwithNamedConfigurations"ToCreateaNamedConfiguration"onpage148"EditingaNamedConfiguration'sProperties"onpage148"ToEditPortNumbersforInstancesReferencingaConfiguration"onpage150"ToviewaNamedConfiguration'sTargets"onpage150"ToDeleteaNamedConfiguration"onpage151ToCreateaNamedConfigurationInthetreecomponent,selecttheConfigurationsnode.
OntheConfigurationspage,clickNew.
OntheCreateConfigurationspage,enterauniquenamefortheconfiguration.
Selectaconfigurationtocopy.
Theconfigurationdefault-configisthedefaultconfigurationusedwhencreatingstand-aloneserverinstanceorstand-alonecluster.
Equivalentasadmincommandcopy-config"NamedConfigurations"onpage145"Thedefault-configConfiguration"onpage146"EditingaNamedConfiguration'sProperties"onpage148"ToEditPortNumbersforInstancesReferencingaConfiguration"onpage150"ToviewaNamedConfiguration'sTargets"onpage150"ToDeleteaNamedConfiguration"onpage151EditingaNamedConfiguration'sPropertiesThefollowingtabledescribesthepropertiespredefinedforaconfiguration.
Thepredefinedpropertiesareportnumbers.
Validportvaluesare1–65535.
OnUNIX,creatingsocketsthatlistenonports1–1024requiressuperuserprivileges.
Ifmorethanoneserverinstanceexistsonasystem,theportnumbersmustbeunique.
1234MoreInformationSeeAlsoWorkingwithNamedConfigurationsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007148PropertyNameDescriptionHTTP_LISTENER_PORTPortnumberforhttp-listener-1.
HTTP_SSL_LISTENER_PORTPortnumberforhttp-listener-2.
IIOP_SSL_LISTENER_PORTORBlistenerportforIIOPconnectionsonwhichIIOPlistenerSSLlistens.
IIOP_LISTENER_PORTORBlistenerportforIIOPconnectionsonwhichorb-listener-1listens.
JMX_SYSTEM_CONNECTOR_PORTPortnumberonwhichtheJMXconnectorlistens.
IIOP_SSL_MUTUALAUTH_PORTORBlistenerportforIIOPconnectionsonwhichtheIIOPlistenerSSL_MUTUALAUTHlistens.
ToEditaNamedConfiguration'sPropertiesInthetreecomponent,expandtheConfigurationsnode.
Selectthenodeforanamedconfiguration.
OntheConfigurationSystemPropertiespage,choosewhethertoenabledynamicreconfiguration.
Ifenabled,changestotheconfigurationareappliedtotheserverinstanceswithoutrequiringaserverrestart.
Add,delete,ormodifypropertiesasdesired.
Toeditthecurrentvaluesofapropertyforallinstancesassociatedwiththeconfiguration,clickInstanceValues.
Equivalentasadmincommandset"NamedConfigurations"onpage145"ToCreateaNamedConfiguration"onpage148"ToviewaNamedConfiguration'sTargets"onpage150"ToDeleteaNamedConfiguration"onpage15112345MoreInformationSeeAlsoWorkingwithNamedConfigurationsChapter6ManagingNamedConfigurations149ToEditPortNumbersforInstancesReferencingaConfigurationEachinstancereferencinganamedconfigurationinitiallyinheritsitsportnumbersfromthatconfiguration.
Sinceportnumbersmustbeuniqueonthesystem,youmightneedtooverridetheinheritedportnumbers.
Inthetreecomponent,expandtheConfigurationsnode.
Selectthenodeforanamedconfiguration.
TheAdminConsoledisplaystheConfigurationSystemPropertiespage.
ClickInstanceValuesnexttotheinstancevariableyouwanttoedit.
Forexample,ifyouclickInstanceValuesnexttotheHTTP-LISTENER-PORTinstancevariable,youseethevalueofHTTP-LISTENER-PORTforeveryserverinstancethatreferencesthatconfiguration.
ChangethevaluesasdesiredandclickSave.
Equivalentasadmincommandset"UniquePortNumbersandConfigurations"onpage147"NamedConfigurations"onpage145"EditingaNamedConfiguration'sProperties"onpage148ToviewaNamedConfiguration'sTargetsTheConfigurationSystemPropertiespagedisplaysalistofalltargetsusingtheconfiguration.
Foraclusterconfiguration,thetargetsareclusters.
Foraninstanceconfiguration,thetargetsareinstances.
Inthetreecomponent,expandtheConfigurationsnode.
Selectanodeforthenamedconfiguration.
"UniquePortNumbersandConfigurations"onpage147"NamedConfigurations"onpage145"ToCreateaNamedConfiguration"onpage148"EditingaNamedConfiguration'sProperties"onpage1481234MoreInformationSeeAlso12SeeAlsoWorkingwithNamedConfigurationsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007150"ToDeleteaNamedConfiguration"onpage151ToDeleteaNamedConfigurationInthetreecomponent,selecttheConfigurationsnode.
OntheConfigurationspage,selectthecheckboxforthenamedconfigurationtodelete.
Youcannotdeletethedefault-configconfiguration.
ClickDelete.
Equivalentasadmincommanddelete-config"NamedConfigurations"onpage145"ToCreateaNamedConfiguration"onpage148"EditingaNamedConfiguration'sProperties"onpage148"ToviewaNamedConfiguration'sTargets"onpage150123MoreInformationSeeAlsoWorkingwithNamedConfigurationsChapter6ManagingNamedConfigurations151152ConfiguringNodeAgentsThischapterdescribesthenodeagentsinApplicationServer.
Itcontainsthefollowingsections:"WhatIsaNodeAgent"onpage153"NodeAgentPlaceholders"onpage155"DeployingNodeAgents"onpage155"NodeAgentandDomainAdministrationServerSynchronization"onpage158"ViewingNodeAgentLogs"onpage162"TasksAvailablethroughtheAdminConsoleandasadminTool"onpage163"WorkingwithNodeAgents"onpage164"WorkingwithNodeAgentsusingasadmin"onpage169WhatIsaNodeAgentAnodeagentisalightweightprocessthatisrequiredoneverymachinethathostsserverinstances,includingthemachinethathoststheDomainAdministrationServer(DAS).
Thenodeagent:Starts,stops,createsanddeletesserverinstancesasinstructedbytheDomainAdministrationServer.
Restartsfailedserverinstances.
Providesaviewofthelogfilesoffailedservers.
Synchronizeseachserverinstance'slocalconfigurationrepositorywiththeDomainAdministrationServer'scentralrepository.
Eachlocalrepositorycontainsonlytheinformationpertinenttothatserverinstanceornodeagent.
Thefollowingfigureillustratestheoverallnodeagentarchitecture:7CHAPTER7153WhenyouinstalltheApplicationServer,anodeagentiscreatedbydefaultwiththehostnameofthemachine.
Thisnodeagentmustbemanuallystartedonthelocalmachinebeforeitruns.
Youcancreateanddeleteserverinstancesevenifthenodeagentisnotrunning.
However,thenodeagentmustberunningbeforeyouuseittostartandstopserverinstances.
Ifyoustopthenodeagent,theserverinstancesitmanagesarestoppedtoo.
Anodeagentservicesasingledomain.
Ifamachinehostsinstancesrunninginmultipledomains,itmustrunmultiplenodeagents.
SeeAlso"DeployingNodeAgents"onpage155"NodeAgentPlaceholders"onpage155"NodeAgentandDomainAdministrationServerSynchronization"onpage158"ToCreateaNodeAgentPlaceholder"onpage165NodeagentServer1(ClusterA)RepositorycacheServer2(ClusterB)StartandstopRepositorycacheRepositorycacheNodeagentServer3(ClusterA)RepositorycacheServer4(ClusterB)StartandstopRepositorycacheRepositorycacheDASAdminConsoleasadmintoolCentralrepositoryWhatIsaNodeAgentSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007154"CreatingaNodeAgent"onpage169"StartingaNodeAgent"onpage170"StoppingaNodeAgent"onpage171"DeletingaNodeAgent"onpage171NodeAgentPlaceholdersYoucancreateanddeleteserverinstanceswithoutanexistingnodeagentusinganodeagentplaceholder.
TheplaceholderisanodeagentconfigurationcreatedontheDomainAdministrationServer(DAS)beforethenodeagentitselfiscreatedonthenodeagent'slocalsystem.
Note–Onceyou'vecreatedaplaceholdernodeagent,useittocreateinstancesinthedomain.
However,beforestartingtheinstancesyoumustcreateandstarttheactualnodeagentlocallyonthemachinewheretheinstanceswillresideusingtheasadmincommand.
See"CreatingaNodeAgent"onpage169and"StartingaNodeAgent"onpage170SeeAlso:"ToCreateaNodeAgentPlaceholder"onpage165"WhatIsaNodeAgent"onpage153"DeployingNodeAgents"onpage155"NodeAgentandDomainAdministrationServerSynchronization"onpage158DeployingNodeAgentsYouconfigureanddeploynodeagentsintwoways:Onlinedeployment,whenyouknowyourtopologyandalreadyhavethehardwareforyourdomain.
Offlinedeployment,whenyouareconfiguringdomainsandserverinstancesbeforesettingupthefullenvironmentToDeployNodeAgentsOnlineUseonlinedeploymentifyoualreadyknowthedomaintopologyandhavethehardwareforyourdomain.
Thefollowingfiguresummarizestheonlinedeploymentofnodeagents:DeployingNodeAgentsChapter7ConfiguringNodeAgents155InstallandstarttheDomainAdministrationServer.
OncetheDomainAdministrationServerisupandrunning,begineitheronlineorofflinedeployment.
Installanodeagentoneverymachinethatwillhostaserverinstance.
Usetheinstallerortheasadmincreate-node-agentcommand.
Ifamachinerequiresmorethanonenodeagent,usetheasadmincreate-node-agentcommandtocreatethem.
See"CreatingaNodeAgent"onpage169formoreinformation.
Startthenodeagentsusingtheasadminstart-node-agentcommand.
Whenstarted,anodeagentcommunicateswiththeDomainAdministrationServer(DAS).
WhenitreachestheDAS,aconfigurationforthenodeagentiscreatedontheDAS.
Oncetheconfigurationexists,thenodeagentisviewableintheAdminConsole.
See"StartingaNodeAgent"onpage170formoreinformation.
Configurethedomain:createserverinstances,createclusters,anddeployingapplications.
ToDeployNodeAgentsOfflineUseofflinedeploymenttodeploynodeagentsinthedomainbeforeconfiguringtheindividuallocalmachines.
Thefollowingfiguresummarizestheofflinedeployment.
DAS3.
Createserverinstance.
LocalSystem2.
Runasadminstart-node-agent.
SynchswithDAS1.
Runasadmincreate-node-agent.
BeforeYouBegin123DeployingNodeAgentsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007156InstallandstarttheDomainAdministrationServer.
OncetheDomainAdministrationServerisupandrunning,begineitheronlineorofflinedeployment.
CreateplaceholdernodeagentsintheDomainAdministrationServer.
See"ToCreateaNodeAgentPlaceholder"onpage165formoreinformation.
Createserverinstancesandclusters,anddeployapplications.
Whencreatingaserverinstance,makesuretoassignportnumbersthatarenotalreadyinuse.
Becausetheconfigurationisbeingdoneoffline,thedomaincannotcheckforportconflictsatcreationtime.
Installanodeagentoneverymachinethatwillhostaserverinstance.
Usetheinstallerortheasadmincreate-node-agentcommand.
Thenodeagentsmusthavethesamenamesastheplaceholdernodeagentspreviouslycreated.
See"CreatingaNodeAgent"onpage169formoreinformation.
Startthenodeagentsusingtheasadminstart-node-agentcommand.
Whenanodeagentisstarted,itbindstotheDomainAdministrationServerandcreatesanyserverinstancespreviouslyassociatedwiththenodeagent.
See"StartingaNodeAgent"onpage170formoreinformation.
"WhatIsaNodeAgent"onpage153"NodeAgentPlaceholders"onpage155"NodeAgentandDomainAdministrationServerSynchronization"onpage158DAS1.
Createnodeagentconfiguration.
2.
Createserverinstance.
LocalSystem4.
Runasadminstart-node-agent.
SynchswithDASCreatesandstartsserverinstance3.
Runasadmincreate-node-agent.
BeforeYouBegin1234SeeAlsoDeployingNodeAgentsChapter7ConfiguringNodeAgents157"TasksAvailablethroughtheAdminConsoleandasadminTool"onpage163"CreatingaNodeAgent"onpage169"ToCreateaNodeAgentPlaceholder"onpage165"StartingaNodeAgent"onpage170NodeAgentandDomainAdministrationServerSynchronizationBecauseconfigurationdataisstoredintheDomainAdministrationServer'srepository(thecentralrepository)andalsocachedonthenodeagent'slocalmachine,thetwomustbesynchronized.
Thesynchronizationofcacheisalwaysdoneonaexplicituseractionthroughtheadministrationtools.
Thissectioncontainsthefollowingtopics:"NodeAgentSynchronization"onpage158"ServerInstanceSynchronization"onpage159"SynchronizingLibraryFiles"onpage160"UniqueSettingsandConfigurationManagement"onpage161"SynchronizingLargeApplications"onpage161NodeAgentSynchronizationWhenanodeagentisstartedforthefirsttime,itsendsarequesttotheDomainAdministrationServer(DAS)forthelatestinformationinthecentralrepository.
OnceitsuccessfullycontactstheDASandgetsconfigurationinformation,thenodeagentisboundtothatDAS.
Note–Bydefault,theasadminstart-node-agentcommandautomaticallystartstheremoteserverinstanceswithoutsynchronizingwithDAS.
IfyouarestartingaremoteserverinstancethatissynchronizedwiththecentralrepositorymanagedbyDAS,specifythe--startinstances=falseoptionoftheasadminstart-node-agentcommand.
Thenusetheasadminstart-instancecommandtostarttheremoteserverinstance.
IfyoucreatedaplaceholdernodeagentontheDAS,whenthenodeagentisstartedforthefirsttimeitgetsitsconfigurationfromthecentralrepositoryoftheDAS.
Duringitsinitialstart-up,ifthenodeagentisunabletoreachtheDASbecausetheDASisnotrunning,thenodeagentstopsandremainsunbound.
Ifchangesaremadeinthedomaintothenodeagent'sconfiguration,theyareautomaticallycommunicatedtothenodeagentonthelocalmachinewhilethenodeagentisrunning.
NodeAgentandDomainAdministrationServerSynchronizationSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007158IfyoudeleteanodeagentconfigurationontheDAS,thenexttimethenodeagentsynchronizes,itstopsandmarksitselfasawaitingdeletion.
Manuallydeleteitusingthelocalasadmindelete-node-agentcommand.
ServerInstanceSynchronizationIfyouexplicitlystartaserverinstancewiththeAdminConsoleorasadmintool,theserverinstanceissynchronizedwiththecentralrepository.
Ifthissynchronizationfails,theserverinstancedoesn'tstart.
IfanodeagentstartsaserverinstancewithoutanexplicitrequestthroughtheAdminConsoleortheasadmintool,therepositorycachefortheserverinstanceisnotsynchronized.
Theserverinstancerunswiththeconfigurationasstoredinitscache.
Youmustnotaddorremovefilesintheremoteserverinstance'scache.
Theremoteserverinstance'sconfigurationaretreatedascache(allfilesundernodeagents/na1/server1)andownedbyApplicationServer.
Inextremecases,ifuserremovesallfilesofaremoteserverinstanceandrestartsthenodeagent,theremoteserverinstance(forexample,server1)willberecreatedandallnecessaryfileswillbesynchronized.
ThefollowingfilesanddirectoriesarekeptsynchronizedbytheApplicationServer.
TABLE7–1FilesanddirectoriessynchronizedamongremoteserverinstancesFileordirectoryDescriptionapplicationsAlldeployedapplications.
Thepartsofthisdirectory(andsubdirectories)synchronizeddependontheapplicationsreferredtofromtheserverinstance.
TheNodeagentdoesnotsynchronizeanyoftheapplicationsbecauseitdoesnotreferenceanyapplication.
configContainsconfigurationfilesfortheentiredomain.
Allthefilesinthisdirectoryaresynchronizedexceptruntimetemporaryfiles,suchas,admch,admsn,secure.
seed,.
timestamp,and__timer_service_shutdown__.
dat.
config/config_nameDirectorytostorefilestobesharedbyallinstancesusingconfignamedconfig_name.
Therewillbeonesuchdirectoryforeveryconfigdefinedindomain.
xml.
Allthefilesinthisdirectoryaresynchronizedtotheserverinstancesthatareusingtheconfig_name.
config/config_name/lib/extFolderwhereJavaextensionclasses(asziporjararchives)canbedropped.
Thisisusedbyapplicationsdeployedtoserverinstancesusingconfignamedconfig_name.
ThesejarfilesareloadedusingJavaextensionmechanism.
docrootTheHTTPdocumentroot.
Inoutoftheboxconfiguration,allserverinstancesinthedomainusethesamedocroot.
Thedocrootpropertyofthevirtualserverneedstobeconfiguredtomaketheserverinstancesuseadifferentdocroot.
NodeAgentandDomainAdministrationServerSynchronizationChapter7ConfiguringNodeAgents159TABLE7–1Filesanddirectoriessynchronizedamongremoteserverinstances(Continued)FileordirectoryDescriptiongeneratedGeneratedfilesforJavaEEapplicationsandmodules,forexample,EJBstubs,compiledJSPclasses,andsecuritypolicyfiles.
Thisdirectoryissynchronizedalongwithapplicationsdirectory.
Therefore,onlythedirectoriescorrespondingtoapplicationsreferencedbyaserverinstancearesynchronized.
lib,lib/classesFolderwherecommonJavaclassfilesorjarandziparchivesusedbyapplicationsdeployedtoentiredomaincanbedropped.
TheseclassesareloadedusingApplicationServer'sclassloader.
Theloadorderinclassloaderis:lib/classes,lib/*.
jar,lib/*.
zip.
lib/extFolderwhereJavaextensionclasses(asziporjararchives)usedbyapplicationsdeployedtoentiredomaincanbedropped.
ThesejarfilesareloadedusingJavaextensionmechanism.
SynchronizingLibraryFilesThe--librariesdeploytimeattributeforanapplicationcanbeusedtospecifyruntimedependenciesofanapplication.
Tomakealibraryavailabletothewholedomain,youcouldplacetheJARfileindomain-dir/libordomain-dir/lib/classes.
(Formoreinformation,see"UsingtheCommonClassloader"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2Developer'sGuide.
)ThisisusuallythecaseforJDBCdriversandotherutilitylibrariesthataresharedbyallapplicationsinthedomain.
Forcluster-wideorstandaloneserverwideuse,copythejarsintothedomain-dir/domain1/config/xyz-config/libdirectory.
Next,addthejarsinclasspath-suffixorclasspath-prefixelementofxyz-config.
Thiswillsynchronizethejarsforallserverinstancesusingxyz-config.
Insummary:domains/domain1/lib-domainwidescope,commonclassloader,addsthejarsautomatically.
domains/domain1/config/cluster1,config/lib-configwide,updateclasspath-prefixorclasspath-suffix.
domains/domain1/config/cluster1,config/lib/ext-addstojava.
ext.
dirs(http://java.
sun.
com/j2se/1.
5.
0/docs/guide/extensions/extensions.
html)automatically.
NodeAgentandDomainAdministrationServerSynchronizationSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007160UniqueSettingsandConfigurationManagementConfigurationfiles(underdomains/domain1/configaresynchronizedacrossthedomain.
Ifyouwanttocustomizeaserver.
policyfileforaserver1-configusedbyastandaloneserverinstance(server1),placethemodifiedserver.
policyfileunderdomains/domain1/config/server1-configdirectory.
Thismodifiedserver.
policyfilewillonlybesynchronizedforthestandaloneserverinstance,server1.
Youshouldremembertoupdatethejvm-option.
Forexample:.
.
.
-Djava.
security.
policy=${com.
sun.
aas.
instanceRoot}/config/server1-config/server.
policySynchronizingLargeApplicationsWhenyourenvironmentcontainslargeapplicationstosynchronizeoravailablememoryisconstrained,youcanadjusttheJVMoptionstolimitmemoryusage.
Thisadjustmentreducesthepossibilityofreceivingoutofmemoryerrors.
TheinstancesynchronizationJVMusesdefaultsettings,butyoucanconfigureJVMoptionstochangethem.
SettheJVMoptionsusingtheINSTANCE-SYNC-JVM-OPTIONSproperty.
Thecommandtosetthepropertyis:asadminsetdomain.
node-agent.
node_agent_name.
property.
INSTANCE-SYNC-JVM-OPTIONS="JVM_options"Forexample:asadminsetdomain.
node-agent.
node0.
property.
INSTANCE-SYNC-JVM-OPTIONS="-Xmx32m-Xss2m"Inthisexample,thenodeagentisnode0andtheJVMoptionsare-Xmx32m-Xss2m.
Formoreinformation,seehttp://java.
sun.
com/docs/hotspot/VMOptions.
html.
Note–RestartthenodeagentafterchangingtheINSTANCE-SYNC-JVM-OPTIONSproperty,becausethenodeagentisnotautomaticallysynchronizedwhenapropertyisaddedorchangedinitsconfiguration.
NodeAgentandDomainAdministrationServerSynchronizationChapter7ConfiguringNodeAgents161UsingthedoNotRemoveListFlagIfyourapplicationrequirestostoreandreadfilesinthedirectories(applications,generated,docroot,config,lib)thataresynchronizedbytheApplicationServer,usethedoNotRemoveListflag.
Thisattributetakesacoma-separatedlistoffilesordirectories.
Yourapplicationdependentfilesarenotremovedduringserverstartup,eveniftheydonotexistinthecentralrepositorymanagedbyDAS.
Ifthesamefileexistsinthecentralrepository,theywillbeoverwrittenduringsynchronization.
UsetheINSTANCE-SYNC-JVM-OPTIONSpropertytopassinthedoNotRemoveListattribute.
Forexample:.
.
.
/logs,generated/mylogdir"/>ViewingNodeAgentLogsEachnodeagenthasitsownlogfile.
Ifyouexperienceproblemswithanodeagent,seethelogfileat:node_agent_dir/node_agent_name/agent/logs/server.
log.
Sometimesthenodeagentloginstructsyoutolookataserver'slogtogetadetailedmessageaboutaproblem.
Theserverlogsarelocatedat:node_agent_dir/node_agent_name/server_name/logs/server.
logThedefaultlocationfornode_agent_dirisinstall_dir/nodeagents.
ViewingNodeAgentLogsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007162TasksAvailablethroughtheAdminConsoleandasadminToolFornodeagents,sometasksmustbeperformedlocallyonthesystemwherethenodeagentruns,whileotherscanbeperformedontheDomainAdministrationServer.
Tasksthatneedtobeperformedlocallyareonlyavailablethroughtheasadmintoolrunningonthemachinewherethenodeagentresides.
TasksthatoperateontheDomainAdministrationServerareavailablethroughtheAdminConsoleandthroughtheasadmintoolThefollowingtablesummarizesthetasksandwheretorunthem:TABLE7–2TasksavailablethroughtheAdminConsoleandtheasadmincommandTaskAdminConsoleasadminCommandCreatenodeagentplaceholder/configurationonDomainAdministrationServerCreateNodeAgentplaceholderpagecreate-node-agent-configCreatenodeagentNotavailablecreate-node-agentStartnodeagentNotavailablestart-node-agentStopnodeagentNotavailablestop-nodeagentDeletenodeagentconfigurationfromDomainAdministrationServerNodeAgentspagedelete-node-agent-configDeletenodeagentfromlocalmachineNotavailabledelete-node-agentEditnodeagentconfigurationNodeAgentspagessetListnodeagentsNodeAgentspagelist-node-agentsFormoreinformation,see:"WhatIsaNodeAgent"onpage153"DeployingNodeAgents"onpage155"ToCreateaNodeAgentPlaceholder"onpage165"ToDeleteaNodeAgentConfiguration"onpage166"ToEditaNodeAgentConfiguration"onpage166"CreatingaNodeAgent"onpage169"StartingaNodeAgent"onpage170"StoppingaNodeAgent"onpage171"DeletingaNodeAgent"onpage171TasksAvailablethroughtheAdminConsoleandasadminToolChapter7ConfiguringNodeAgents163WorkingwithNodeAgents"ToViewGeneralNodeAgentInformation"onpage164"ToCreateaNodeAgentPlaceholder"onpage165"ToDeleteaNodeAgentConfiguration"onpage166"ToEditaNodeAgentConfiguration"onpage166"ToEditaNodeAgentRealm"onpage167"ToEdittheNodeAgent'sListenerforJMX"onpage168ToViewGeneralNodeAgentInformationInthetreecomponent,selecttheNodeAgentsnode.
Clickthenameofanodeagent.
Ifanodeagentalreadyexistsbutdoesnotappearhere,startthenodeagentonthenodeagent'shostmachineusingasadminstart-node-agent.
See"StartingaNodeAgent"onpage170Checkthenodeagent'shostname.
IfthehostnameisUnknownHost,thenthenodeagenthasnotmadeinitialcontactwiththeDomainAdministrationServer(DAS).
Checkthenodeagentstatus.
Thestatuscanbe:Running:Thenodeagenthasbeenproperlycreatedandiscurrentlyrunning.
NotRunning:Eitherthenodeagenthasbeencreatedonthelocalmachine,butneverstartedorthenodeagentwasstartedbuthasbeenstopped.
WaitingforRendezvous:Thenodeagentisaplaceholderthathasneverbeencreatedonthelocalmachine.
See"CreatingaNodeAgent"onpage169and"StartingaNodeAgent"onpage170Choosewhethertostartinstancesonstartup.
SelectYestostartserverinstancesassociatedwiththenodeagentautomaticallywhenthenodeagentisstarted.
SelectNotostarttheinstancesmanually.
DeterminewhetherthenodeagenthasmadecontactwiththeDomainAdministrationServer.
IfthenodeagenthasnevermadecontactwiththeDomainAdministrationServer,ithasneverbeensuccessfullystarted.
123456WorkingwithNodeAgentsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007164Manageserverinstancesassociatedwiththenodeagent.
Ifthenodeagentisrunning,startorstopaninstancebyclickingthecheckboxnexttotheinstancenameandclickingStartorStop.
"CreatingaNodeAgent"onpage169"StartingaNodeAgent"onpage170"TasksAvailablethroughtheAdminConsoleandasadminTool"onpage163"WhatIsaNodeAgent"onpage153"NodeAgentPlaceholders"onpage155"NodeAgentandDomainAdministrationServerSynchronization"onpage158"ToEditaNodeAgentConfiguration"onpage166"ToDeleteaNodeAgentConfiguration"onpage166ToCreateaNodeAgentPlaceholderBecausethenodeagentmustbecreatedlocallyonthemachinehostingthenodeagent,throughtheAdminConsoleyoucanonlycreateaplaceholderforanodeagent.
Thisplaceholderisanodeagentconfigurationforwhichanodeagentdoesnotyetexist.
Aftercreatingaplaceholder,usetheasadmincommandcreate-node-agentonthemachinehostingthenodeagenttocompletethecreation.
Formoreinformation,see"CreatingaNodeAgent"onpage169.
Foralistofthestepsinvolvedincreatingandusingnodeagents,see"DeployingNodeAgents"onpage155Inthetreecomponent,selecttheNodeAgentsnode.
OntheNodeAgentspage,clickNew.
OntheCurrentNodeAgentPlaceholderpage,enteranameforthenewnodeagent.
Thenamemustbeuniqueacrossallnodeagentnames,serverinstancenames,clusternames,andconfigurationnamesinthedomain.
ClickOK.
TheplaceholderforyournewnodeagentislistedontheNodeAgentspage.
Equivalentasadmincommandcreate-node-agent-config"TasksAvailablethroughtheAdminConsoleandasadminTool"onpage163"WhatIsaNodeAgent"onpage1537SeeAlso1234MoreInformationSeeAlsoWorkingwithNodeAgentsChapter7ConfiguringNodeAgents165"NodeAgentPlaceholders"onpage155"CreatingaNodeAgent"onpage169"StartingaNodeAgent"onpage170"ToEditaNodeAgentConfiguration"onpage166"ToDeleteaNodeAgentConfiguration"onpage166ToDeleteaNodeAgentConfigurationThroughtheAdminConsoleyoucanonlydeletethenodeagentconfigurationfromthedomain.
Youcannotdeletetheactualnodeagent.
Todeletethenodeagentitself,runtheasadmincommanddelete-node-agentonthenodeagent'slocalmachine.
Formoreinformation,see"DeletingaNodeAgent"onpage171.
Beforedeletingthenodeagentconfiguration,thenodeagentmustbestoppedanditmustnothaveanyassociatedinstances.
Tostopanodeagent,usetheasadmincommandstop-node-agent.
See"StoppingaNodeAgent"onpage171formoreinformation.
Inthetreecomponent,selecttheNodeAgentsnode.
OntheNodeAgentspage,selectthecheckboxnexttothenodeagenttobedeleted.
Clickdelete.
Equivalentasadmincommanddelete-node-agent-config"TasksAvailablethroughtheAdminConsoleandasadminTool"onpage163"WhatIsaNodeAgent"onpage153"NodeAgentPlaceholders"onpage155"StoppingaNodeAgent"onpage171"ToCreateaNodeAgentPlaceholder"onpage165"ToEditaNodeAgentConfiguration"onpage166"DeletingaNodeAgent"onpage171ToEditaNodeAgentConfigurationInthetreecomponent,expandtheNodeAgentsnode.
Selectthenodeagentconfigurationtoedit.
123MoreInformationSeeAlso12WorkingwithNodeAgentsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007166CheckStartInstancesonStartuptostarttheagent'sserverinstanceswhentheagentisstarted.
Youcanalsomanuallystartandstopinstancesfromthispage.
Ifthisconfigurationisforaplaceholdernodeagent,whenyoucreatetheactualnodeagentusingasadmincreate-node-agent,itpicksupthisconfiguration.
Forinformationoncreatinganodeagent,see"CreatingaNodeAgent"onpage169.
Ifthisconfigurationisforanexistingnodeagent,thenodeagentconfigurationinformationissynchronizedautomatically.
"TasksAvailablethroughtheAdminConsoleandasadminTool"onpage163"WhatIsaNodeAgent"onpage153"NodeAgentPlaceholders"onpage155"NodeAgentandDomainAdministrationServerSynchronization"onpage158"ToCreateaNodeAgentPlaceholder"onpage165"CreatingaNodeAgent"onpage169"StartingaNodeAgent"onpage170"ToDeleteaNodeAgentConfiguration"onpage166ToEditaNodeAgentRealmYoumustsetanauthenticationrealmforusersconnectingtothenodeagent.
Onlyadministrationusersshouldhaveaccesstothenodeagent.
Inthetreecomponent,expandtheNodeAgentsnode.
Selectthenodeagentconfigurationtoedit.
ClicktheAuthRealmtab.
OntheNodeAgentsEditRealmpage,enterarealm.
Thedefaultisadmin-realm,createdwhenyoucreatethenodeagent.
Touseadifferentrealm,replacetherealmsinallthecomponentscontrolledbythedomainorthecomponentswon'tcommunicateproperly.
IntheClassNamefield,specifytheJavaclassthatimplementstherealm.
Addanyrequiredproperties.
Authenticationrealmsrequireprovider-specificproperties,whichvarydependingonwhataparticularimplementationneeds.
"WhatIsaNodeAgent"onpage153"NodeAgentPlaceholders"onpage1553SeeAlso123456SeeAlsoWorkingwithNodeAgentsChapter7ConfiguringNodeAgents167"ToEditaNodeAgentConfiguration"onpage166ToEdittheNodeAgent'sListenerforJMXThenodeagentusesJMXtocommunicatewiththeDomainAdministrationServer.
ThereforeitmusthaveaporttolistenonforJMXrequests,andotherlistenerinformation.
Inthetreecomponent,expandtheNodeAgentsnode.
Selectthenodeagentconfigurationtoedit.
ClicktheJMXtab.
IntheAddressfield,enteranIPaddressorhostname.
Enter0.
0.
0.
0ifthelistenerlistensonallIPaddressesfortheserverusingauniqueportvalue.
Otherwise,enteravalidIPaddressfortheserver.
InthePortfield,typetheportonwhichthenodeagent'sJMXconnectorwilllisten.
IftheIPaddressis0.
0.
0.
0,theportnumbermustbeunique.
IntheJMXProtocolfield,typetheprotocolthattheJMXconnectorsupports.
Thedefaultisrmi_jrmp.
ClickthecheckboxnexttoAcceptAllAddressestoallowaconnectiontoallIPaddresses.
ThenodeagentlistensonaspecificIPaddressassociatedtoanetworkcardorlistensonallIPaddresses.
Acceptingalladdressesputsthevalue0.
0.
0.
0inthe"listeninghostaddress"property.
IntheRealmNamefield,typethenameoftherealmthathandlesauthenticationforthelistener.
IntheSecuritysectionofthispage,configurethelistenertouseSSL,TLS,orbothSSLandTLSsecurity.
Tosetupasecurelistener,dothefollowing:ChecktheEnabledboxintheSecurityfield.
Securityisenabledbydefault.
Setclientauthentication.
Torequireclientstoauthenticatethemselvestotheserverwhenusingthislistener,checktheEnabledboxintheClientAuthenticationfield.
12345678910WorkingwithNodeAgentsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007168Enteracertificatenickname.
EnterthenameofanexistingserverkeypairandcertificateintheCertificateNickNamefield.
Formoreinformation,see"WorkingwithCertificatesandSSL"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
IntheSSL3/TLSsection:a.
Checkthesecurityprotocol(s)toenableonthelistener.
YoumustcheckeitherSSL3orTLS,orbothprotocols.
b.
Checktheciphersuiteusedbytheprotocol(s).
Toenableallciphersuites,checkAllSupportedCipherSuites.
ClickSave.
"WhatIsaNodeAgent"onpage153"NodeAgentPlaceholders"onpage155"ToEditaNodeAgentConfiguration"onpage166WorkingwithNodeAgentsusingasadminYoucanperformthefollowingnodeagenttaskswithasadmin:"CreatingaNodeAgent"onpage169"StartingaNodeAgent"onpage170"StoppingaNodeAgent"onpage171"DeletingaNodeAgent"onpage171CreatingaNodeAgentTocreateanodeagent,runtheasadmincommandcreate-node-agentlocallyonthemachineonwhichthenodeagentruns.
Thedefaultnameforanodeagentisthehostnameonwhichthenodeagentiscreated.
Ifyou'vealreadycreatedanodeagentplaceholder,usethesamenameasthenodeagentplaceholdertocreatetheassociatednodeagent.
Ifyouhavenotcreatedanodeagentplaceholder,andtheDASisupandreachable,thecreate-node-agentcommandalsocreatesanodeagentconfiguration(placeholder)ontheDAS.
Foracompletedescriptionofthecommandsyntax,seetheonlinehelpforthecommand.
111213SeeAlsoWorkingwithNodeAgentsusingasadminChapter7ConfiguringNodeAgents169EXAMPLE7–1ExampleofCreatingaNodeAgentThefollowingcommandcreatesanodeagent:asadmincreate-node-agent--hostmyhost--port4849---useradminnodeagent1wheremyhostistheDomainAdministrationServer(DAS)hostname,4849istheDASportnumber,adminisyourDASuser,andnodeagent1isthenameofthenodeagentbeingcreated.
Note–Inthefollowingsituations,youmustspecifyaDNS-reachablehostname:Ifdomainscrosssubnetboundaries(thatis,thenodeagentandtheDomainAdministrationServer(DAS)areindifferentdomains,forexample,sun.
comandjava.
com)IfusingaDHCPmachinewithahostnamenotregisteredinDNS.
SpecifyaDNS-reachablehostnamebyexplicitlyspecifyingthehostnameforthedomainandthenodeagentwhenyoucreatethem:create-domain--domainpropertiesdomain.
hostName=DAS-host-namecreate-node-agent--hostDAS-host-name--agentpropertiesremoteclientaddress=node-agent-host-nameAnothersolutionistoupdatethehostshostname/IPresolutionfilespecifictotheplatformsothehostnameresolvestothecorrectIPaddress.
However,whenreconnectingusingDHCPyoumightgetassignedadifferentIPaddress.
Inthatcase,youmustupdatethehostresolutionfilesoneachserver.
Formoreinformation,see:"WhatIsaNodeAgent"onpage153"NodeAgentPlaceholders"onpage155"TasksAvailablethroughtheAdminConsoleandasadminTool"onpage163"DeployingNodeAgents"onpage155"ToCreateaNodeAgentPlaceholder"onpage165StartingaNodeAgentBeforeanodeagentcanmanageserverinstances,itmustberunning.
Startanodeagentbyrunningtheasadmincommandstart-node-agentlocallyonthesystemwherethenodeagentresides.
Foracompletedescriptionofthecommandsyntax,seetheonlinehelpforthecommand.
Forexample:WorkingwithNodeAgentsusingasadminSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007170asadminstart-node-agent--useradminnodeagent1whereadminisyouradministrationuser,andnodeagent1isthenodeagentbeingstarted.
Formoreinformation,see:"WhatIsaNodeAgent"onpage153"NodeAgentPlaceholders"onpage155"TasksAvailablethroughtheAdminConsoleandasadminTool"onpage163"DeployingNodeAgents"onpage155"ToEditaNodeAgentConfiguration"onpage166StoppingaNodeAgentRuntheasadmincommandstop-node-agentonthesystemwherethenodeagentresidestostoparunningnodeagent.
Thestop-node-agentcommandstopsallserverinstancesthatthenodeagentmanages.
Foracompletedescriptionofthecommandsyntax,seetheonlinehelpforthecommand.
Forexample:asadminstop-node-agentnodeagent1wherenodeagent1isthenameofthenodeagent.
Formoreinformation,see:"WhatIsaNodeAgent"onpage153"DeployingNodeAgents"onpage155"TasksAvailablethroughtheAdminConsoleandasadminTool"onpage163"StartingaNodeAgent"onpage170DeletingaNodeAgentBeforedeletinganodeagent,thenodeagentmustbestopped.
Youcanalsodeleteanodeagentifithasneverbeenstarted,orneversuccessfullyabletocontacttheDomainAdministrationServer(thatis,ifitisstillunbound).
Runtheasadmincommanddelete-node-agentonthesystemwherethenodeagentresidestodeletethenodeagentfiles.
Foracompletedescriptionofthecommandsyntax,seetheonlinehelpforthecommand.
Forexample:asadmindelete-node-agentnodeagent1WorkingwithNodeAgentsusingasadminChapter7ConfiguringNodeAgents171wherenodeagent1isyournodeagent.
Whendeletinganodeagent,youmustalsodeleteitsconfigurationfromtheDomainAdministrationServerusingeithertheAdminConsoleortheasadmindelete-node-agent-configcommandFormoreinformation,see:"WhatIsaNodeAgent"onpage153"DeployingNodeAgents"onpage155"TasksAvailablethroughtheAdminConsoleandasadminTool"onpage163"StoppingaNodeAgent"onpage171WorkingwithNodeAgentsusingasadminSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007172ConfiguringHighAvailabilitySessionPersistenceandFailoverThischapterexplainshowtoenableandconfigurehighavailabilitysessionpersistence:"OverviewofSessionPersistenceandFailover"onpage173"SettingUpHighAvailabilitySessionPersistence"onpage175"HTTPSessionFailover"onpage177"StatefulSessionBeanFailover"onpage181OverviewofSessionPersistenceandFailoverApplicationServerprovideshighavailabilitysessionpersistencethroughfailoverofHTTPsessiondataandstatefulsessionbean(SFSB)sessiondata.
Failovermeansthatintheeventofanserverinstanceorhardwarefailure,anotherserverinstancetakesoveradistributedsession.
RequirementsAdistributedsessioncanruninmultipleSunJavaSystemApplicationServerinstances,if:Eachserverinstancehasaccesstothesamehigh-availabilitydatabase(HADB).
Forinformationabouthowtoenablethisdatabase,seeconfigure-ha-cluster(1).
Eachserverinstancehasthesamedistributablewebapplicationdeployedtoit.
Theweb-appelementoftheweb.
xmldeploymentdescriptorfilemustcontainthedistributableelement.
Thewebapplicationuseshigh-availabilitysessionpersistence.
Ifanon-distributablewebapplicationisconfiguredtousehigh-availabilitysessionpersistence,theserverwritesanerrortothelogfile.
Thewebapplicationmustbedeployedusingthedeployordeploydircommandwiththe--availabilityenabledoptionsettotrue.
Formoreinformationonthesecommands,seedeploy(1)anddeploydir(1).
8CHAPTER8173RestrictionsWhenasessionfailsover,anyreferencestoopenfilesornetworkconnectionsarelost.
Applicationsmustbecodedwiththisrestrictioninmind.
Youcanonlybindcertainobjectstodistributedsessionsthatsupportfailover.
ContrarytotheServlet2.
4specification,SunJavaSystemApplicationServerdoesnotthrowanIllegalArgumentExceptionifanobjecttypenotsupportedforfailoverisboundintoadistributedsession.
Youcanbindthefollowingobjectsintoadistributedsessionthatsupportsfailover:LocalhomeandobjectreferencesforallEJBcomponents.
Co-locatedentitybean,statefulsessionbean,anddistributedentitybeanremotehomereference,remotereferenceDistributedsessionbeanremotehomeandremotereferencesJNDIContextforInitialContextandjava:comp/env.
UserTransactionobjects.
However,iftheinstancethatfailsisneverrestarted,anypreparedglobaltransactionsarelostandmightnotbecorrectlyrolledbackorcommitted.
SerializableJavatypesYoucannotbindthefollowingobjecttypesintosessionsthatsupportfailover:JDBCDataSourceJavaMessageService(JMS)ConnectionFactoryandDestinationobjectsJavaMailTMSessionConnectionFactoryAdministeredObjects.
WebservicereferenceIngeneral,fortheseobjects,failoverwillnotwork.
However,failovermightworkinsomecases,ifforexampletheobjectisserializable.
SampleApplicationsThefollowingdirectoriescontainsampleapplicationsthatdemonstratesessionpersistence:install_dir/samples/ee-samples/highavailabilityinstall_dir/samples/ee-samples/failoverThefollowingsampleapplicationdemonstratesSFSBsessionpersistence:install_dir/samples/ee-samples/failover/apps/sfsbfailoverOverviewofSessionPersistenceandFailoverSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007174SettingUpHighAvailabilitySessionPersistenceThissectionexplainshowtosetuphighavailabilitysessionpersistence,withthefollowingtopics:"ToSetUpHighAvailabilitySessionPersistence"onpage175"EnablingSessionAvailability"onpage176ToSetUpHighAvailabilitySessionPersistenceHighavailabilitysessionpersistenceisincompatiblewithdynamicdeployment,dynamicreloading,andauto-deployment.
Thesefeaturesarefordevelopment,notproductionenvironments,soyoumustdisablethembeforeenablingHAsessionpersistence.
Forinformationabouthowtodisablethesefeatures,seeChapter2,"DeployingApplications,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
CreateanApplicationServercluster.
Formoreinformation,see"ToCreateaCluster"onpage136.
CreateanHADBdatabaseforthecluster.
Formoreinformation,seeconfigure-ha-cluster(1).
SetupHTTPloadbalancingforthecluster.
Formoreinformation,see"SettingUpHTTPLoadBalancing"onpage105EnableavailabilityforthedesiredapplicationserverinstancesandweborEJBcontainers.
Thenconfigurethesessionpersistencesettings.
Chooseoneoftheseapproaches:UseAdminConsole.
See"EnablingAvailabilityforaServerInstance"onpage176.
Usetheasadmincommand-lineutility.
Seeset(1)andconfigure-ha-persistence(1).
Restarteachserverinstanceinthecluster.
Iftheinstanceiscurrentlyservingrequests,quiescetheinstancebeforerestartingitsothattheinstancegetsenoughtimetoservetherequestsitishandling.
Formoreinformation,see"Disabling(Quiescing)aServerInstanceorCluster"onpage121EnableavailabilityforanyspecificSFSBthatrequiresit.
Selectmethodsforwhichcheckpointingthesessionstateisnecessary.
See"ConfiguringAvailabilityforanIndividualBean"onpage184Makeeachwebmoduledistributableifyouwantittobehighlyavailable.
BeforeYouBegin1234567SettingUpHighAvailabilitySessionPersistenceChapter8ConfiguringHighAvailabilitySessionPersistenceandFailover175Enableavailabilityforindividualapplications,webmodules,orEJBmodulesduringdeployment.
See"ConfiguringAvailabilityforanIndividualApplicationorEJBModule"onpage184IntheAdministrationConsole,checktheAvailabilityEnabledbox,orusetheasadmindeploycommandwiththe--availabilityenabledoptionsettotrue.
EnablingSessionAvailabilityYoucanenablesessionavailabilityatfivedifferentscopes(fromhighesttolowest):1.
Serverinstance,enabledbydefault.
Forinstructions,seenextsection,"EnablingAvailabilityforaServerInstance"onpage176.
2.
Container(weborEJB),enabledbydefault.
Forinformationonenablingavailabilityatthecontainerlevel,see:"ConfiguringAvailabilityfortheWebContainer"onpage177"ConfiguringAvailabilityfortheEJBContainer"onpage1823.
Application,disabledbydefault4.
Stand-aloneweborEJBmodule,disabledbydefault5.
IndividualSFSB,disabledbydefaultToenableavailabilityatagivenscope,youmustenableitatallhigherlevelsaswell.
Forexample,toenableavailabilityattheapplicationlevel,youmustalsoenableitattheserverinstanceandcontainerlevels.
Thedefaultforagivenlevelisthesettingatthenextlevelup.
Forexample,ifavailabilityisenabledatthecontainerlevel,itisenabledbydefaultattheapplicationlevel.
Whenavailabilityisdisabledattheserverinstancelevel,enablingitatanyotherlevelhasnoeffect.
Whenavailabilityisenabledattheserverinstancelevel,itisenabledatalllevelsunlessexplicitlydisabled.
EnablingAvailabilityforaServerInstanceToenableavailabilityforaserverinstance,usetheasadminsetcommandtosettheconfiguration'savailability-service.
availability-enabledpropertytotrue.
Forexample,ifconfig1istheconfigurationname:asadminset--useradmin--passwordfilepassword.
txt--hostlocalhost--port4849config1.
availability-service.
availability-enabled="true"8SettingUpHighAvailabilitySessionPersistenceSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007176ToEnableAvailabilityfortheServerInstancewithAdminConsoleInthetreecomponent,expandtheConfigurationsnode.
Expandthenodefortheconfigurationyouwanttoedit.
SelecttheAvailabilityServicenode.
IntheAvailabilityServicepage,enableinstancelevelavailabilitybycheckingtheAvailabilityServicebox.
Todisableit,uncheckthebox.
Additionally,youcanchangetheStorePoolNameifyouchangedtheJDBCresourceusedforconnectionstotheHADBforsessionpersistence.
Fordetails,seeconfigure-ha-cluster(1).
ClickontheSavebutton.
Stopandrestarttheserverinstance.
HTTPSessionFailoverJ2EEapplicationstypicallyhavesignificantamountsofsessionstatedata.
Awebshoppingcartistheclassicexampleofsessionstate.
Also,anapplicationcancachefrequently-neededdatainthesessionobject.
Infact,almostallapplicationswithsignificantuserinteractionsneedtomaintainsessionstate.
ConfiguringAvailabilityfortheWebContainerToenableandconfigurewebcontaineravailabilityusingasadmin,seeconfigure-ha-persistence(1).
Alternatively,usetheasadminsetcommandtosettheconfiguration'savailability-service.
web-container-availability.
availability-enabledpropertytotrueandthenconfigure-ha-persistencetosetpropertiesasdesired.
Forexample,usethesetcommandasfollows,whereconfig1istheconfigurationname:asadminset--useradmin--passwordfilepassword.
txt--hostlocalhost--port4849config1.
availability-service.
web-container-availability.
availability-enabled="true"asadminconfigure-ha-persistence--useradmin--passwordfilesecret.
txt--typeha--frequencyweb-method123456HTTPSessionFailoverChapter8ConfiguringHighAvailabilitySessionPersistenceandFailover177--scopemodified-session--storejdbc/hastore--propertymaxSessions=1000:reapIntervalSeconds=60cluster1ToEnableAvailabilityfortheWebContainerwithAdminConsoleInthetreecomponent,selectthedesiredconfiguration.
ClickonAvailabilityService.
SelecttheWebContainerAvailabilitytab.
ChecktheAvailabilityServiceboxtoenableavailability.
Todisableit,uncheckthebox.
Changeothersettings,asdescribedinthefollowingsection,"AvailabilitySettings"onpage178Restarttheserverinstance.
AvailabilitySettingsTheWebContainerAvailabilitytaboftheAvailabilityServiceenablesyoutochangetheseavailabilitysettings:PersistenceType:Specifiesthesessionpersistencemechanismforwebapplicationsthathaveavailabilityenabled.
Allowedvaluesarememory(nopersistence)file(thefilesystem)andha(HADB).
HADBmustbeconfiguredandenabledbeforeyoucanusehasessionpersistence.
Forconfigurationdetails,seeconfigure-ha-cluster(1).
Ifwebcontaineravailabilityisenabled,thedefaultisha.
Otherwise,thedefaultismemory.
Forproductionenvironmentsthatrequiresessionpersistence,useha.
Thefirsttwotypes,memoryandfilepersistence,donotprovidehighavailabilitysessionpersistence.
PersistenceFrequency:Specifieshowoftenthesessionstateisstored.
ApplicableonlyifthePersistenceTypeisha.
Allowedvaluesare:web-method-Thesessionstateisstoredattheendofeachwebrequestpriortosendingaresponsebacktotheclient.
Thismodeprovidesthebestguaranteethatthesessionstateisfullyupdatedincaseoffailure.
Thisisthedefault.
time-based-ThesessionstateisstoredinthebackgroundatthefrequencysetbythereapIntervalSecondsstoreproperty.
Thismodeprovidesdoesnotguaranteethatsessionstateisfullyupdated.
However,itcanprovideasignificantperformanceimprovementbecausethestateisnotstoredaftereachrequest.
PersistenceScope:Specifieshowmuchofthesessionobjectandhowoftensessionstateisstored.
ApplicableonlyifthePersistenceTypeisha.
Allowedvaluesareasfollows:12345HTTPSessionFailoverSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007178session-Theentiresessionstateisstoredeverytime.
Thismodeprovidesthebestguaranteethatyoursessiondataiscorrectlystoredforanydistributablewebapplication.
Thisisthedefault.
modified-session-Theentiresessionstateisstoredifithasbeenmodified.
AsessionisconsideredtohavebeenmodifiedifHttpSession.
setAttribute()orHttpSession.
removeAttribute()wascalled.
YoumustguaranteethatsetAttribute()iscalledeverytimeanattributeischanged.
ThisisnotaJ2EEspecificationrequirement,butitisrequiredforthismodetoworkproperly.
modified-attribute-Onlymodifiedsessionattributesarestored.
Forthismodetoworkproperly,youmustfollowafewguidelines:CallsetAttribute()everytimethesessionstateismodified.
Makesuretherearenocross-referencesbetweenattributes.
Theobjectgraphundereachdistinctattributekeyisserializedandstoredseparately.
Ifthereareanyobjectcrossreferencesbetweentheobjectsundereachseparatekey,theyarenotserializedanddeserializedcorrectly.
Distributethesessionstateacrossmultipleattributes,oratleastbetweenaread-onlyattributeandamodifiableattribute.
SingleSign-OnState:Checkthisboxtoenablepersistenceofthesinglesign-onstate.
Todisableit,uncheckthebox.
Formoreinformation,see"UsingSingleSign-onwithSessionFailover"onpage180HTTPSessionStore:YoucanchangetheHTTPSessionStoreifyouchangedtheJDBCresourceusedforconnectionstotheHADBforsessionpersistence.
Fordetails,seeconfigure-ha-cluster(1).
ConfiguringAvailabilityforIndividualWebApplicationsToenableandconfigureavailabilityforanindividualwebapplication,edittheapplicationdeploymentdescriptorfile,sun-web.
xml.
Thesettingsinanapplication'sdeploymentdescriptoroverridethewebcontainer'savailabilitysettings.
Thesession-managerelement'spersistence-typeattributedeterminesthetypeofsessionpersistenceanapplicationuses.
Itmustbesettohatoenablehighavailabilitysessionpersistence.
Formoreinformationaboutthesun-web.
xmlfile,see"Thesun-web.
xmlFile"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2Developer'sGuide.
HTTPSessionFailoverChapter8ConfiguringHighAvailabilitySessionPersistenceandFailover179Example.
.
.
.
.
.
.
.
.
UsingSingleSign-onwithSessionFailoverInasingleapplicationserverinstance,onceauserisauthenticatedbyanapplication,theuserisnotrequiredtore-authenticateindividuallytootherapplicationsrunningonthesameinstance.
Thisiscalledsinglesign-on.
Formoreinformation,see"UserAuthenticationforSingleSign-on"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2Developer'sGuide.
ForthisfeaturetocontinuetoworkevenwhenanHTTPsessionfailsovertoanotherinstanceinacluster,singlesign-oninformationmustbepersistedtotheHADB.
Topersistsinglesign-oninformation,first,enableavailabilityfortheserverinstanceandthewebcontainer,thenenablesingle-sign-onstatefailover.
Youcanenablesinglesign-onstatefailoverwiththeAdminConsoleintheWebContainerAvailabilitytaboftheAvailabilityService,asdescribedin"ConfiguringAvailabilityfortheWebContainer"onpage177asadminsetcommandtosettheconfiguration'savailability-service.
web-container-availability.
sso-failover-enabledpropertytotrue.
Forexample,usethesetcommandasfollows,whereconfig1istheconfigurationname:asadminset--useradmin--passwordfilepassword.
txt--hostlocalhost--port4849config1.
availability-service.
web-container-availability.
sso-failover-enabled="true"SingleSign-OnGroupsApplicationsthatcanbeaccessedthroughasinglenameandpasswordcombinationconstituteasinglesign-ongroup.
ForHTTPsessionscorrespondingtoapplicationsthatarepartofasinglesign-ongroup,ifoneofthesessionstimesout,othersessionsarenotinvalidatedandcontinuetobeavailable.
Thisisbecausetimeoutofonesessionshouldnotaffecttheavailabilityofothersessions.
HTTPSessionFailoverSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007180Asacorollaryofthisbehavior,ifasessiontimesoutandyoutrytoaccessthecorrespondingapplicationfromthesamebrowserwindowthatwasrunningthesession,youarenotrequiredtoauthenticateagain.
However,anewsessioniscreated.
Taketheexampleofashoppingcartapplicationthatisapartofasinglesign-ongroupwithtwootherapplications.
Assumethatthesessiontimeoutvaluefortheothertwoapplicationsishigherthanthesessiontimeoutvaluefortheshoppingcartapplication.
Ifyoursessionfortheshoppingcartapplicationtimesoutandyoutrytoruntheshoppingcartapplicationfromthesamebrowserwindowthatwasrunningthesession,youarenotrequiredtoauthenticateagain.
However,thepreviousshoppingcartislost,andyouhavetocreateanewshoppingcart.
Theothertwoapplicationscontinuetorunasusualeventhoughthesessionrunningtheshoppingcartapplicationhastimedout.
Similarly,supposeasessioncorrespondingtoanyoftheothertwoapplicationstimesout.
Youarenotrequiredtoauthenticateagainwhileconnectingtotheapplicationfromthesamebrowserwindowinwhichyouwererunningthesession.
Note–Thisbehaviorappliesonlytocaseswherethesessiontimesout.
Ifsinglesign-onisenabledandyouinvalidateoneofthesessionsusingHttpSession.
invalidate(),thesessionsforallapplicationsbelongingtothesinglesign-ongroupareinvalidated.
Ifyoutrytoaccessanyapplicationbelongingtothesinglesign-ongroup,youarerequiredtoauthenticateagain,andanewsessioniscreatedfortheclientaccessingtheapplication.
StatefulSessionBeanFailoverStatefulsessionbeans(SFSBs)containclient-specificstate.
Thereisaone-to-onerelationshipbetweenclientsandthestatefulsessionbeans.
Atcreation,theEJBcontainergiveseachSFSBauniquesessionIDthatbindsittoaclient.
AnSFSB'sstatecanbesavedinapersistentstoreincaseaserverinstancefails.
ThestateofanSFSBissavedtothepersistentstoreatpredefinedpointsinitslifecycle.
Thisiscalledcheckpointing.
Ifenabled,checkpointinggenerallyoccursafterthebeancompletesanytransaction,evenifthetransactionrollsback.
However,ifanSFSBparticipatesinabean-managedtransaction,thetransactionmightbecommittedinthemiddleoftheexecutionofabeanmethod.
Sincethebean'sstatemightbeundergoingtransitionasaresultofthemethodinvocation,thisisnotanappropriatetimetocheckpointthebean'sstate.
Inthiscase,theEJBcontainercheckpointsthebean'sstateattheendofthecorrespondingmethod,providedthebeanisnotinthescopeofanothertransactionwhenthatmethodends.
Ifabean-managedtransactionspansacrossmultiplemethods,checkpointingisdelayeduntilthereisnoactivetransactionattheendofasubsequentmethod.
StatefulSessionBeanFailoverChapter8ConfiguringHighAvailabilitySessionPersistenceandFailover181ThestateofanSFSBisnotnecessarilytransactionalandmightbesignificantlymodifiedasaresultofnon-transactionalbusinessmethods.
IfthisisthecaseforanSFSB,youcanspecifyalistofcheckpointedmethods,asdescribedin"SpecifyingMethodstoBeCheckpointed"onpage185IfadistributablewebapplicationreferencesanSFSB,andthewebapplication'ssessionfailsover,theEJBreferenceisalsofailedover.
IfanSFSBthatusessessionpersistenceisundeployedwhiletheApplicationServerinstanceisstopped,thesessiondatainthepersistencestoremightnotbecleared.
Topreventthis,undeploytheSFSBwhiletheApplicationServerinstanceisrunning.
ConfiguringAvailabilityfortheEJBContainerToEnableAvailabilityfortheEJBContainerSelecttheEJBContainerAvailabilitytab.
ChecktheAvailabilityServicebox.
Todisableavailability,uncheckthebox.
Changeothersettingsasdescribedin"AvailabilitySettings"onpage183ClickontheSavebutton.
Restarttheserverinstance.
EquivalentasadmincommandToenableavailabilityfortheEJBcontainerusetheasadminsetcommandtosetthefollowingthreepropertiesfortheconfiguration:availability-service.
ejb-container-availability.
availability-enabledavailability-service.
ejb-container-availability.
sfsb-persistence-typeavailability-service.
ejb-container-availability.
sfsb-ha-persistence-type12345MoreInformationStatefulSessionBeanFailoverSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007182Forexample,ifconfig1istheconfigurationname,usethefollowingcommands:asadminset--useradmin--passwordfilepassword.
txt--hostlocalhost--port4849config1.
availability-service.
ejb-container-availability.
availability-enabled="true"asadminset--useradmin--passwordfilepassword.
txt--hostlocalhost--port4849config1.
availability-service.
ejb-container-availability.
sfsb-persistence-type="file"asadminset--useradmin--passwordfilepassword.
txt--hostlocalhost--port4849config1.
availability-service.
ejb-container-availability.
sfsb-ha-persistence-type="ha"AvailabilitySettingsTheEJBContainerAvailabilitytaboftheAvailabilityServiceenablesyoutochangethesesettings:HAPersistenceType:SpecifiesthesessionpersistenceandpassivationmechanismforSFSBsthathaveavailabilityenabled.
Allowedvaluesarefile(thefilesystem)andha(HADB).
Forproductionenvironmentsthatrequiresessionpersistence,useha,thedefault.
SFSBPersistenceType:SpecifiesthepassivationmechanismforSFSBsthatdonothaveavailabilityenabled.
Allowedvaluesarefile(thedefault)andha.
IfeitherPersistenceTypeissettofile,theEJBcontainerspecifiesthefilesystemlocationwherethepassivatedsessionbeanstateisstored.
Checkpointingtothefilesystemisusefulfortestingbutisnotforproductionenvironments.
Formoreinformation,see"Toconfigurethestoreproperties"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
HApersistenceenablesaclusterofserverinstancestorecovertheSFSBstateifanyserverinstancefails.
HADBisalsousedasthepassivationandactivationstore.
UsethisoptioninaproductionenvironmentthatrequiresSFSBstatepersistence.
Formoreinformation,seeconfigure-ha-cluster(1).
SFSBStorePoolName:YoucanchangetheSFSBStorePoolNameifyouchangedtheJDBCresourceusedforconnectionstotheHADBforsessionpersistence.
Fordetails,seeconfigure-ha-cluster(1).
StatefulSessionBeanFailoverChapter8ConfiguringHighAvailabilitySessionPersistenceandFailover183ConfiguringtheSFSBSessionStoreWhenAvailabilityIsDisabledIfavailabilityisdisabled,thelocalfilesystemisusedforSFSBstatepassivation,butnotpersistence.
TochangewheretheSFSBstateisstored,changetheSessionStoreLocationsettingintheEJBcontainer.
Formoreinformation,see"Toconfigurethestoreproperties"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
.
ConfiguringAvailabilityforanIndividualApplicationorEJBModuleYoucanenableSFSBavailabilityforanindividualapplicationorEJBmoduleduringdeployment:IfyouaredeployingwiththeAdminConsole,checktheAvailabilityEnabledcheckbox.
Ifyouaredeployingusingusetheasadmindeployorasadmindeploydircommands,setthe--availabilityenabledoptiontotrue.
Formoreinformation,seedeploy(1)anddeploydir(1).
ConfiguringAvailabilityforanIndividualBeanToenableavailabilityandselectmethodstobecheckpointedforanindividualSFSB,usethesun-ejb-jar.
xmldeploymentdescriptorfile.
.
Toenablehighavailabilitysessionpersistence,setavailability-enabled="true"intheejbelement.
TocontrolthesizeandbehavioroftheSFSBcache,usethefollowingelements:max-cache-size:specifiesthemaximumnumberofsessionbeansthatareheldincache.
Ifthecacheoverflows(thenumberofbeansexceedsmax-cache-size),thecontainerthenpassivatessomebeansorwritesouttheserializedstateofthebeanintoafile.
ThedirectoryinwhichthefileiscreatedisobtainedfromtheEJBcontainerusingtheconfigurationAPIs.
resize-quantitycache-idle-timeout-in-secondsremoval-timeout-in-secondsvictim-selection-policyFormoreinformationaboutsun-ejb-jar.
xml,see"Thesun-ejb-jar.
xmlFile"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2Developer'sGuideEXAMPLE8–1ExampleofanEJBDeploymentDescriptorWithAvailabilityEnabled.
.
.
StatefulSessionBeanFailoverSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007184EXAMPLE8–1ExampleofanEJBDeploymentDescriptorWithAvailabilityEnabled(Continued).
.
.
MySFSB.
.
.
SpecifyingMethodstoBeCheckpointedIfenabled,checkpointinggenerallyoccursafterthebeancompletesanytransaction,evenifthetransactionrollsback.
TospecifyadditionaloptionalcheckpointingofSFSBsattheendofnon-transactionalbusinessmethodsthatcauseimportantmodificationstothebean'sstate,usethecheckpoint-at-end-of-methodelementintheejbelementofthesun-ejb-jar.
xmldeploymentdescriptorfile.
Thenon-transactionalmethodsinthecheckpoint-at-end-of-methodelementcanbe:create()methodsdefinedinthehomeinterfaceoftheSFSB,ifyouwanttocheckpointtheinitialstateoftheSFSBimmediatelyaftercreationForSFSBsusingcontainermanagedtransactionsonly,methodsintheremoteinterfaceofthebeanmarkedwiththetransactionattributeTX_NOT_SUPPORTEDorTX_NEVERForSFSBsusingbeanmanagedtransactionsonly,methodsinwhichabeanmanagedtransactionisneitherstartednorcommittedAnyothermethodsmentionedinthislistareignored.
Attheendofinvocationofeachofthesemethods,theEJBcontainersavesthestateoftheSFSBtopersistentstore.
Note–IfanSFSBdoesnotparticipateinanytransaction,andifnoneofitsmethodsareexplicitlyspecifiedinthecheckpoint-at-end-of-methodelement,thebean'sstateisnotcheckpointedatallevenifavailability-enabled="true"forthisbean.
Forbetterperformance,specifyasmallsubsetofmethods.
Themethodsshouldaccomplishasignificantamountofworkorresultinimportantmodificationtothebean'sstate.
EXAMPLE8–2ExampleofEJBDeploymentDescriptorSpecifyingMethodsCheckpointing.
.
.
.
.
.
StatefulSessionBeanFailoverChapter8ConfiguringHighAvailabilitySessionPersistenceandFailover185EXAMPLE8–2ExampleofEJBDeploymentDescriptorSpecifyingMethodsCheckpointing(Continued)ShoppingCartEJBaddToCart.
.
.
StatefulSessionBeanFailoverSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007186JavaMessageServiceLoadBalancingandFailoverThischapterdescribeshowtoconfigureloadbalancingandfailoveroftheJavaMessageService(JMS)forusewiththeApplicationServer.
Itcontainsthefollowingtopics:"OverviewofJavaMessageService"onpage187"ConfiguringtheJavaMessageService"onpage188"ConnectionPoolingandFailover"onpage191"UsingMQClusterswithApplicationServer"onpage192OverviewofJavaMessageServiceTheJavaMessageService(JMS)APIisamessagingstandardthatallowsJ2EEapplicationsandcomponentstocreate,send,receive,andreadmessages.
Itenablesdistributedcommunicationthatislooselycoupled,reliable,andasynchronous.
TheSunJavaSystemMessageQueue32005Q1(MQ),whichimplementsJMS,istightlyintegratedwithApplicationServer,enablingyoutocreatecomponentssuchasmessage-drivenbeans(MDBs).
MQisintegratedwithApplicationServerusingaconnectormodule,alsoknownasaresourceadapter,definedbytheJ2EEConnectorArchitectureSpecification1.
5.
J2EEcomponentsdeployedtotheApplicationServerexchangeJMSmessagesusingtheJMSproviderintegratedviatheconnectormodule.
CreatingaJMSresourceinApplicationServercreatesaconnectorresourceinthebackground.
So,eachJMSoperationinvokestheconnectorruntimeandusestheMQresourceadapterinthebackground.
YoucanmanagetheJavaMessageServicethroughtheAdminConsoleortheasadmincommand-lineutility.
SampleApplicationThemqfailoversampleapplicationdemonstratesMQfailoverwithaMessageDrivenBeanreceivingincomingmessagesfromaJMSTopic.
ThesamplecontainsanMDBanda9CHAPTER9187applicationclient.
TheApplicationServermakestheMDBhighlyavailable.
Ifonebrokergoesdown,theconversationalstate(themessagesreceivedbyMDB)ismigratedtransparentlytoanotheravailablebrokerinstanceinthecluster.
Thesampleisinstalledtoinstall_dir/samples/ee-samples/failover/apps/mqfailoverFurtherInformationFormoreinformationonJMS,seeChapter14,"UsingtheJavaMessageService,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2Developer'sGuide.
Formoreinformationonconnectors(resourceadapters),seeChapter9,"DevelopingConnectors,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2Developer'sGuide.
FormoreinformationabouttheSunJavaSystemMessageQueue,seetheSunJavaSystemMessageQueuedocumentation.
ForgeneralinformationabouttheJMSAPI,seetheJMSwebpage(http://java.
sun.
com/products/jms/index.
html)ConfiguringtheJavaMessageServiceTheJavaMessageServiceconfigurationisavailabletoallinboundandoutboundconnectionstotheSunJavaSystemApplicationServerclusterorinstance.
YoucanconfiguretheJavaMessageServicewith:TheAdministrationConsole.
OpentheJavaMessageServicecomponentundertherelevantconfiguration.
Fordetails,seeChapter4,"ConfiguringJavaMessageServiceResources,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
Theasadminsetcommand.
Youcansetthefollowingattributes:server.
jms-service.
init-timeout-in-seconds=60server.
jms-service.
type=LOCALserver.
jms-service.
start-args=server.
jms-service.
default-jms-host=default_JMS_hostserver.
jms-service.
reconnect-interval-in-seconds=60server.
jms-service.
reconnect-attempts=3server.
jms-service.
reconnect-enabled=trueserver.
jms-service.
addresslist-behavior=randomserver.
jms-service.
addresslist-iterations=3server.
jms-service.
mq-scheme=mqserver.
jms-service.
mq-service=jmsYoucanalsosettheseproperties:ConfiguringtheJavaMessageServiceSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007188server.
jms-service.
property.
instance-name=imqbrokerserver.
jms-service.
property.
instance-name-suffix=server.
jms-service.
property.
append-version=falseUsetheasadmingetcommandtolistalltheJavaMessageServiceattributesandproperties.
Formoreinformationonasadminget,seeget(1).
Formoreinformationonasadminset,seeset(1).
YoucanoverridetheJavaMessageServiceconfigurationusingJMSconnectionfactorysettings.
Fordetails,see"AdminConsoleTasksforJMSConnectionFactories"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
Note–YoumustrestarttheApplicationServerinstanceafterchangingtheconfigurationoftheJavaMessageService.
FormoreinformationaboutJMSadministration,seeChapter4,"ConfiguringJavaMessageServiceResources,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuideJavaMessageServiceIntegrationMQcanbeintegratedwithApplicationServerintwoways:LOCALandREMOTE,representedinAdminConsolebytheJavaMessageServiceTypeattribute.
LOCALJavaMessageServiceWhentheTypeattributeisLOCAL(thedefaultforastand-aloneApplicationServerinstances),theApplicationServerwillstartandstoptheMQbrokerspecifiedastheDefaultJMShost.
LOCALtypeismostsuitableforstandaloneApplicationServerinstances.
Tocreateaone-to-onerelationshipbetweenApplicationServerinstancesandMessageQueuebrokers,setthetypetoLOCALandgiveeachApplicationServerinstanceadifferentdefaultJMShost.
YoucandothisregardlessofwhetherclustersaredefinedintheApplicationServerorMQ.
WithLOCALtype,usetheStartArgumentsattributetospecifyMQbrokerstartupparameters.
REMOTEJavaMessageServiceWhentheTypeattributeisREMOTE,theMQbrokermustbestartedseparately.
ThisisthedefaultifclustersaredefinedintheApplicationServer.
Forinformationaboutstartingthebroker,seetheSunJavaSystemMessageQueueAdministrationGuide.
ConfiguringtheJavaMessageServiceChapter9JavaMessageServiceLoadBalancingandFailover189Inthiscase,ApplicationServerwilluseanexternallyconfiguredbrokerorbrokercluster.
Also,youmuststartandstopMQbrokersseparatelyfromApplicationServer,anduseMQtoolstoconfigureandtunethebrokerorbrokercluster.
REMOTEtypeismostsuitableforApplicationServerclusters.
WithREMOTEtype,youmustspecifyMQbrokerstartupparametersusingMQtools.
TheStartArgumentsattributeisignored.
JMSHostsListAJMShostrepresentsanMQbroker.
TheJavaMessageServicecontainsaJMSHostslist(alsocalledAddressList)thatcontainsalltheJMShoststhatApplicationServeruses.
TheJMSHostslistispopulatedwiththehostsandportsofthespecifiedMQbrokersandisupdatedwheneveraJMShostconfigurationchanges.
WhenyoucreateJMSresourcesordeployMDBs,theyinherittheJMSHostslist.
Note–IntheSunJavaSystemMessageQueuesoftware,theAddressListpropertyiscalledimqAddressList.
DefaultJMSHostOneofthehostsintheJMSHostslistisdesignatedthedefaultJMShost,namedDefault_JMS_host.
TheApplicationServerinstancestartsthedefaultJMShostwhentheJavaMessageServicetypeisconfiguredasLOCAL.
Ifyouhavecreatedamulti-brokerclusterintheSunJavaSystemMessageQueuesoftware,deletethedefaultJMShost,thenaddtheMessageQueuecluster'sbrokersasJMShosts.
Inthiscase,thedefaultJMShostbecomesthefirstoneintheJMSHostslist.
WhentheApplicationServerusesaMessageQueuecluster,itexecutesMessageQueuespecificcommandsonthedefaultJMShost.
Forexample,whenaphysicaldestinationiscreatedforaMessageQueueclusterofthreebrokers,thecommandtocreatethephysicaldestinationisexecutedonthedefaultJMShost,butthephysicaldestinationisusedbyallthreebrokersinthecluster.
CreatingJMSHostsYoucancreateadditionalJMShostsinthefollowingways:UsetheAdministrationConsole.
OpentheJavaMessageServicecomponentundertherelevantconfiguration,selecttheJMSHostscomponent,andthenclickNew.
Formoreinformation,see"TocreateaJMShost"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
ConfiguringtheJavaMessageServiceSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007190Usetheasadmincreate-jms-hostcommand.
Fordetails,seecreate-jms-host(1).
TheJMSHostslistisupdatedwheneveraJMShostconfigurationchanges.
ConnectionPoolingandFailoverApplicationServersupportsJMSconnectionpoolingandfailover.
TheSunJavaSystemApplicationServerpoolsJMSconnectionsautomatically.
WhentheAddressListBehaviorattributeisrandom(thedefault),ApplicationServerselectsitsprimarybrokerrandomlyfromtheJMShostlist.
Whenfailoveroccurs,MQtransparentlytransferstheloadtoanotherbrokerandmaintainsJMSsemantics.
TospecifywhethertheApplicationServertriestoreconnecttotheprimarybrokerwhentheconnectionislost,selecttheReconnectcheckbox.
Ifenabledandtheprimarybrokergoesdown,ApplicationServertriestoreconnecttoanotherbrokerintheJMSHostslist.
WhenReconnectisenabled,alsospecifythefollowingattributes:AddressListBehavior:whetherconnectionattemptsareintheorderofaddressesintheJMSHostsList(priority)orrandomorder(random).
IfsettoPriority,JavaMessageServicetriestoconnecttothefirstMQbrokerspecifiedintheJMSHostslistandusesanotheroneonlyifthefirstbrokerisnotavailable.
IfsettoRandom,JavaMessageServiceselectstheMQbrokerrandomlyfromtheJMSHostslist.
Iftherearemanyclientsattemptingaconnectionusingthesameconnectionfactory,usethissettingtopreventthemfromallattemptingtoconnecttothesameaddress.
AddressListIterations:numberoftimestheJavaMessageServiceiteratesthroughtheJMSHostsListinanefforttoestablish(orre-establish)aconnection).
Avalueof-1indicatesthatthenumberofattemptsisunlimited.
ReconnectAttempts:thenumberofattemptstoconnect(orreconnect)foreachaddressintheJMShostslistbeforetheclientruntimetriesthenextaddressinthelist.
Avalueof-1indicatesthatthenumberofreconnectattemptsisunlimited(theclientruntimeattemptstoconnecttothefirstaddressuntilitsucceeds).
ReconnectInterval:numberofsecondsbetweenreconnectattempts.
ThisappliesforattemptsoneachaddressintheJMShostslistandforsuccessiveaddressesinthelist.
Ifitistooshort,thistimeintervaldoesnotgiveabrokertimetorecover.
Ifitistoolong,thereconnectmightrepresentanunacceptabledelay.
YoucanoverridethesesettingsusingJMSconnectionfactorysettings.
Fordetails,see"AdminConsoleTasksforJMSConnectionFactories"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
ConnectionPoolingandFailoverChapter9JavaMessageServiceLoadBalancingandFailover191Load-BalancedMessageInflowApplicationServerdeliversmessagesrandomlytoMDBshavingsameClientID.
TheClientIDisrequiredfordurablesubscribers.
Fornon-durablesubscribersinwhichtheClientIDisnotconfigured,allinstancesofaspecificMDBthatsubscribetosametopicareconsideredequal.
WhenanMDBisdeployedtomultipleinstancesoftheApplicationServer,onlyoneoftheMDBsreceivesthemessage.
IfmultipledistinctMDBssubscribetosametopic,oneinstanceofeachMDBreceivesacopyofthemessage.
Tosupportmultipleconsumersusingthesamequeue,setthemaxNumActiveConsumerspropertyofthephysicaldestinationtoalargevalue.
Ifthispropertyisset,MQallowsuptothatnumberofMDBstoconsumemessagesfromsamequeue.
ThemessageisdeliveredrandomlytotheMDBs.
IfmaxNumActiveConsumersissetto-1,thereisnolimittothenumberofconsumers.
UsingMQClusterswithApplicationServerMQEnterpriseEditionsupportsmultipleinterconnectedbrokerinstancesknownasabrokercluster.
Withbrokerclusters,clientconnectionsaredistributedacrossallthebrokersinthecluster.
Clusteringprovideshorizontalscalabilityandimprovesavailability.
ThissectiondescribeshowtoconfigureApplicationServertousehighlyavailableSunJavaSystemMessageQueueclusters.
ItexplainshowtostartandconfigureMessageQueueclusters.
FormoreinformationaboutthetopologyofApplicationServerandMQdeployment,see"PlanningMessageQueueBrokerDeployment"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2DeploymentPlanningGuide.
ToEnableMQclusterswithApplicationServerClustersCreateanApplicationServercluster,ifonedoesnotalreadyexist.
Forinformationoncreatingclusters,see"ToCreateaCluster"onpage136.
CreateanMQbrokercluster.
First,deletethedefaultJMShostthatreferstothebrokerstartedbytheDomainAdministrationServer,andthencreatethreeexternalbrokers(JMShosts)thatwillbeintheMQbrokercluster.
CreateaJMShostswitheithertheAdminConsoleortheasadmincommand-lineutility.
Touseasadmin,thecommandsareforexample:asadmindelete-jms-host--targetcluster1default_JMS_hostasadmincreate-jms-host--targetcluster112UsingMQClusterswithApplicationServerSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007192--mqhostmyhost1--mqport6769--mquseradmin--mqpasswordadminbroker1asadmincreate-jms-host--targetcluster1--mqhostmyhost2--mqport6770--mquseradmin--mqpasswordadminbroker2asadmincreate-jms-host--targetcluster1--mqhostmyhost3--mqport6771--mquseradmin--mqpasswordadminbroker3TocreatethehostswithAdminConsole:a.
NavigatetotheJMSHostsnode(Configurations>config-name>JavaMessageService>JMSHosts)b.
Deletethedefaultbroker(default_JMS_host).
Selectthecheckboxnexttoit,andthenclickDelete.
c.
ClickNewtocreateeachJMShostandenteritspropertyvalues.
Fillinthevaluesforhostname,DNSnameorIPaddress,portnumber,administrativeusernameandpassword.
StartthemasterMQbrokerandtheotherMQbrokers.
InadditiontothethreeexternalbrokersstartedonJMShostmachines,startonemasterbrokeronanymachine.
Thismasterbrokerneednotbepartofabrokercluster.
Forexample:/usr/bin/imqbrokerd-tty-namebrokerm-port6772-clustermyhost1:6769,myhost2:6770,myhost2:6772,myhost3:6771-D"imq.
cluster.
masterbroker=myhost2:6772"StarttheApplicationServerinstancesinthecluster.
CreateJMSresourcesonthecluster:a.
CreateJMSphysicaldestinations.
Forexample,usingasadmin:asadmincreate-jmsdest--desttypequeue--targetcluster1MyQueueasadmincreate-jmsdest--desttypequeue--targetcluster1MyQueue1TouseAdminConsole:i.
NavigatetotheJMSHostspage(Configurations>config-name>JavaMessageService>PhysicalDestinations).
ii.
ClickNewtocreateeachJMSphysicaldestination.
iii.
Foreachdestination,enteritsnameandtype(queue).
345UsingMQClusterswithApplicationServerChapter9JavaMessageServiceLoadBalancingandFailover193b.
CreateJMSconnectionfactories.
Forexample,usingasadmin:asadmincreate-jms-resource--targetcluster1--restypejavax.
jms.
QueueConnectionFactoryjms/MyQcfasadmincreate-jms-resource--targetcluster1--restypejavax.
jms.
QueueConnectionFactoryjms/MyQcf1TouseAdminConsole:i.
NavigatetotheJMSConnectionFactoriespage(Resources>JMSResources>ConnectionFactories).
ii.
Tocreateeachconnectionfactory,clickNew.
TheCreateJMSConnectionFactorypageopens.
iii.
Foreachconnectionfactory,enterJNDIName(forexamplejms/MyQcf)andType,javax.
jms.
QueueConnectionFactoryiv.
SelecttheclusterfromthelistofavailabletargetsatthebottomofthepageandclickAdd.
v.
ClickOKtocreatetheconnectionfactory.
c.
CreateJMSdestinationresources.
Forexample,usingasadmin:asadmincreate-jms-resource--targetcluster1--restypejavax.
jms.
Queue--propertyimqDestinationName=MyQueuejms/MyQueueasadmincreate-jms-resource--targetcluster1--restypejavax.
jms.
Queue--propertyimqDestinationName=MyQueue1jms/MyQueue1TouseAdminConsole:i.
NavigatetotheJMSDestinationResourcespage(Resources>JMSResources>ConnectionFactories).
ii.
Tocreateeachdestinationresource,clickNew.
TheCreateJMSDestinationResourcepageopens.
iii.
Foreachdestinationresource,enterJNDIName(forexamplejms/MyQueue)andTypejavax.
jms.
Queue.
iv.
SelecttheclusterfromthelistofavailabletargetsatthebottomofthepageandclickAdd.
UsingMQClusterswithApplicationServerSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007194v.
ClickOKtocreatethedestinationresource.
Deploytheapplicationswiththe–retrieveoptionforapplicationclients.
Forexample:asadmindeploy--targetcluster1--retrieve/opt/work/MQapp/mdb-simple3.
earAccesstheapplicationandtestittoensureitisbehavingasexpected.
IfyouwanttoreturntheApplicationServertoitsdefaultJMSconfiguration,deletetheJMShostsyoucreatedandrecreatethedefault.
Forexample:asadmindelete-jms-host--targetcluster1broker1asadmindelete-jms-host--targetcluster1broker2asadmindelete-jms-host--targetcluster1broker3asadmincreate-jms-host--targetcluster1--mqhostmyhost1--mqport7676--mquseradmin--mqpasswordadmindefault_JMS_hostYoucanalsoperformtheequivalentoperationwithAdminConsole.
Ifyouencounterproblems,considerthefollowing:ViewtheApplicationServerlogfile.
IfyouseeinthelogfilethatanMQbrokerdoesnotrespondtoamessage,stopthebrokerandthenrestartit.
AlwaysbesuretostartMQbrokersfirst,thenApplicationServerinstances.
WhenallMQbrokersaredown,ittakes30minutesforApplicationServertogodownorup,withthedefaultvaluesinJavaMessageService.
TuneJavaMessageServicevaluestogetacceptablevaluesforthistimeout.
Forexample:asadminset--useradmin--passwordadministratorcluster1.
jms-service.
reconnect-interval-in-seconds=5678TroubleshootingUsingMQClusterswithApplicationServerChapter9JavaMessageServiceLoadBalancingandFailover195196RMI-IIOPLoadBalancingandFailoverThischapterdescribesusingSunJavaSystemApplicationServer'shigh-availabilityfeaturesforremoteEJBreferencesandJNDIobjectsoverRMI-IIOP.
"Overview"onpage197"SettingupRMI-IIOPLoadBalancingandFailover"onpage199OverviewWithRMI-IIOPloadbalancing,IIOPclientrequestsaredistributedtodifferentserverinstancesornameservers.
Thegoalistospreadtheloadevenlyacrossthecluster,thusprovidingscalability.
IIOPloadbalancingcombinedwithEJBclusteringandavailabilityalsoprovidesEJBfailover.
WhenaclientperformsaJNDIlookupforanobject,theNamingServicecreatesaInitialContext(IC)objectassociatedwithaparticularserverinstance.
Fromthenon,alllookuprequestsmadeusingthatICobjectaresenttothesameserverinstance.
AllEJBHomeobjectslookedupwiththatInitialContextarehostedonthesametargetserver.
Anybeanreferencesobtainedhencefortharealsocreatedonthesametargethost.
Thiseffectivelyprovidesloadbalancing,sinceallclientsrandomizethelistoflivetargetserverswhencreatingInitialContextobjects.
Ifthetargetserverinstancegoesdown,thelookuporEJBmethodinvocationwillfailovertoanotherserverinstance.
IIOPLoadbalancingandfailoverhappenstransparently.
Nospecialstepsareneededduringapplicationdeployment.
However,addingordeletingnewinstancestotheclusterwillnotupdateanexistingclient\qsviewofthecluster.
Todoso,youmustmanuallyupdatetheendpointslistontheclientside.
10CHAPTER10197RequirementsSunJavaSystemApplicationServerEnterpriseEditionprovideshighavailabilityofremoteEJBreferencesandNameServiceobjectsoverRMI-IIOP,providedallthefollowingapply:Yourdeploymenthasaclusterofatleasttwoapplicationserverinstances.
J2EEapplicationsaredeployedtoallapplicationserverinstancesandclustersthatparticipateinloadbalancing.
RMI-IIOPclientapplicationsareenabledforloadbalancing.
ApplicationServersupportsloadbalancingforthefollowingRMI-IIOPclientsaccessingEJBcomponentsdeployedonanApplicationServer.
JavaapplicationsexecutingintheApplicationClientContainer(ACC).
See"TosetupRMI-IIOPloadbalancingfortheApplicationClientContainer"onpage199.
JavaapplicationsnotrunningintheACC.
See"TosetupRMI-IIOPloadbalancingandfailoverforStand-AloneClient"onpage201Note–ApplicationServerdoesnotsupportRMI-IIOPloadbalancingandfailoveroversecuresocketslayer(SSL).
AlgorithmApplicationServerusesarandomizationandround-robinalgorithmforRMI-IIOPloadbalancingandfailover.
WhenanRMI-IIOPclientfirstcreatesanewInitialContextobject,thelistofavailableApplicationServerIIOPendpointsisrandomizedforthatclient.
ForthatInitialContextobject,theloadbalancerdirectslookuprequestsandotherInitialContextoperationstothefirstendpointontherandomizedlist.
Ifthefirstendpointisnotavailablethenthesecondendpointinthelistisused,andsoon.
EachtimetheclientsubsequentlycreatesanewInitialContextobject,theendpointlistisrotatedsothatadifferentIIOPendpointisusedforInitialContextoperations.
WhenyouobtainorcreatebeansfromreferencesobtainedbyanInitialContextobject,thosebeansarecreatedontheApplicationServerinstanceservingtheIIOPendpointassignedtotheInitialContextobject.
ThereferencestothosebeanscontaintheIIOPendpointaddressesofallApplicationServerinstancesinthecluster.
TheprimaryendpointisthebeanendpointcorrespondingtotheInitialContextendpointusedtolookuporcreatethebean.
TheotherIIOPendpointsintheclusteraredesignatedasalternateendpoints.
Ifthebean\qsprimaryendpointbecomesunavailable,furtherrequestsonthatbeanfailovertooneofthealternateendpoints.
OverviewSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007198YoucanconfigureRMI-IIOPloadbalancingandfailovertoworkwithapplicationsrunningintheACCandwithstandaloneJavaclients.
SampleApplicationThefollowingdirectorycontainsasampleapplicationthatdemonstratesusingRMI-IIOPfailoverwithandwithoutACC:install_dir/samples/ee-samples/sfsbfailoverSeetheindex.
htmlfileaccompanyingthissampleforinstructionsonrunningtheapplicationwithandwithoutACC.
Theee-samplesdirectoryalsocontainsinformationforsettingupyourenvironmenttorunthesamples.
SettingupRMI-IIOPLoadBalancingandFailoverYoucansetupRMI-IIOPloadbalancingandfailoverforapplicationsrunningintheApplicationClientContainer(ACC)andforstandaloneclientapplications.
TosetupRMI-IIOPloadbalancingfortheApplicationClientContainerThisproceduregivesanoverviewofthestepsnecessarytouseRMI-IIOPloadbalancingandfailoverwiththeapplicationclientcontainer(ACC).
ForadditionalinformationontheACC,see"DevelopingClientsUsingtheACC"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2Developer'sGuide.
Gototheinstall_dir/bindirectory.
Runpackage-appclient.
Thisutilityproducesanappclient.
jarfile.
Formoreinformationonpackage-appclient,seepackage-appclient(1M).
Copytheappclient.
jarfiletothemachinewhereyouwantyourclientandextractit.
Edittheasenv.
conforasenv.
batpathvariablestorefertothecorrectdirectoryvaluesonthatmachine.
Thefileisatappclient-install-dir/config/.
Foralistofthepathvariablestoupdate,seepackage-appclient(1M).
1234SettingupRMI-IIOPLoadBalancingandFailoverChapter10RMI-IIOPLoadBalancingandFailover199Ifrequired,maketheappclientscriptexecutable.
Forexample,onUNIXusechmod700.
FindtheIIOPlistenerportnumbersfortheinstancesinthecluster.
SpecifytheIIOPlistenersasendpointstodeterminewhichIIOPlistenerreceivestherequests.
TodisplaytheIIOPlistenersintheAdminConsole:a.
IntheAdminConsole'streecomponent,expandtheClustersnode.
b.
Expandthecluster.
c.
Selectaninstanceinthecluster.
d.
Intherightpane,clickthePropertiestab.
NotetheIIOPlistenerportforthespecificinstance.
e.
Repeattheprocessforeveryinstance.
Editsun-acc.
xmlfortheendpointvalues.
UsingtheIIOPListenersfromthepreviousstep,createendpointvaluesintheform:machine1:instance1–iiop-port,machine2:instance2–iiop-portForexample:Deployyourclientapplicationwiththe--retrieveoptiontogettheclientjarfile.
Keeptheclientjarfileontheclientmachine.
Forexample:asadmindeploy--useradmin--passwordfilepw.
txt--retrieve/my_dirmyappRuntheapplicationclientasfollows:appclient-clientclientjar-nameappnameTotestfailover,stoponeinstanceintheclusterandseethattheapplicationfunctionsnormally.
Youcanalsohavebreakpoints(orsleeps)inyourclientapplication.
Totestloadbalancing,usemultipleclientsandseehowtheloadgetsdistributedamongallendpoints.
56789NextStepsSettingupRMI-IIOPLoadBalancingandFailoverSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007200TosetupRMI-IIOPloadbalancingandfailoverforStand-AloneClientDeploytheapplicationwiththe--retrieveoptiontogettheclientjarfile.
Keeptheclientjarfileontheclientmachine.
Forexample:asadmindeploy--useradmin--passwordfilepw.
txt--retrieve/my_dirmyappRuntheclientjarandtherequiredjarfiles,specifyingtheendpointsandInitialContextas-Dvalues.
Forexample:java-Dcom.
sun.
appserv.
iiop.
endpoints=host1.
sun.
com:33700,host2.
sun.
com:33700,host3.
sun.
com:33700samples.
rmiiiopclient.
client.
Standalone_ClientTotestfailover,stoponeinstanceintheclusterandconfirmthattheapplicationfunctionsnormally.
Youcanalsohavebreakpoints(orsleeps)inyourclientapplication.
Totestloadbalancing,usemultipleclientsandseehowtheloadgetsdistributedamongallendpoints.
12NextStepsSettingupRMI-IIOPLoadBalancingandFailoverChapter10RMI-IIOPLoadBalancingandFailover201202IndexAactive-healthcheck-enabled,120AddressList,anddefaultJMShost,190AdministrationConsoleusingtoconfiguretheJMSService,188usingtocreateJMShosts,190algorithmHTTPloadbalancing,104RMI-IIOPfailover,198alternateendpoints,RMI-IIOPfailover,198Apache,modificationsmadebyloadbalancerplug-in,110applicationsenablingforloadbalancing,118quiescing,122asadmincreate-jms-hostcommand,191asadmingetcommand,189asadminsetcommand,188assignedrequests,104authenticationrealms,nodeagent,167availabilityEJBcontainerlevel,184-185enablinganddisabling,176forstatefulsessionbeans,181forwebmodules,173levelsof,176CcacheDatabaseMetaDataproperty,77centralrepository,nodeagentsynchronizationwith,158checkpoint-at-end-of-methodelement,185checkpointing,181selectingmethodsfor,181,185checkpointingofstatefulsessionbeanstate,175clusteredserverinstances,configurations,146clusters,135quiescing,121shared,25standalone,25configurations.
,SeenamedconfigurationsconnectionpoolpropertiesforHADB,76-77settingsforHADB,76ConnectionValidationRequiredsetting,76ConnectionTraceattribute,71cookie-basedsessionstickiness,104CoreFileattribute,71create-http-lb-configcommand,116create-http-lb-refcommand,117create-node-agentcommand,169DDataSourceEnabledsetting,78DatabaseVendorsetting,76DatabaseNameattribute,71databufoption,96DataBufferPoolSizeattribute,71datadevicesoption,66203DataDeviceSizeattribute,72,87DataSourceClassnamesetting,76dbpasswordoption,61dbpasswordfileoption,61default-configconfiguration,146delete-http-lb-refcommand,118delete-node-agentcommand,171deployment,settingavailabilityduring,176DevicePathattribute,72,90devicepathoption,66devicesizeoption,66disable-http-lb-applicationcommand,122disable-http-lb-servercommand,121distributablewebapplications,175distributedHTTPsessions,173DomainAdministrationServernodeagentsynchronization,158serverinstancesynchronization,159dynamicreconfiguration,ofloadbalancer,121EEagerSessionThresholdattribute,72EagerSessionTimeoutattribute,72EJBcontainer,availabilityin,182-183eliminateRedundantEndTransactionproperty,77enable-http-lb-applicationcommand,118enable-http-lb-servercommand,118endpoints,RMI-IIOPfailover,198EventBufferSizeattribute,73export-http-lb-configcommand,120FFailAllConnectionssetting,76failoveraboutHTTP,103forwebmodulesessions,173JMSconnection,191ofstatefulsessionbeanstate,181RMI-IIOPrequirements,198fastoption,85filesystemsupport,40-41GGlobalTransactionSupportsetting,76GuaranteeIsolationLevelsetting,76HHADBaddingmachines,88addingnodes,88architecture,30-31clearingthedatabase,84configuration,64-78connectionpoolproperties,76-77connectionpoolsettings,76customersupport,33datacorruption,86databasename,65doublenetworks,37-38environmentvariables,62expandingnodes,87-88gettingdeviceinformation,95gettingresourceinformation,96-99gettingstatusof,92-94gettingtheJDBCURL,75-76heterogeneousdevicepaths,68-69historyfiles,101listingdatabases,84machinemaintenance,99monitoring,92-99nodes,31,93portassignments,69refragmenting,90removingadatabase,85restartinganode,81restartingthedatabase,83settingattributes,67,70startinganode,80startingthedatabase,82stoppinganode,81stoppingthedatabase,83HADBconfigurationfilesystemsupport,40-41networkconfiguration,35-38nodesupervisorprocess,42-43IndexSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007204HADBconfiguration(Continued)timesynchronization,40HADBmanagementagent,starting,44-46,51-59HADBsetup,34hadbmaddnodescommand,88hadbmclearcommand,84hadbmclearhistorycommand,101hadbmcommand,59-64hadbmcreatecommand,65hadbmdeletecommand,85hadbmdeviceinfocommand,95hadbmgetcommand,70hadbmlistcommand,84hadbmrefragmentcommand,90hadbmresourceinfocommand,96-99hadbmrestartcommand,83hadbmrestartnodecommand,81hadbmstartcommand,82hadbmstartnodecommand,80hadbmstatuscommand,92-94hadbmstopcommand,83hadbmstopnodecommand,81health-checker,118HistoryPathattribute,73historypathoption,66hostsoption,67,90HTTPHTTPSrouting,123sessionfailover,123-124HTTP_LISTENER_PORTproperty,149HTTPsessions,27distributed,173HTTP_SSL_LISTENER_PORTproperty,149HTTPSrouting,117,123sessionfailover,123-124IidempotentURLs,124IIOP_LISTENER_PORTproperty,149IIOP_SSL_MUTUALAUTH_PORTproperty,149InternalLogbufferSizeattribute,73IOP_SSL_LISTENER_PORTproperty,149JJdbcUrlattribute,73JMSconfiguring,188connectionfailover,191connectionpooling,191creatinghosts,190JMShostlist,andconnections,190JMXlisteners,nodeagent,168JMX_SYSTEM_CONNECTOR_PORTproperty,149JNDINamesetting,78Lloadbalancingassignedrequests,104changingconfiguration,121creatingaloadbalancerconfiguration,116creatingareference,117dynamicreconfiguration,121enablingapplications,118enablingserverinstances,118exportingconfigurationfile,120health-checker,118HTTP,about,103HTTPalgorithm,104idempotentURLs,124logmessages,131multiplewebserverinstances,115quiescingapplications,122quiescingserverinstancesorclusters,121RMI-IIOPrequirements,198sessionfailover,123-124setup,106stickyroundrobin,104usingasareverse-proxyplug-in,106loadbalancer.
xmlfile,120locksoption,96logbufoption,97LogbufferSizeattribute,73loggingloadbalancer,131viewingthenodeagentlog,162Index205Mmagnus.
conffile,webserver,108maxStatementproperty,77MaxTablesattribute,73MicrosoftInternetInformationServices(IIS),modificationsforloadbalancing,114NNamesetting,76namedconfigurationsabout,145default-config,146defaultnames,147portnumbersand,147shared,146networkconfigurationrequirements,35-38nilogbufoption,97no-refragmentoption,89no-repairoption,81nodeagentsabout,153additional,154-155authrealm,167creating,169deleting,166,171deployment,155installation,157JMXlistener,168logs,162placeholders,155,165starting,170stoping,171synchronizingwithDomainAdministrationServer,158nodesupervisorprocessandhighavailability,42-43nodesoption,93number-healthcheck-retries,120NumberOfDatadevicesattribute,73NumberOfLocksattribute,73NumberOfSessionsattribute,73Oobj.
conffile,webserver,108Ppass-throughplug-in,106passwordproperty,76persistence,session,27persistencestore,forstatefulsessionbeanstate,181PoolNamesetting,78portnumbers,andconfigurations,147Portbaseattribute,73portbaseoption,67primaryendpoints,RMI-IIOPfailover,198Qquiescingapplications,122serverinstancesorclusters,121Rrealms,nodeagentauthentication,167RelalgdeviceSizeattribute,73reverse-proxyplug-in,106roundrobinloadbalancing,sticky,104routecookie,117Ssavetooption,101server,clusters,135serverinstancesenablingforloadbalancing,118quiescing,121serverListproperty,77sessionfailover,HTTPandHTTPS,123-124sessionpersistenceandsinglesign-on,180-181forstatefulsessionbeans,181,184IndexSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideAugust2007206sessionpersistence(Continued)forwebmodules,173sessionstoreforHTTPsessions,178forstatefulsessionbeans,183,184sessionsHTTP,27persistence,27SessionTimeoutattribute,74setoption,67,68singlesign-on,andsessionpersistence,180-181sparesoption,67,85,89SQLTraceModeattribute,74start-node-agentcommand,170startleveloption,80,82StartRepairDelayattribute,74statefulsessionbeans,181sessionpersistence,181sessionpersistenceof,184StatIntervalattribute,74SteadyPoolSizesetting,76stickyroundrobinloadbalancing,104stop-node-agentcommand,171sun-ejb-jar.
xmlfile,185SunJavaSystemMessageQueue,connectorfor,188sun-passthrough.
propertiesfile,andloglevel,133Sunwebserver,modificationsbyloadbalancer,108SyslogFacilityattribute,74SysLoggingattribute,74SysLogLevelattribute,75SyslogPrefixattribute,75TTableNamesetting,76TakeoverTimeattribute,75targets,loadbalancerconfiguration,117timesynchronization,40TransactionIsolationsetting,76transactionsandsessionpersistence,181,185Uunassignedrequests,104unhealthyserverinstances,118usernameproperty,76VValidationMethodsetting,76Wwebapplications,distributable,175webcontainer,availabilityin,177webserversmodificationforloadbalancing,107-116multipleinstancesandloadbalancing,115Index207208
对于DMIT商家已经关注有一些时候,看到不少的隔壁朋友们都有分享到,但是这篇还是我第一次分享这个服务商。根据看介绍,DMIT是一家成立于2017年的美国商家,据说是由几位留美学生创立的,数据中心位于香港、伯力G-Core和洛杉矶,主打香港CN2直连云服务器、美国CN2直连云服务器产品。最近看到DMIT商家有对洛杉矶CN2 GIA VPS端口进行了升级,不过价格没有变化,依然是季付28.88美元起。...
有一段时间没有分享Gcore(gcorelabs)的信息了,这是一家成立于2011年的国外主机商,总部位于卢森堡,主要提供VPS主机和独立服务器租用等,数据中心包括俄罗斯、美国、日本、韩国、新加坡、荷兰、中国(香港)等多个国家和地区的十几个机房,商家针对不同系列的产品分为不同管理系统,比如VPS(Hosting)、Cloud等都是独立的用户中心体系,部落分享的主要是商家的Hosting(Virtu...
昨天晚上有收到VULTR服务商的邮件,如果我们有清楚的朋友应该知道VULTR对于新注册用户已经这两年的促销活动是有赠送100美元最高余额,不过这个余额有效期是30天,如果我们到期未使用完的话也会失效的。但是对于我们一般用户来说,这个活动还是不错的,只需要注册新账户充值10美金激活账户就可以。而且我们自己充值的余额还是可以继续使用且无有效期的。如果我们有需要申请的话可以参考"2021年最新可用Vul...
rebootsystemnow什么意思为你推荐
域名注册网站免费域名申请免费com域名注册哪个网站注册COM域名不要钱?域名服务域名系统主要是什么?网站服务器租用哪些网站适合独立服务器租用?价格方面怎么样?重庆虚拟空间现在重庆那家主机空间最好?免费网站空间免费个人网站 空间深圳网站空间求免费稳定空间网站?万网虚拟主机万网云虚拟主机怎么用,如何配置1g虚拟主机打算买个1G的虚拟主机,用来做什么好?郑州虚拟主机什么是双线虚拟主机?
广西虚拟主机 免费注册网站域名 购买域名和空间 lamp安装 stablehost inmotionhosting java主机 59.99美元 mediafire下载工具 名片模板psd 500m空间 权嘉云 web服务器架设 搜索引擎提交入口 独享主机 主机管理系统 新加坡空间 1美元 netvigator 密钥索引 更多