SunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideSunMicrosystems,Inc.
4150NetworkCircleSantaClara,CA95054U.
S.
A.
PartNo:819–2553–11December2008Copyright2008SunMicrosystems,Inc.
4150NetworkCircle,SantaClara,CA95054U.
S.
A.
Allrightsreserved.
Thisproductordocumentisprotectedbycopyrightanddistributedunderlicensesrestrictingitsuse,copying,distribution,anddecompilation.
NopartofthisproductordocumentmaybereproducedinanyformbyanymeanswithoutpriorwrittenauthorizationofSunanditslicensors,ifany.
Third-partysoftware,includingfonttechnology,iscopyrightedandlicensedfromSunsuppliers.
PartsoftheproductmaybederivedfromBerkeleyBSDsystems,licensedfromtheUniversityofCalifornia.
UNIXisaregisteredtrademarkintheU.
S.
andothercountries,exclusivelylicensedthroughX/OpenCompany,Ltd.
Sun,SunMicrosystems,theSunlogo,docs.
sun.
com,AnswerBook,AnswerBook2,andSolarisaretrademarksorregisteredtrademarksofSunMicrosystems,Inc.
intheU.
S.
andothercountries.
AllSPARCtrademarksareusedunderlicenseandaretrademarksorregisteredtrademarksofSPARCInternational,Inc.
intheU.
S.
andothercountries.
ProductsbearingSPARCtrademarksarebaseduponanarchitecturedevelopedbySunMicrosystems,Inc.
TheOPENLOOKandSunTMGraphicalUserInterfacewasdevelopedbySunMicrosystems,Inc.
foritsusersandlicensees.
SunacknowledgesthepioneeringeffortsofXeroxinresearchinganddevelopingtheconceptofvisualorgraphicaluserinterfacesforthecomputerindustry.
Sunholdsanon-exclusivelicensefromXeroxtotheXeroxGraphicalUserInterface,whichlicensealsocoversSun'slicenseeswhoimplementOPENLOOKGUIsandotherwisecomplywithSun'swrittenlicenseagreements.
U.
S.
GovernmentRights–Commercialsoftware.
GovernmentusersaresubjecttotheSunMicrosystems,Inc.
standardlicenseagreementandapplicableprovisionsoftheFARanditssupplements.
DOCUMENTATIONISPROVIDED"ASIS"ANDALLEXPRESSORIMPLIEDCONDITIONS,REPRESENTATIONSANDWARRANTIES,INCLUDINGANYIMPLIEDWARRANTYOFMERCHANTABILITY,FITNESSFORAPARTICULARPURPOSEORNON-INFRINGEMENT,AREDISCLAIMED,EXCEPTTOTHEEXTENTTHATSUCHDISCLAIMERSAREHELDTOBELEGALLYINVALID.
Copyright2008SunMicrosystems,Inc.
4150NetworkCircle,SantaClara,CA95054U.
S.
A.
Tousdroitsréservés.
Ceproduitoudocumentestprotégéparuncopyrightetdistribuéavecdeslicencesquienrestreignentl'utilisation,lacopie,ladistribution,etladécompilation.
Aucunepartiedeceproduitoudocumentnepeutêtrereproduitesousaucuneforme,parquelquemoyenquecesoit,sansl'autorisationpréalableetécritedeSunetdesesbailleursdelicence,s'ilyena.
Lelogicieldétenupardestiers,etquicomprendlatechnologierelativeauxpolicesdecaractères,estprotégéparuncopyrightetlicenciépardesfournisseursdeSun.
DespartiesdeceproduitpourrontêtredérivéesdusystèmeBerkeleyBSDlicenciésparl'UniversitédeCalifornie.
UNIXestunemarquedéposéeauxEtats-Unisetdansd'autrespaysetlicenciéeexclusivementparX/OpenCompany,Ltd.
Sun,SunMicrosystems,lelogoSun,docs.
sun.
com,AnswerBook,AnswerBook2,etSolarissontdesmarquesdefabriqueoudesmarquesdéposées,deSunMicrosystems,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'utilisationgraphiqueOPENLOOKetquienoutreseconformentauxlicencesécritesdeSun.
CETTEPUBLICATIONESTFOURNIE"ENL'ETAT"ETAUCUNEGARANTIE,EXPRESSEOUIMPLICITE,N'ESTACCORDEE,YCOMPRISDESGARANTIESCONCERNANTLAVALEURMARCHANDE,L'APTITUDEDELAPUBLICATIONAREPONDREAUNEUTILISATIONPARTICULIERE,OULEFAITQU'ELLENESOITPASCONTREFAISANTEDEPRODUITDETIERS.
CEDENIDEGARANTIENES'APPLIQUERAITPAS,DANSLAMESUREOUILSERAITTENUJURIDIQUEMENTNULETNONAVENU.
081203@21288Contents1QuickStart5VariableNamesandDefaultPaths5AboutApplicationServerAdministration6StartingtheServer7StartingtheDomainAdministrationServer7LoggingintotheAdminConsole9ExaminingtheLogFile10CreatingaCluster12ToStarttheNodeAgent12ToCreateaCluster12DeployinganApplication15ToDeploytheSampleApplication15ToStarttheCluster16ToVerifytheApplicationDeployment16SettingupLoadBalancing17InstallingWebServerSoftware18InstallingtheLoadBalancerPlug-in19CreatingaLoadBalancerConfiguration19StartingLoadBalancing20VerifyingLoadBalancing20CleaningUp22ToUninstallCompletely22ToRemovetheSampleClusterOnly23WheretoGoNext232QuickStartforSettingUpHighAvailabilityFailover25AboutHighAvailabilityClustersandHADB26HADBPreinstallationSteps263ToConfigureYourSystemforHADB27InstallingHADB28ToInstallHADB28StartingHADB29ToStartHADBinaJavaEnterpriseSystemInstallationonSolarisorLinux29ToStartHADBinaJavaEnterpriseSystemInstallationonWindows29ToStartHADBinaStand-AloneInstallationonSolarisorLinux30ToStartHADBinaStand-AloneInstallationonWindows30ConfiguringaClusterandApplicationforHighAvailability30ToConfigureaClusterandApplicationforHighAvailability30RestartingtheCluster31ToRestarttheCluster31VerifyingHTTPSessionFailover32ToVerifyHTTPSessionFailover32CleaningUp33ToUninstallCompletely33ToRemovetheSampleCluster35WheretoGoNext37ContentsSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember20084QuickStartWelcometotheQuickStartGuide.
Thisguideisfordevelopers,systemadministrators,andApplicationServeradministratorswhoareinterestedinlearningaboutthecapabilitiesoftheSunJavaSystemApplicationServer8.
12005Q2software.
ThisguidedescribesbasicandadvancedstepsforusingApplicationServer.
Thestepsarepresentedintheorderthatyoushouldcompletethem.
Thebasicsteps,whichusuallyrequirelessthan45minutestocomplete,areinthesesections:"StartingtheServer"onpage7"CreatingaCluster"onpage12"DeployinganApplication"onpage15Theadvancedsteps,whichusuallyrequireabout45minutestocomplete,areinthesesections:Thestepsforsettinguploadbalancing,in"SettingupLoadBalancing"onpage17Thestepsforsettinguphighavailabilityandfailover,inChapter2,"QuickStartforSettingUpHighAvailabilityFailover"ThefinalsectionsofthisguideincludeinstructionsforcleaningupandinformationonsourcesofinformationtouseaftercompletingthisQuickStartGuide.
VariableNamesandDefaultPathsThefollowingtabledescribeswhatthevariablenamesanddefaultpathsareforthedirectoriesusedinthisguide.
Variablenamesareinthefirstcolumn,anddefaultpathsareinthesecondcolumn.
1CHAPTER15VariableNameDescriptionandPathinstall-dirBydefault,theApplicationServerinstallationdirectoryislocatedhere:SolarisJavaEnterpriseSysteminstallations:/opt/SUNWappserver/appserverLinuxJavaEnterpriseSysteminstallations:/opt/sun/appserver/WindowsJavaEnterpriseSysteminstallations:SystemDrive:\Sun\ApplicationServerSolarisandLinuxstand-aloneApplicationServerinstallations,non-rootuser:user_home_directory/SUNWappserverSolarisandLinuxstand-aloneApplicationServerinstallations,rootuser:/opt/SUNWappserverWindowsstand-aloneinstallations:SystemDrive:\Sun\AppServerdomain_root_dirBydefault,thedirectorycontainingalldomainsislocatedhere:SolarisJavaEnterpriseSysteminstallations:/var/opt/SUNWappserver/domains/LinuxJavaEnterpriseSysteminstallations:/var/opt/sun/appserver/domains/Allotherinstallations:install-dir/domains/domain_dirBydefault,domaindirectoriesarelocatedhere:domain_root_dir/domain_dirAboutApplicationServerAdministrationToenableadministratorstomanageserverinstancesandclustersrunningonmultiplehosts,ApplicationServerprovidesthesetools:TheAdminConsole,abrowser-basedgraphicaluserinterface(GUI)Theasadminutility,acommand-linetoolProgrammaticJavaTMManagementExtensions(JMXTM)APIsThesetoolsconnecttoaservercalledtheDomainAdministrationServer,aspeciallydesignatedApplicationServerinstancethatintermediatesinalladministrativetasks.
TheDomainAdministrationServer(DAS)providesasinglesecureinterfaceforvalidatingandexecutingadministrativecommandsregardlessofwhichinterfaceisused.
Adomainisacollectionofconfigurationdata,deployedapplications,andmachineswithadesignatedadministrator.
Thedomaindefinitiondescribesandcancontroltheoperationofseveralapplications,stand-aloneapplicationserverinstances,andclusters,potentiallyspreadovermultiplemachines.
WhentheDASisinstalled,adefaultdomaincalleddomain1isalwaysinstalled.
Youworkwiththedefaultdomaininthisguide.
Tocompletemostofthestepspresentedinthisguide,youwillusetheAdminConsole.
AboutApplicationServerAdministrationSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember20086StartingtheServerThistopic,thefirstofthreebasictopics,providesthefollowingsections"StartingtheDomainAdministrationServer"onpage7"LoggingintotheAdminConsole"onpage9"ExaminingtheLogFile"onpage10StartingtheDomainAdministrationServerTostarttheDomainAdministrationServer,startthedefaultdomain,domain1,usingthefollowingprocedures.
Note–BecausethisguideinstructsyoutosetanenvironmentvariableAS_ADMIN_USERforadministrativeusername,itdoesnotinstructyoutosupplyausernameargumentwhentheasadmincommandisused.
Withouttheenvironmentvariable,yousupplythisargumentwhenyoutypethecommand.
Thegeneralsyntaxis:asadmincommand_verb--userusernamecommand_argumentsForexample,ifyourusernameisadmin,thesyntaxforasadminstart-domainis:asadminstart-domain--useradmindomain1ToStarttheDomainonSolarisandLinuxAddtheinstall-dir/bin/directorytothePATHenvironmentvariable.
SettheAS_ADMIN_USERenvironmentvariablesothatyoudonotneedtotypeitforeverycommand.
SetthevalueofAS_ADMIN_USERtotheadminuseryouspecifiedwhenyouinstalledtheApplicationServer.
Forexample,setenvAS_ADMIN_USERadminStarttheserverbyenteringthiscommandfromtheinstall-dir:asadminstart-domaindomain1Whenyouarepromptedfortheadminpasswordandthemasterpassword,enterthepasswordsthatyouprovidedduringinstallation.
AmessageappearstellingyouthattheDomainAdministrationServerisstarting:StartingDomaindomain1,pleasewait.
Logredirectedtodomain_dir/domain1/logs/server.
log.
.
.
1234StartingtheServerChapter1QuickStart7Whenthestartupprocesshascompleted,anadditionalmessageappears:Domaindomain1startedToStarttheDomainonWindowsFromtheExplorerwindowordesktop,rightclickMyComputer.
ChoosePropertiestodisplaytheSystemPropertiesdialog.
ClicktheAdvancedtab.
ClickEnvironmentVariables.
IntheUservariablessection:IfaPATHvariableexists,verifythatinstall-dir\binexistsinthepath:install-dir\bin;other_entries.
IfaPATHvariableisnotpresent,clickNew.
InVariableName,typePATH.
InVariableValue,typethepathtotheserver'sbindirectory:install-dir\bin.
ClickOKtocommitthechange.
AddanewenvironmentvariableAS_ADMIN_USERandsetittotheAdministrativeUserNamethatyouassignedduringinstallation.
ClickOKtocommitthechangeandclosetheremainingopenwindows.
StarttheApplicationServerForJavaEnterpriseSysteminstallations,fromtheStartmenu,chooseProgramsSunMicrosystemsApplicationServerStartAdminServer.
Forstand-aloneinstallations,fromtheStartmenu,chooseProgramsSunMicrosystemsApplicationServerEEStartAdminServer.
Whenacommandpromptwindowopenstopromptyoufortheadminpasswordandthemasterpassword,enterthepasswordsthatyouprovidedduringinstallation.
Awindowappearswithamessagetellingthatyoutheserverisstarting:StartingDomaindomain1,pleasewait.
Logredirectedtodomain_dir\domain1\logs\server.
log.
.
.
Whenthestartupprocesshascompleted,youseeanadditionalmessage:Domaindomain1started.
Pressanykeytocontinue.
.
.
5123456789StartingtheServerSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember20088Pressakeytoclosethemessagewindow.
LoggingintotheAdminConsoleTheAdminConsoleisabrowserinterfacethatsimplifiesavarietyofadministrationandconfigurationtasks.
Itiscommonlyusedto:DeployandundeployapplicationsEnable,disable,andmanageapplicationsConfigureresourcesandotherserversettingsConfigureclustersandnodeagentsManageserverinstancesandclustersSelectandviewlogfilesForfurtherinformationaboutusingtheAdminConsole,consulttheonlinehelportheSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
ToLogIntotheAdminConsoleTypethisURLinyourbrowser:https://localhost:4849/asadminBecausetheAdminConsoleisasecurewebapplication,youmustusehttpsinsteadofhttp.
ReplacethelocalhostvariablewiththenameofthesystemthattheDomainAdminServerisrunningon.
4849istheAdminConsole'sdefaultportnumber.
Ifyouchangedtheportnumberduringtheinstallation,usethatnumberinstead.
Note–IfapopupwindowappearswithamessagesuchasWebsiteCertifiedbyanUnknownAuthority,clickOK.
Thismessageappearsbecauseyourbrowserdoesnotrecognizetheself-signedcertificatethattheDomainAdministrationServerusestoservicetheAdminConsoleoverthesecuretransmissionprotocol.
Whentheloginwindowappears,entertheadminusernameandpassword.
ClickLogIn.
WhentheAdminConsoleappears,itlookslikethis:10123StartingtheServerChapter1QuickStart9Intheleftpane,selectwhatyouwanttomanagefromthetreeprovided.
Intherightpane,variousadministrativetasksarelistedunderthe"CommonTasks"heading.
Tip–ClicktheRegistrationtabtoregisteryoursoftwareifyouhavenotalreadydoneso.
ExaminingtheLogFileApplicationServerinstancesandtheDomainAdministrationServerproduceannotatedlogsonthefilesystem.
Bydefault,allerrors,warningsorusefulinformativemessagesarelogged.
ToViewtheDomainAdministrationServerLogFileFromtheCommonTaskslistintherightpane,clickSearchLogFilestolaunchanewbrowserwindowforLogViewer.
1StartingtheServerSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200810IntheLogViewerwindow,select"server"fromtheInstanceNamedrop–downlistandclickSearch.
TheDomainAdministrationServer'srecentlogfileentriesaredisplayed.
ScanthemessagesandlookforanyWARNINGorSEVEREmessagesindicatingthatproblemswereencounteredduringserverstart-up.
YoucancloseLogVieweratanytime.
Afteryoucreateclustersanddeployapplications,examinelogfilesifanyoftheoperationsfailed.
UseLogViewertoviewthelogfilesofanyrunningApplicationServerinstanceinthedomain.
Formoreinformationaboutthelogfile,seeChapter15,"ConfiguringLogging,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuide.
InthissectionyoustartedtheDomainAdministrationServerandconfirmedthatitisrunning.
YoualsologgedintotheAdminConsoleandusedtheLogViewer.
YoucanstoptheQuickStarttrailhereifyoudonotwishtocontinue,oryoucangoontothenextsection.
23NextStepsStartingtheServerChapter1QuickStart11CreatingaClusterThissection,thesecondofthreebasictopics,explainshowtocreateaclusterthatcontainstwoApplicationServerinstances.
Forsimplicity,theclusterrunscompletelywithinonemachine.
Thistopicincludesthefollowingtasks:"ToStarttheNodeAgent"onpage12"ToCreateaCluster"onpage12ToStarttheNodeAgentAnodeagentisalightweightprocessrunningoneachmachinethatparticipatesinanApplicationServeradministrativedomain.
Thenodeagentisresponsibleforstartingandstoppingserverinstancesonthehost.
ItalsocollaborateswiththeDomainAdministrationServertocreatenewApplicationServerinstances.
Onenodeagentisneededonamachine,foreachApplicationServeradministrativedomainthatthemachinebelongsto.
IfyouchosetheNodeAgentComponentduringinstallation,adefaultnodeagentcalledhostnamewascreated.
Inaterminalwindow,typethiscommand:asadminstart-node-agenthostnameReplacethevariablehostnamewiththenameofthehostwheretheApplicationServerisrunning.
Whenyouareprompted,providethemasterpassword.
ThenodeagentstartsandconnectswiththeDomainAdministrationServer.
Note–IftheDomainAdministrationServerisnotrunning,thenodeagentmightfailtostart.
ToCreateaClusterAclusterisagroupofserverinstances(typicallyonmultiplehosts)thatsharethesameconfigurations,resources,andapplications.
Aclusterfacilitatesloadbalancingacrossserverinstancesandhighavailabilitythroughfailover.
Youcancreateclustersspanningmultiplemachinesandmanagethemwiththehelpofthenodeagentprocessoneachmachine.
Inthisguide,forsimplicity,oursampleclusterwillbeononehost,thesameonewheretheDomainAdministrationServerisrunning.
Youmusthavealreadystartedthenodeagentprocessoneachmachine,asdescribedinprevioussection.
Whenyouspecifyinstancesduringclustercreation,youmustassociatethe12BeforeYouBeginCreatingaClusterSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200812instancewitharunningnodeagentforthemachineonwhichyouwanttheinstancetorun.
Ifthenodeagentisnotrunning,theinstancewillnotstart.
Nodeagentandinstancenamesmustbeuniqueacrossclustersthatarecreatedinadomain.
LogintotheAdministrationConsoleathttps://localhost:4849ifyouhavenotalreadydoneso.
ReplacethelocalhostvariablewiththenameofthesystemthattheDomainAdministrationServerisrunningon.
4849istheAdminConsole'sdefaultportnumber.
Ifyouchangedtheportnumberduringtheinstallation,usethatnumberinstead.
Ontherightpane,underCommonTasks,clickCreateNewClustertodisplaytheCreateClusterinputpage.
TypeFirstClusterasthenameofthenewcluster.
Fromthedrop-downlistofavailableconfigurationtemplates,selectthedefault-configconfigurationandchooseMakeacopyoftheselectedConfiguration.
ClicktheAddbuttontwice,tocreatetwoentriestospecifytwoinstancesforthecluster.
Typei1andi2asinstancenames.
Thenodeagentnameisautomaticallypopulatedwiththenameofthelocalmachine.
Youseeascreenlikethis:123456CreatingaClusterChapter1QuickStart13ClickOK.
Thecreateprocesscantakeafewminutes.
Note–ThisexerciserequiresautomaticallyassignedportnumbersforHTTP,HTTPS,IIOPandIIOPS.
Youcanchangethemlater,ifdesired.
Whenthecreateprocessiscompleted,theClusterCreatedSuccessfullypageappears,andFirstClusterappearsinthetreeintheleftpane.
Acopyoftheconfigurationtemplatedefault-configwasmadeforthiscluster,andthenameFirstCluster-configwasassignedtoit.
Intheleftpane,expandClustersandclickFirstClustertodisplaytheGeneralInformationpageforclusters.
ClicktheInstancestabtodisplayi1andi2,theinstancesthatyoucreated.
a.
Clicki1toexaminethisinstance.
b.
FromthetabsabovetheGeneralInformationheadingoftherightpane,clickPropertiesandseethevalueforHTTP_LISTENER_PORT.
789CreatingaClusterSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200814c.
Repeatthesestepsfori2.
Note–Bydefault,theHTTPportsare38081fori1and38080fori2.
Iftheseportswerebusyonyourmachinewhenyoucreatedtheseclusters,orifyouhadalreadyassignedtheseportstootherinstancesandclusters,differentportnumberswereassigned.
Inthissectionyouhavecreatedasimpleclusteronasinglemachine.
Youcanalsocreateclustersspanningmultiplemachinesusingthesamebasicsteps(aslongasyouhavethesoftwareinstalledandanodeagentrunningoneachmachine).
YoucanstoptheQuickStarttrailhereifyoudonotwishtocontinue,oryoucangoontothenextsection.
DeployinganApplicationThissection,thethirdofthreebasictopics,presentsthefollowingsteps:"ToDeploytheSampleApplication"onpage15"ToStarttheCluster"onpage16"ToVerifytheApplicationDeployment"onpage16ToDeploytheSampleApplicationThisguideusestheclusterjspsampleapplicationtodemonstratewebpathloadbalancingcapabilities.
Thistaskshowsyouhowtodeploythatapplication.
Note–Ensurethatyouhaveenabledcookiesinyourbrowserbeforeyoudeploythisapplication.
ClicktheHomebuttontogototheCommonTaskspage,ifyouarenottherealready.
Ontherightpane,underCommonTasks,clickDeployEnterpriseApplication.
IntheFiletoUploadtextbox,clickBrowse,andnavigatetoinstall-dir/samples/ee-samples/highavailability/apps/clusterjsp/clusterjsp.
ear.
ClickNexttodisplaytheDeployEnterpriseApplicationpage.
ScrolldowntotheTargetssectionofthepage.
SelectFirstClusterfromtheAvailablelist,andclickAddtomoveittotheSelectedlist.
NextSteps123456DeployinganApplicationChapter1QuickStart15ClickOK.
TheclusterjspapplicationisnowdeployedtoFirstCluster.
ToStarttheClusterInthetreeontheleftpane,clicktheFirstClusternodeunderClusters.
Intherightpane,clicktheGeneraltabifitisnotalreadyactive.
ClicktheStartInstancesbuttontostartthecluster.
VerifythatithasstartedbycheckingthattheStatusfield,whichindicateswhatinstancesarerunning.
ToVerifytheApplicationDeploymentThisprocedureverifiesthattheapplicationwasdeployedproperlyandisaccessibleoneachinstanceinthecluster.
71234DeployinganApplicationSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200816TypethefollowingURLinyourbrowser:http://localhost:port/clusterjspReplacethelocalhostvariablewiththenameofthesystemthattheDomainAdminServerisrunningon.
ReplacetheportvariablewiththevalueofHTTP-LISTENER-PORTfori1.
Thisexampleuseshttp://localhost:38081/clusterjsp.
Addsomesessionattributedata.
ExaminetheSessionandHostinformationdisplayed.
Forexample:ExecutedFromServer:localhostServerPortNumber:38081ExecutedServerIPAddress:198.
19.
255.
255SessionCreated:DayMon0514:55:34PDT2005AddsomesessiondataandclicktheAddtoSessionbutton.
Repeatthisprocedureforinstancei2bytypingthisURLinyourbrowser:http://localhost:38080/clusterjspInthissectionyoudeployedanapplicationtoaclusterandtestedthattheapplicationisavailableonallinstancesinthecluster.
Congratulations!
YouhavecompletedthebasicstepsinthisQuickStartGuide.
YoucanstoptheQuickStarttrailhereifyoudonotwishtoproceedtotheadvancedsteps.
SettingupLoadBalancingAloadbalanceristypicallydeployedinfrontofacluster.
It:Allowsanapplicationorservicetobescaledhorizontallyacrossmultiplephysical(orlogical)hostsyetstillpresentstheuserwithasingleURLInsulatestheuserfromhostfailuresorservercrashes,whenitisusedwithsessionreplicationEnhancessecuritybyhidingtheinternalnetworkfromtheuserApplicationServerincludesloadbalancingplug-insforpopularwebserverslikeApache,MicrosoftWindowsIIS,andSunJavaSystemWebServer.
ThissectionprovidesinstructionsonhowtodownloadandsetuptheWebServersoftwaretoactasaloadbalancertotheclusterofApplicationServers.
Tocompletethissection,youmusthavesufficientmemorytorunaWebServeronyoursysteminadditiontotheDomain12345SettingupLoadBalancingChapter1QuickStart17AdministrationServerandthetwoApplicationServerinstancesyouhavecreatedsofarinthisguide.
Asystemwith512Mbytesto1024Mbytesofmemoryisrecommendedtocompletethissection.
Thistopicpresentsthefollowingsteps:"InstallingWebServerSoftware"onpage18"InstallingtheLoadBalancerPlug-in"onpage19"CreatingaLoadBalancerConfiguration"onpage19"StartingLoadBalancing"onpage20"VerifyingLoadBalancing"onpage20InstallingWebServerSoftwareIfyoualreadyhaveWebServersoftwareinstalled,andifyoucanidentifyaWebServerinstancetoserveastheloadbalancer,notethelocationofthisinstanceinthefilesystemandskipto"InstallingtheLoadBalancerPlug-in"onpage19.
ToInstalltheWebServerUsingtheJavaEnterpriseSystemInstallerIfyouareusingSunJavaEnterpriseSystemsoftware,theWebServerisselectedforinstallationautomaticallywhenyouchoosetoinstalltheLoadBalancerPlug-in.
However,youcanalsoinstallWebServersoftwareusingthesesteps:LaunchtheJavaEnterpriseSysteminstaller.
SelecttheSunJavaSystemWebServercomponentintheComponentSelectionpage.
Choose"ConfigureNow"tobepromptedforWebServerConfigurationduringinstallation.
Whenyouareprompted,defineadefaultWebServerinstance.
Tip–RemembertheportnumberyouchooseforthisdefaultWebServerinstance.
Thisguideassumesthatport38000isselectedastheHTTPportfordefaultinstance.
ToInstalltheWebServerforStand-AloneApplicationServerInstallationsIfyouareusingastand-aloneApplicationServer,orifyoudonothaveaccesstotheSunJavaEnterpriseSysteminstaller,installWebServersoftwareusingthesesteps:Gotohttp://www.
sun.
com/downloads.
ScrolldowntotheWeb&ProxyServersheadingandclickWebServers.
12341SettingupLoadBalancingSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200818DownloadWebServer6.
1ServicePack2orhigherforthelocaleandplatformofyourchoice.
Todownload,youmustloginwithusernameandpasswordregisteredwithMySunSM,SunStoreSM,SunSolveSM,ortheOnlineSupportCenter.
Ifyoudonothavealoginaccount,youcanregisteronline.
FollowtheinstructionstoinstallWebServersoftware.
Youmust:a.
Extractthesoftwarefromthecompressedarchive.
b.
Runthesetupprogram.
Ifyouneedadditionalinformation,seetheWebServerinstallationinstructionsathttp://docs.
sun.
com.
TheWebServerinstallationprocessconfigurestheAdministrationServerforWebServerandpromptsyoutodefineadefaultWebServerinstance.
Tip–Remembertheportnumberyouchooseforthisdefaultwebserverinstance.
Thisguideassumesthatport38000isselectedastheHTTPportfordefaultinstance.
InstallingtheLoadBalancerPlug-inThesectiondescribesinstallingtheloadbalancerplug-inforeitheraSunJavaEnterpriseSystemdistributionorastand-aloneApplicationServerdistribution.
ToInstalltheLoadBalancerPlug-inRuntheinstallerforthesoftwaredistributionyouareusing—SunJavaEnterpriseSystemsoftwareorthestand-aloneSunJavaSystemApplicationServersoftware.
Whenyouareaskedwhichcomponentsyouwanttoinstall,selectLoadBalancingPlug-in.
OntheSunJavaEnterpriseSysteminstaller,youmustexpandtheApplicationServeritemtoseetheLoadBalancingPlug-in.
Itisnotselectedforinstallationbydefault.
CreatingaLoadBalancerConfigurationNowreturntointeractingwiththeApplicationServer'sDomainAdminServer.
Youneedashellexecutionenvironmentforthissection.
ToCreateanHTTPLoadBalancerConfigurationCreatealoadbalancerconfigurationcalledMyLbConfigtargetedtotheclusterFirstCluster:asadmincreate-http-lb-config--targetFirstClusterMyLbConfig234121SettingupLoadBalancingChapter1QuickStart19EnabletheFirstClusterclusterandtheclusterjspapplicationdeployedinitforHTTPloadbalancing:asadminenable-http-lb-serverFirstClusterasadminenable-http-lb-application--nameclusterjspFirstClusterCreateahealthcheckerfortheloadbalancer,whichsignalswhenaninstancethatgoesdownrecovers.
asadmincreate-http-health-checker--interval10--configMyLbConfigFirstClusterTheintervalisthenumberofsecondsthehealthcheckerwaitsbetweenchecksofanunhealthyinstance.
Exporttheconfigurationtoafileloadbalancer.
xml.
asadminexport-http-lb-config--configMyLbConfigloadbalancer.
xmlCopyloadbalancer.
xmlto:web_server_install_dir/https-hostname/config/loadbalancer.
xmlStartingLoadBalancingStartloadbalancingbystartingorrestartingtheWebServer.
IftheWebServerinstanceservingasloadbalancerisnotalreadyrunning,starttheWebServersoftwarebyexecutingthestartprograminthefollowingdirectory:web_server_install_dir/https-hostnameIftheWebServerinstanceservingasloadbalancerisalreadyrunning,stoptheserverandstartitusingthestartandstopprogramsinthefollowingdirectory:web_server_install_dir/https-hostnameVerifyingLoadBalancingOncetheapplicationisdeployedandtheloadbalancerisrunning,verifythattheloadbalancingisworking.
ToVerifyLoadBalancingTodisplaythefirstpageoftheclusterjspapplication,typethisURLinyourbrowser:http://localhost:web_server_port/clusterjspReplacethelocalhostvariablewiththenameofthesystemthattheWebServerisrunningon.
23451SettingupLoadBalancingSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200820Replacetheweb_server_portvariablewiththevalueoftheportattributeoftheLSelementinweb_server_install_dir/https-hostname/config/server.
xml.
Forthisexample,port38000isused.
Apagesimilartowhatyousawin"ToVerifytheApplicationDeployment"onpage16.
appears.
ExaminetheSessionandHostinformationdisplayed.
Forexample:ExecutedFromServer:localhostServerPortNumber:38000ExecutedServerIPAddress:192.
18.
145.
133SessionCreated:DayMon0514:55:34PDT2005TheServerPortNumberis38000,theWebServer'sport.
Theloadbalancerhasforwardedtherequestonthetwoinstancesinthecluster.
Usingdifferentbrowsersoftware,orabrowseronadifferentmachine,createanewsession.
Requestsfromthesamebrowserare"sticky"andgotothesameinstance.
Thesesessionsshouldbedistributedtothetwoinstancesinthecluster.
Youcanverifythisbylookingattheserveraccesslogfileslocatedhere:SolarisJavaEnterpriseSysteminstallation:/var/opt/SUNWappserver/nodeagents/nodeagent_name/i1/logs/access/server_access_log/var/opt/SUNWappserver/nodeagents/nodeagent_name/i2/logs/access/server_access_logLinuxJavaEnterpriseSysteminstallation:/var/opt/sun/appserver/nodeagents/nodeagent_name/i1/logs/access/server_access_log/var/opt/sun/appserver/nodeagents/nodeagent_name/i2/logs/access/server_access_logWindowsJavaEnterpriseSysteminstallation:install-dir\nodeagents\nodeagent_name\i1\logs\access\server_access_loginstall-dir\nodeagents\nodeagent_name\i2\logs\access\server_access_logStand-aloneApplicationServerinstallations:install-dir/nodeagents/nodeagent_name/i1/logs/access/server_access_loginstall-dir/nodeagents/nodeagent_name/i2/logs/access/server_access_logAddanameandvaluepair(Name=NameValue=Duke)forstoringinHttpSession.
Clickthe"AddtoSessionData"button.
23456SettingupLoadBalancingChapter1QuickStart21VerifythatthesessiondatawasaddedInthissectionyoucreatedaninstancetouseasaloadbalancerandsetupaloadbalancingconfiguration.
Youalsoverifiedloadbalancing.
ToconfigureandverifyHTTPsessionfailover,continuetoChapter2,"QuickStartforSettingUpHighAvailabilityFailover.
"Otherwisecontinueonto"CleaningUp"onpage22.
CleaningUpTocleanup,youcanuninstalltheApplicationServerinstallationbycompletingthestepsin"ToUninstallCompletely"onpage22,oryoucansimplydeletethesampleclusteryouhavejustcreatedbycompletingthestepsin"ToRemovetheSampleClusterOnly"onpage23.
Caution–IfyouplantocompleteChapter2,"QuickStartforSettingUpHighAvailabilityFailover,"donotusetheseclean-upprocedures.
Instead,gotoChapter2,"QuickStartforSettingUpHighAvailabilityFailover,"nowandwhenyouaredoneusetheproceduresyou'llfindtheretocleanup.
ToUninstallCompletelyTocompletelyuninstallApplicationServerandalsouninstalltheWebServer,usethefollowingprocedure.
StoptheApplicationServerprocessesusingthesecommands:asadminstop-clusterFirstClusterasadminstop-node-agenthostnameasadminstop-domaindomain1AtthispointallprocessesrelatedtoApplicationServerarestopped.
UninstalltheApplicationServer.
InaSolarisorLinuxJavaEnterpriseSysteminstallation,runvar/sadm/prod/entsys/uninstallandfollowthestepsintheuninstallationwizard.
InaWindowsJavaEnterpriseSysteminstallation,usetheControlPanel'sAdd/RemoveProgramsitem.
ChooseSunJavaEnterpriseSystemsandclickChange/Remove.
InaSolarisorLinuxstand-aloneApplicationServerinstallation,runinstall-dir/uninstallandfollowthestepsintheuninstallationwizard.
InaWindowsstand-aloneinstallation,fromtheStartmenu,chooseProgramsSunMicrosystemsApplicationServerEEUninstall.
7NextSteps12CleaningUpSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200822IfyouinstalledWebServerforthisexercise,stopthewebserverinstanceactingasloadbalanceranduninstalltheWebServerproduct.
Youcanstoptheinstancebyexecutingthestopprograminthefollowingdirectory:web_server_install_dir/https-hostnameIfyouwanttounsinstalltheWebServerproduct,runtheuninstallprogramfromtheweb_server_install_dir.
ToRemovetheSampleClusterOnlyToremoveonlytheFirstCluster(thesamplehighlyavailablecluster)andthesampleapplicationusedduringthisexercise,butretaintheinstalledApplicationServerandWebServer,usethefollowingprocedure.
StoptheApplicationServerprocessesandcleanupconfiguration:asadminstop-clusterFirstClusterasadmindisable-http-lb-serverFirstClusterasadmindelete-http-lb-ref--configMyLbConfigFirstClusterasadmindelete-http-lb-configMyLbConfigasadmindelete-instancei1asadmindelete-instancei2asadmindelete-clusterFirstClusterasadminundeployclusterjspStopthewebserverinstanceactingasloadbalancerbyrunningthestopprograminthefollowingdirectory:web_server_install_dir/https-hostnameRenametheloadbalancer.
xmlfileinweb_server_install_dir/https-hostname/configtoloadbalancer.
xml.
savWheretoGoNextOtherresourcesforlearningaboutandusingApplicationServerareavailable.
Theyinclude:Productdetailsatinstall-dir/docs-ee/about.
html.
Seethisdocumentforthelatestinformationonwhatisnew,andpointerstotutorialsandothereducationalservices.
34123WheretoGoNextChapter1QuickStart23SunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2ReleaseNotesSeethisdocumentforlate-breakinginformationregardingthisrelease.
SunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuideSeethisdocumentforinformationonperformingadministrativefunctionsusingtheAdminConsole.
SunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2ReferenceManualSeethisdocumentforreferenceinformationonApplicationServer'scommand-lineutilities,suchasasadmin.
SunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideSeethisdocumentforinformationontheSunJavaSystemApplicationServer'shighavailabilityfeatures.
TheJ2EE1.
4Tutorial(http://java.
sun.
com/j2ee/1.
4/docs/tutorial/doc/index.
html)SeethisdocumentforatutorialthatcoverstheprocessforbuildinganddeployingJava2Platform,EnterpriseEdition(J2EETMplatform)applications.
JavaBluePrints(http://java.
sun.
com/blueprints)guidelinesfortheEnterpriseSeethisdocumentforacomprehensivesetofexamplesthatdemonstrateoperationsoftheApplicationServersoftwareandthatcanbeusedasapplicationtemplates.
WheretoGoNextSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200824QuickStartforSettingUpHighAvailabilityFailoverWiththeconfigurationusedinthepreviouschapter,ifaserverinstancegoesdown,userslosesessionstate.
Thissection,thesecondoftwoadvancedtopics,providesthestepsforinstallingthehigh-availabilitydatabase(HADB),creatingahighlyavailablecluster,andtestingHTTPsessionpersistence.
ApplicationServersupportsbothHTTPsessionpersistenceandpersistenceforStatefulSessionBeans.
TheproceduresinthischaptercoverHTTPsessionpersistence.
ThesestepsassumeyouhavealreadyperformedthestepsintheprevioussectionsofthisQuickStart.
Thestepsarepresentedintheorderthatyoushouldcompletethem.
Note–Completingthissectionmayrequireadditionalhardwareresources.
Thistopiccontainsthefollowingsections:"AboutHighAvailabilityClustersandHADB"onpage26"HADBPreinstallationSteps"onpage26"InstallingHADB"onpage28"StartingHADB"onpage29"ConfiguringaClusterandApplicationforHighAvailability"onpage30"RestartingtheCluster"onpage31"VerifyingHTTPSessionFailover"onpage32"CleaningUp"onpage33"WheretoGoNext"onpage372CHAPTER225AboutHighAvailabilityClustersandHADBAhighlyavailabilityclusterinSunJavaSystemApplicationServerEnterpriseEditionintegratesastatereplicationservicewiththeclustersandloadbalancercreatedearlier,enablingfailoverofHTTPsessions.
HttpSessionobjectsandStatefulSessionBeanstateisstoredinHADB,ahigh-availabilitydatabaseforstoringsessionstate.
Thishorizontallyscalablestatemanagementservicecanbemanagedindependentlyoftheapplicationservertier.
Itwasdesignedtosupportupto99.
999%serviceanddataavailabilitywithloadbalancing,failoverandstaterecoverycapabilities.
KeepingstatemanagementresponsibilitiesseparatedfromApplicationServerhassignificantbenefits.
ApplicationServerinstancesspendtheircyclesperformingasascalableandhighperformanceJavaTM2Platform,EnterpriseEdition(J2EETMplatform)containersdelegatingstatereplicationtoanexternalhighavailabilitystateservice.
Duetothislooselycoupledarchitecture,applicationserverinstancescanbeeasilyaddedtoordeletedfromacluster.
TheHADBstatereplicationservicecanbeindependentlyscaledforoptimumavailabilityandperformance.
Whenanapplicationserverinstancealsoperformsreplication,theperformanceofJ2EEapplicationscansufferandcanbesubjecttolongergarbagecollectionpauses.
BecauseeachHADBnoderequires512Mbytesofmemory,youneed1GbyteofmemorytoruntwoHADBnodesonthesamemachine.
Ifyouhavelessmemory,setupeachnodeonadifferentmachine.
Runningatwo-nodedatabaseononlyonehostisnotrecommendedfordeploymentsinceitisnotfaulttolerant.
HADBPreinstallationStepsThisprocedurecoversthemostcommonpreinstallationtasks.
Forinformationonotherpreinstallationtopics,includingprerequisitesforinstallingHADB,configuringnetworkredundancy,andfilesystemsupport,seeChapter2,"InstallingandSettingUpHighAvailabilityDatabase,"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuide.
TherecommendedsystemconfigurationvaluesinthissectionaresufficientforrunninguptosixHADBnodesanddonottakeintoconsiderationotherapplicationsonthesystemthatalsousesharedmemory.
AboutHighAvailabilityClustersandHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200826ToConfigureYourSystemforHADBGetrootaccess.
Definevariablesrelatedtosharedmemoryandsemaphores.
OnSolaris:a.
Addtheselinestothe/etc/systemfile(oriftheselinesareinthefileascomments,uncommentthemandmakesurethatthevaluesmatchthese):setshmsys:shminfo_shmmax=0x80000000setshmsys:shminfo_shmseg=36setsemsys:seminfo_semmnu=600Setshminfo_shmmaxtothetotalmemoryinyoursystem(inhexadecimalnotationthevalue0x80000000shownisfor2Gigabytesofmemory).
Iftheseminfo_*variablesarealreadydefined,incrementthembytheamountsshown.
Thedefaultvaluesforseminfo_semmniandseminfo_semmnsdonotneedtobechanged.
Thevariableshminfo_shmegisobsoleteafterSolaris8.
b.
Reboot,usingthiscommand:sync;sync;rebootOnLinux:a.
Addtheselinestothe/etc/sysctl.
conffile(oriftheyareinthefileascomments,uncommentthem).
Setthevaluetotheamountphysicalmemoryonthemachine.
Specifythevalueasadecimalnumberofbytes.
Forexample,foramachinehaving2GBofphysicalmemory:echo2147483648>/proc/sys/shmmaxecho2147483648>/proc/sys/shmallb.
Reboot,usingthiscommand:sync;sync;rebootOnWindows:Nospecialsystemsettingsareneeded.
12HADBPreinstallationStepsChapter2QuickStartforSettingUpHighAvailabilityFailover27IfyouusedexistingJDKsoftwarewhenyouinstalledastandaloneApplicationServer,checktheJDKversion.
HADBrequiresSunJDK1.
4.
1_03orhigher(forthelatestinformationonJDKversions,seetheSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2ReleaseNotes).
Checktheversioninstalled,andifitisnotdonealready,settheJAVA_HOMEenvironmentvariabletothedirectorywheretheJDKisinstalled.
Ifnecessaryafterthereboot,restartthedomain,WebServer,andnodeagent.
Torestartthedomain,usethecommandasadminstart-domaindomain1.
TorestarttheWebServer,executethestartprograminweb_server_install_dir/https-hostname.
Torestartthenodeagent,usethecommandasadminstart-node-agenthostname.
ReplacethevariablehostnamewiththenameofthehostwheretheApplicationServerisrunning.
InstallingHADBThissectionprovidesthestepsforinstallingthehigh-availabilitydatabase(HADB).
Note–Ifyouplantorunthehigh-availabilitydatabaseontheApplicationServermachine,andifyouinstalledHADBwhenyouinstalledApplicationServer,skipto"StartingHADB"onpage29.
YoucaninstalltheHADBcomponentonthesamemachineasyourApplicationServersystemifyouhave2Gbytesofmemoryand1-2CPUs.
Ifnot,useadditionalhardware.
Forexample:Two1CPUsystemswith512Mbytesto1GbytememoryeachOne1-2CPUsystemwith1Gbytesto2GbytesmemoryToInstallHADBRuntheApplicationServerorJavaEnterpriseSysteminstaller.
ChoosetheoptiontoinstallHADB.
Completetheinstallationonyourhosts.
34123InstallingHADBSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200828StartingHADBThissectiondescribesstartingtheHADBmanagementagentinmostcasesbyrunningthema-initdscript.
Foraproductiondeployment,startthemanagementagentasaservicetoensureitsavailability.
Formoreinformation,see"StartingtheHADBManagementAgent"inSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuide.
IfstartingadatabasewithHADBnodesonseveralhosts,startthemanagementagentoneachhost.
ToStartHADBinaJavaEnterpriseSystemInstallationonSolarisorLinuxChangetothe/etc/init.
ddirectory:cd/etc/init.
dRunthecommandtostarttheagent:.
/ma-initdstartToStartHADBinaJavaEnterpriseSystemInstallationonWindowsHADBisstartedbydefaultwhenSunJavaSystemisconfiguredandrunning.
However,ifyouneedtostartitmanually,followthesesteps:GotoStartSettingsControlPanel,anddoubleclickAdministrativeTools.
DoubleclickServicesshortcut.
SelectHADBMgmtAgentServicefromtheServiceslist.
FromtheActionmenu,selectStart.
121234StartingHADBChapter2QuickStartforSettingUpHighAvailabilityFailover29ToStartHADBinaStand-AloneInstallationonSolarisorLinuxChangetotheHADBbindirectoryintheApplicationServerinstallation:install-dir/hadb/4/binRunthecommandtostarttheagent:.
/ma-initdstartToStartHADBinaStand-AloneInstallationonWindowsInaterminalwindow,changetotheHADBbindirectoryintheApplicationServerinstallation:install-dir\hadb\4.
x\binThexrepresentsthereleasenumberofHADB.
Runthecommandtostarttheagent:ma-ima.
cfgConfiguringaClusterandApplicationforHighAvailabilityTheFirstClusterclustermustbeconfiguredtouseHADBandhigh-availabilitymustbeenabledfortheclusterjspapplicationbeforeyoucanverifyHTTPsessionpersistence.
ToConfigureaClusterandApplicationforHighAvailabilityFromthemachineonwhichtheDomainAdministrationServerisrunning,configureFirstClustertouseHADBusingthiscommand:asadminconfigure-ha-cluster--hostshadb_hostname,hadb_hostname--devicesize256FirstClusterReplacethehadb_hostnamevariablewiththehostnameofthemachinewhereHADBistorun.
Ifyouareusingjustonemachine,youmustnameittwice.
ThissimplifiedexamplerunstwonodesofHADBonthesamemachine.
Inproductionsettings,usemorethanonemachine.
12121ConfiguringaClusterandApplicationforHighAvailabilitySunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200830Note–ToreducethememoryfootprintofHADBfordemonstrationpurposes,executethefollowinghadbmcommand.
Youarepromptedfortheadministrationpassword.
InJavaEnterpriseSysteminstallations:/opt/SUNWhadb/4/bin/hadbmsetDataBufferPoolSize=64,LogBufferSize=25FirstClusterInstandaloneApplicationServerinstallations:install_dir/hadb/4/bin/hadbmsetDataBufferPoolSize=64,LogBufferSize=25FirstClusterConfiguretheclusterjspapplicationforHTTPsessionpersistencebyenablinghighavailability:a.
IntheAdminConsole,expandtheApplicationsnode.
b.
ExpandEnterpriseApplications.
c.
Clickclusterjsp.
d.
Intherightpane,ontheGeneraltab,clicktheAvailabilityEnabledcheckbox.
e.
ClickSave.
Availabilityisenabledattheserverinstanceandcontainerlevelbydefault.
RestartingtheClusterBeforethechangesmadeintheprevioussectiontakeeffect,thecluster'sinstancesmustberestarted.
.
ToRestarttheClusterIntheAdminConsole,expandtheClustersnode.
ClickFirstCluster.
Intherightpane,clickStopInstances.
Oncetheinstancesarestopped,clickStartInstances.
21234RestartingtheClusterChapter2QuickStartforSettingUpHighAvailabilityFailover31VerifyingHTTPSessionFailoverThestepsfortestingsessiondatafailoveraresimilarfortestingloadbalancingasdescribedinthetopic"VerifyingLoadBalancing"onpage20.
ThistimeSessionDataispreservedafterfailure.
Failoveristransparenttotheuserbecausethesampleapplicationisconfiguredforautomaticretryafterfailure.
ToVerifyHTTPSessionFailoverTodisplaythefirstpageoftheclusterjspapplication,typethisURLinyourbrowser:http://localhost:web_server_port/clusterjspReplacethelocalhostvariablewiththenameofthesystemthattheWebServerisrunningon.
Replacetheweb_server_portvariablewiththevalueoftheportattributeoftheLSelementinweb_server_install_dir/https-hostname/config/server.
xml.
Forthisexample,port38000isused.
Apagesimilartowhatyousawin"ToVerifytheApplicationDeployment"onpage16appears.
ExaminetheSessionandHostinformationdisplayed.
Forexample:ExecutedFromServer:localhostServerPortNumber:38000ExecutedServerIPAddress:192.
18.
145.
133SessionID:41880f618e4593e14fb5d0ac434b1SessionCreated:WedFeb2315:23:18PST2005Viewtheserveraccesslogfilestodeterminewhichapplicationserverinstanceisservingtheapplication.
Thelogfilesarelocatedhere:SolarisJavaEnterpriseSysteminstallation:/var/opt/SUNWappserver/nodeagents/nodeagent_name/i1/logs/access/server_access_log/var/opt/SUNWappserver/nodeagents/nodeagent_name/i2/logs/access/server_access_logLinuxJavaEnterpriseSysteminstallation:/var/opt/sun/appserver/nodeagents/nodeagent_name/i1/logs/access/server_access_log/var/opt/sun/appserver/nodeagents/nodeagent_name/i2/logs/access/server_access_logWindowsJavaEnterpriseSysteminstallation:install-dir\nodeagents\nodeagent_name\i1\logs\access\server_access_log123VerifyingHTTPSessionFailoverSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200832install-dir\nodeagents\nodeagent_name\i2\logs\access\server_access_logStandaloneApplicationServerinstallations:install-dir/nodeagents/nodeagent_name/i1/logs/access/server_access_loginstall-dir/nodeagents/nodeagent_name/i2/logs/access/server_access_logStoptheApplicationServerinstancethatisservingthepage.
a.
IntheAdminConsole,intheleftpane,expandClusters.
b.
ClickFirstCluster.
c.
Intherightpane,clicktheInstancestab.
d.
ClickthecheckboxnexttotheserverinstancethatservedtherequestandclicktheStopbutton.
Reloadtheclusterjspsampleapplicationpage.
ThesessionIDandsessionattributedataisretained.
ChecktheaccesslogoftheotherApplicationServerinstance,andnoticethatitisnowservicingtherequest.
ThestatefailoverfeaturesworkbecausetheHTTPsessionisstoredpersistentlyintheHADB.
InadditiontotheHTTPsessionstate,theApplicationServeralsocanstorethestateofEJBTMenterprisebeansintheHADB.
CleaningUpTocleanup,youcanuninstalltheApplicationServerinstallationbycompletingthestepsin"ToUninstallCompletely"onpage33,oryoucansimplydeletethesampleclusteryouhavejustcreatedbycompletingthestepsin"ToRemovetheSampleCluster"onpage35ToUninstallCompletelyStoptheApplicationServerprocessesusingthesecommands:asadminstop-clusterFirstClusterasadminremove-ha-cluster--hostshadb_hostname,hadb_hostnameFirstClusterReplacethehadb_hostnamevariablewiththehostnameofthemachinewhereHADBistorun.
Ifyouareusingjustonemachine,youmustnameittwice.
asadminstop-node-agenthostname4561CleaningUpChapter2QuickStartforSettingUpHighAvailabilityFailover33asadminstop-domaindomain1StoptheHADBManagementAgentbyoneofthefollowingmethods:InaSolarisorLinuxJavaEnterpriseSysteminstallation:a.
Changetothe/etc/init.
ddirectory:cd/etc/init.
db.
Runthecommandtostoptheagent:.
/ma-initdstopInaWindowsJavaEnterpriseSysteminstallationa.
GotoStartSettingsControlPanel,anddoubleclickAdministrativeTools.
b.
DoubleclicktheServicesshortcut.
c.
SelectHADBMgmtAgentServicefromtheServiceslist.
d.
FromtheActionmenu,selectStop.
Inastand-aloneSolarisorLinuxApplicationServerinstallation:a.
Changetoinstall-dir/hadb/4/binb.
Runthecommandtostoptheagent:.
/ma-initdstopInastand-aloneWindowsApplicationServerInstallation:a.
Changetoinstall-dir\hadb\4.
x\binThexrepresentsthereleasenumberofHADB.
b.
Runthecommandtostoptheagent:ma-rAtthispointallprocessesrelatedtoSunJavaSystemApplicationServerarestopped.
UninstalltheApplicationServer.
InaSolarisorLinuxJavaEnterpriseSysteminstallation,runvar/sadm/prod/entsys/uninstallandfollowthestepsintheuninstallationwizard.
23CleaningUpSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200834InaWindowsJavaEnterpriseSysteminstallation,usetheControlPanel'sAdd/RemoveProgramsitem.
ChooseSunJavaEnterpriseSystemsandclickChange/Remove.
InaSolarisorLinuxstandaloneApplicationServerinstallation,runinstall_dir/uninstallandfollowthestepsintheuninstallationwizard.
InaWindowsstandaloneApplicationServerinstance,fromtheStartmenu,chooseProgramsSunMicrosystemsApplicationServerEEUninstall.
IfyoucreatedanewWebServerinstanceforthisexercise,deleteit:a.
LogontotheWebServer'sAdministrationConsole.
b.
Stoptheinstance.
c.
Deletetheinstance.
TounsinstalltheWebServerproduct,runtheuninstallprogramfromtheweb_server_install_dir.
ToRemovetheSampleClusterUsethisproceduretoremoveonlytheFirstCluster(thesamplehighly-availablecluster)andthesampleapplicationusedduringthisexercise.
StoptheApplicationServerprocessesandcleanupconfiguration:asadminstop-clusterFirstClusterasadminremove-ha-cluster--hostshadb_hostname,hadb_hostnameFirstClusterReplacethehadb_hostnamevariablewiththehostnameofthemachinewhereHADBistorun.
Ifyouareusingjustonemachine,youmustnameittwice.
asadmindisable-http-lb-serverFirstClusterasadmindelete-http-lb-ref--configMyLbConfigFirstClusterasadmindelete-http-lb-configMyLbConfigasadmindelete-instancei1asadmindelete-instancei2asadmindelete-clusterFirstClusterasadminundeployclusterjsp451CleaningUpChapter2QuickStartforSettingUpHighAvailabilityFailover35Stopthewebserverinstanceactingasloadbalancerbyrunningthestopprogramin:web_server_install_dir/https-hostnameRenametheloadbalancer.
xmlfileinweb_server_install_dir/https-hostname/configtoloadbalancer.
xml.
savStoptheHADBManagementAgentbyoneofthefollowingmethods:InaSolarisorLinuxJavaEnterpriseSysteminstallation:a.
Changetothe/etc/init.
ddirectory:cd/etc/init.
db.
Runthecommandtostoptheagent:.
/ma-initdstopInaWindowsJavaEnterpriseSysteminstallation:a.
GotoStartSettingsControlPanel,anddoubleclickAdministrativeTools.
b.
DoubleclicktheServicesshortcut.
c.
SelectHADBMgmtAgentServicefromtheServiceslist.
d.
FromtheActionmenu,selectStop.
Inastand-aloneSolarisorLinuxApplicationServerinstallation:a.
Changetoinstall-dir/hadb/4/binb.
Runthecommandtostoptheagent:.
/ma-initdstopInastand-aloneWindowsApplicationServerInstallation:a.
Changetoinstall-dir\hadb\4.
x\binThexrepresentsthereleasenumberofHADB.
b.
Runthecommandtostoptheagent:ma-rCongratulations!
YouhavenowcompletedtheQuickStartforApplicationServer.
234NextStepsCleaningUpSunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2QuickStartGuideDecember200836Inthissection,youhaveinstalled,configured,andstartedHADBandconfiguredaclusterandanapplicationtousehighavailability.
Youhavealsocleanedupsothatyoursystemisreadyforotherwork.
See"WheretoGoNext"onpage37foradditionalinformationonApplicationServer.
WheretoGoNextOtherresourcesforlearningaboutandusingApplicationServerareavailable.
Theyinclude:Productdetailsatinstall-dir/docs-ee/about.
html.
Seethisdocumentforthelatestinformationonwhatisnew,andpointerstotutorialsandothereducationalservices.
SunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2ReleaseNotesSeethisdocumentforlate-breakinginformationregardingthisrelease.
SunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2AdministrationGuideSeethisdocumentforinformationonperformingadministrativefunctionsusingtheAdminConsole.
SunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2ReferenceManualSeethisdocumentforreferenceinformationonApplicationServercommand-lineutilities,suchasasadmin.
SunJavaSystemApplicationServerEnterpriseEdition8.
12005Q2HighAvailabilityAdministrationGuideSeethisdocumentforinformationontheSunJavaSystemApplicationServer'shighavailabilityfeatures.
TheJ2EE1.
4Tutorial(http://java.
sun.
com/j2ee/1.
4/docs/tutorial/doc/index.
html)SeethisdocumentforatutorialthatcoverstheprocessforbuildinganddeployingJava2Platform,EnterpriseEdition(J2EEplatform)applications.
JavaBluePrintsguidelinesfortheEnterprise(http://java.
sun.
com/blueprints)SeethisdocumentforacomprehensivesetofexamplesthatdemonstrateoperationsoftheApplicationServersoftwareandthatcanbeusedasapplicationtemplates.
WheretoGoNextChapter2QuickStartforSettingUpHighAvailabilityFailover3738
virmach送来了夏季促销,价格低到爆炸,而且在低价的基础上还搞首年8折,也就是说VPS低至7.2美元/年。不过,这里有一点要说明:你所购买的当前的VPS将会在09/30/2021 ~ 04/30/2022进行服务器转移,而且IP还会改变,当前的Intel平台会换成AMD平台,机房也会变动(目前来看以后会从colocrossing切换到INAP和Psychz),采取的是就近原则,原来的水牛城可能...
LightNode是一家位于香港的VPS服务商.提供基于KVM虚拟化技术的VPS.在提供全球常见节点的同时,还具备东南亚地区、中国香港等边缘节点.满足开发者建站,游戏应用,外贸电商等应用场景的需求。新用户注册充值就送,最高可获得20美元的奖励金!成为LightNode的注册用户后,还可以获得属于自己的邀请链接。通过你的邀请链接带来的注册用户,你将直接获得该用户的消费的10%返佣,永久有效!平台目前...
易探云怎么样?易探云是国内一家云计算服务商家,致力香港服务器、国内外服务器租用及托管等互联网业务,目前主要地区为运作香港BGP、香港CN2、广东、北京、深圳等地区。目前,易探云推出深圳或北京地区的适合挂机和建站的云服务器,国内挂机宝云服务器(可选深圳或北京地区),独立ip;2核2G5M挂机云服务器仅330元/年起!点击进入:易探云官方网站地址易探云国内挂机宝云服务器推荐:1、国内入门型挂机云服务器...
rebootsystemnow什么意思为你推荐
域名空间代理现在代理域名空间赚钱吗域名空间代理免费空间代理,免费域名代理,哪里有?asp主机sulzer主机类型有哪些info域名注册百度还收录新注册的info域名吗?免费虚拟主机申请永久免费虚拟主机国内ip代理谁能推荐一款最快的ip代理。台湾vps香港vps和台湾vps哪个好用域名申请申请域名需要什么条件?具体点!急!急!!!重庆网站空间重庆建网站的公司 我司准备建一个好点的网站,求推荐虚拟主机管理系统我也想和你学虚拟主机管理系统的操作
域名升级访问 网址域名注册 工信部域名备案系统 winscp 主机点评 韩国加速器 国外服务器网站 l5520 谷歌香港 北京主机 牛人与腾讯客服对话 150邮箱 创梦 softbank邮箱 空间合租 美国独立日 cloudlink dnspod iki lamp兄弟连 更多