background image

Note –

To reduce the memory footprint of HADB for demonstration purposes,

execute the following

hadbm

command. You are prompted for the administration

password.

In Java Enterprise System installations:

/opt/SUNWhadb/4/bin/hadbm set

DataBufferPoolSize=64,LogBufferSize=25 FirstCluster

In standalone Application Server installations:

install_dir

/hadb/4/bin/hadbm set

DataBufferPoolSize=64,LogBufferSize=25 FirstCluster

2. Configure the clusterjsp application for HTTP session persistence by enabling

high availability:

a. In the Admin Console, expand the Applications node.

b. Expand Enterprise Applications.

c. Click clusterjsp.

d. In the right pane, on the General tab, click the Availability Enabled

checkbox.

e. Click Save.

Availability is enabled at the server instance and container level by default.

Restarting the Cluster

Before the changes made in the previous section take effect, the cluster’s instances
must be restarted..

To Restart the Cluster

1. In the Admin Console, expand the Clusters node.

2. Click FirstCluster.

3. In the right pane, click Stop Instances.

Steps

Chapter 2 • Quick Start for Setting Up High Availability Failover

31

Summary of Contents for 2005Q2

Page 1: ...Sun Java System Application Server Enterprise Edition 8 1 2005Q2 Quick Start Guide Sun Microsystems Inc 4150 Network Circle Santa Clara CA 95054 U S A Part No 819 2553 ...

Page 2: ...systems Inc 4150 Network Circle Santa Clara CA 95054 U S A Tous droits réservés Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l utilisation la copie la distribution et la décompilation Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme par quelque moyen que ce soit sans l autorisation préalable et écrite de Sun...

Page 3: ...11 Creating a Cluster 12 To Start the Node Agent 12 To Create a Cluster 12 Deploying an Application 15 To Deploy the Sample Application 15 To Start the Cluster 16 To Verify the Application Deployment 16 Setting up Load Balancing 17 Installing Web Server Software 18 To Install the Web Server Using the Java Enterprise System Installer 18 To Install the Web Server for Stand Alone Application Server I...

Page 4: ...tallation on Solaris or Linux 29 To Start HADB in a Java Enterprise System Installation on Windows 29 To Start HADB in a Stand Alone Installation on Solaris or Linux 29 To Start HADB in a Stand Alone Installation on Windows 30 Configuring a Cluster and Application for High Availability 30 To Configure a Cluster and Application for High Availability 30 Restarting the Cluster 31 To Restart the Clust...

Page 5: ...rver on page 7 Creating a Cluster on page 12 Deploying an Application on page 15 The advanced steps which usually require about 45 minutes to complete are in these sections The steps for setting up load balancing in Setting up Load Balancing on page 17 The steps for setting up high availability and failover in Chapter 2 The final sections of this guide include instructions for cleaning up and info...

Page 6: ...ains Linux Java Enterprise System installations var opt sun appserver domains All other installations install dir domains domain_dir By default domain directories are located here domain_root_dir domain_dir About Application Server Administration To enable administrators to manage server instances and clusters running on multiple hosts Application Server provides these tools The Admin Console a br...

Page 7: ...xamining the Log File on page 11 Starting the Domain Administration Server To start the Domain Administration Server start the default domain domain 1 using the following procedures Note Because this guide instructs you to set an environment variable AS_ADMIN_USER for administrative user name it does not instruct you to supply a user name argument when the asadmin command is used Without the envir...

Page 8: ...em Properties dialog 3 Click the Advanced tab 4 Click Environment Variables 5 In the User variables section If a PATH variable exists verify that install dir bin exists in the path install dir bin other_entries If a PATH variable is not present click New In Variable Name type PATH In Variable Value type the path to the server s bin directory install dir bin Click OK to commit the change 6 Add a ne...

Page 9: ... used to Deploy and undeploy applications Enable disable and manage applications Configure resources and other server settings Configure clusters and node agents Manage server instances and clusters Select and view log files For further information about using the Admin Console consult the online help or the Sun Java System Application Server Enterprise Edition 8 1 2005Q2 Administration Guide To L...

Page 10: ...mission protocol 2 When the log in window appears enter the admin user name and password 3 Click Log In When the Admin Console appears it looks like this In the left pane select what you want to manage from the tree provided In the right pane various administrative tasks are listed under the Common Tasks heading Tip Click the Registration tab to register your software if you have not already done ...

Page 11: ...st and click Search The Domain Administration Server s recent log file entries are displayed 3 Scan the messages and look for any WARNING or SEVERE messages indicating that problems were encountered during server start up You can close Log Viewer at any time After you create clusters and deploy applications examine log files if any of the operations failed Use Log Viewer to view the log files of a...

Page 12: ... Administration Server to create new Application Server instances One node agent is needed on a machine for each Application Server administrative domain that the machine belongs to If you chose the Node Agent Component during installation a default node agent called hostname was created 1 In a terminal window type this command asadmin start node agent hostname Replace the variable hostname with t...

Page 13: ...t https localhost 4849 if you have not already done so Replace the localhost variable with the name of the system that the Domain Administration Server is running on 4849 is the Admin Console s default port number If you changed the port number during the installation use that number instead 2 On the right pane under Common Tasks click Create New Cluster to display the Create Cluster input page 3 ...

Page 14: ...efault config was made for this cluster and the name FirstCluster config was assigned to it 8 In the left pane expand Clusters and click FirstCluster to display the General Information page for clusters 9 Click the Instances tab to display i1 and i2 the instances that you created a Click i1 to examine this instance b From the tabs above the General Information heading of the right pane click Prope...

Page 15: ...the following steps To Deploy the Sample Application on page 15 To Start the Cluster on page 16 To Verify the Application Deployment on page 16 To Deploy the Sample Application This guide uses the clusterjsp sample application to demonstrate web path load balancing capabilities This task shows you how to deploy that application 1 Click the Home button to go to the Common Tasks page if you are not ...

Page 16: ...he Start Instances button to start the cluster 4 Verify that it has started by checking that the Status field which indicates what instances are running To Verify the Application Deployment This procedure verifies that the application was deployed properly and is accessible on each instance in the cluster 1 Type the following URL in your browser Steps Steps 16 Sun Java System Application Server En...

Page 17: ...ck Start trail here if you do not wish to proceed to the advanced steps Setting up Load Balancing A load balancer is typically deployed in front of a cluster It Allows an application or service to be scaled horizontally across multiple physical or logical hosts yet still presents the user with a single URL Insulates the user from host failures or server crashes when it is used with session replica...

Page 18: ... in However you can also install Web Server software using these steps 1 Launch the Java Enterprise System installer 2 Select the Sun Java System Web Server component in the Component Selection page 3 Choose Configure Now to be prompted for Web Server Configuration during installation 4 When you are prompted define a default Web Server instance Tip Remember the port number you choose for this defa...

Page 19: ...ance This guide assumes that port 38000 is selected as the HTTP port for default instance Installing the Load Balancer Plug in The section describes installing the load balancer plug in for either a Sun Java Enterprise System distribution or a stand alone Application Server distribution To Install the Load Balancer Plug in 1 Run the installer for the software distribution you are using Sun Java En...

Page 20: ...he configuration to a file loadbalancer xml asadmin export http lb config config MyLbConfig loadbalancer xml 5 Copy loadbalancer xml to web_server_install_dir https hostname config loadbalancer xml Starting Load Balancing Start load balancing by starting or restarting the Web Server If the Web Server instance serving as load balancer is not already running start the Web Server software by executin...

Page 21: ...ancer has forwarded the request on the two instances in the cluster 4 Using different browser software or a browser on a different machine create a new session Requests from the same browser are sticky and go to the same instance These sessions should be distributed to the two instances in the cluster You can verify this by looking at the server access log files located here Solaris Java Enterpris...

Page 22: ... up you can uninstall the Application Server installation by completing the steps in To Uninstall Completely on page 22 or you can simply delete the sample cluster you have just created by completing the steps in To Remove the Sample Cluster Only on page 23 Caution If you plan to complete Chapter 2 do not use these clean up procedures Instead go to Chapter 2 now and when you are done use the proce...

Page 23: ... in the following directory web_server_install_dir https hostname 4 If you want to unsinstall the Web Server product run the uninstall program from the web_server_install_dir To Remove the Sample Cluster Only To remove only the FirstCluster the sample highly available cluster and the sample application used during this exercise but retain the installed Application Server and Web Server use the fol...

Page 24: ...erence Manual See this document for reference information on Application Server s command line utilities such as asadmin Sun Java System Application Server Enterprise Edition 8 1 2005Q2 High Availability Administration Guide See this document for information on the Sun Java System Application Server s high availability features The J2EE 1 4 Tutorial http java sun com j2ee 1 4 docs tutorial doc ind...

Page 25: ...es in this chapter cover HTTP session persistence These steps assume you have already performed the steps in the previous sections of this Quick Start The steps are presented in the order that you should complete them Note Completing this section may require additional hardware resources This topic contains the following sections About High Availability Clusters and HADB on page 26 HADB Preinstall...

Page 26: ...uster The HADB state replication service can be independently scaled for optimum availability and performance When an application server instance also performs replication the performance of J2EE applications can suffer and can be subject to longer garbage collection pauses Because each HADB node requires 512 Mbytes of memory you need 1 Gbyte of memory to run two HADB nodes on the same machine If ...

Page 27: ...le or if they are in the file as comments uncomment them Set the value to the amount physical memory on the machine Specify the value as a decimal number of bytes For example for a machine having 2 GB of physical memory echo 2147483648 proc sys shmmax echo 2147483648 proc sys shmall b Reboot using this command sync sync reboot On Windows No special system settings are needed 3 If you used existing...

Page 28: ... system if you have 2 Gbytes of memory and 1 2 CPUs If not use additional hardware For example Two 1 CPU systems with 512 Mbytes to 1 Gbyte memory each One 1 2 CPU system with 1 Gbytes to 2 Gbytes memory To Install HADB 1 Run the Application Server or Java Enterprise System installer 2 Choose the option to install HADB 3 Complete the installation on your hosts Starting HADB This section describes ...

Page 29: ...stem is configured and running However if you need to start it manually follow these steps 1 Go to Start Settings Control Panel and double click Administrative Tools 2 Double click Services shortcut 3 Select HADBMgmtAgent Service from the Services list 4 From the Action menu select Start To Start HADB in a Stand Alone Installation on Solaris or Linux 1 Change to the HADB bin directory in the Appli...

Page 30: ...verify HTTP session persistence To Configure a Cluster and Application for High Availability 1 From the machine on which the Domain Administration Server is running configure FirstCluster to use HADB using this command asadmin configure ha cluster hosts hadb_hostname hadb_hostname devicesize 256 FirstCluster Replace the hadb_hostname variable with the host name of the machine where HADB is to run ...

Page 31: ...P session persistence by enabling high availability a In the Admin Console expand the Applications node b Expand Enterprise Applications c Click clusterjsp d In the right pane on the General tab click the Availability Enabled checkbox e Click Save Availability is enabled at the server instance and container level by default Restarting the Cluster Before the changes made in the previous section tak...

Page 32: ...r https hostname config server xml For this example port 38000 is used A page similar to what you saw in To Verify the Application Deployment on page 16 appears 2 Examine the Session and Host information displayed For example Executed From Server localhost Server Port Number 38000 Executed Server IP Address 192 18 145 133 Session ID 41880f618e4593e14fb5d0ac434b1 Session Created Wed Feb 23 15 23 18...

Page 33: ...heckbox next to the server instance that served the request and click the Stop button 5 Reload the clusterjsp sample application page The session ID and session attribute data is retained 6 Check the access log of the other Application Server instance and notice that it is now servicing the request The state failover features work because the HTTP session is stored persistently in the HADB In addi...

Page 34: ...nd to stop the agent ma initd stop In a Windows Java Enterprise System installation a Go to Start Settings Control Panel and double click Administrative Tools b Double click the Services shortcut c Select HADBMgmtAgent Service from the Services list d From the Action menu select Stop In a stand alone Solaris or Linux Application Server installation a Change to install dir hadb 4 bin b Run the comm...

Page 35: ...nstance c Delete the instance 5 To unsinstall the Web Server product run the uninstall program from the web_server_install_dir To Remove the Sample Cluster Use this procedure to remove only the FirstCluster the sample highly available cluster and the sample application used during this exercise 1 Stop the Application Server processes and clean up configuration asadmin stop cluster FirstCluster asa...

Page 36: ...e from the Services list d From the Action menu select Stop In a stand alone Solaris or Linux Application Server installation a Change to install dir hadb 4 bin b Run the command to stop the agent ma initd stop In a stand alone Windows Application Server Installation a Change to install dir hadb 4 x bin The x represents the release number of HADB b Run the command to stop the agent ma r Congratula...

Page 37: ... 2005Q2 Reference Manual See this document for reference information on Application Server command line utilities such as asadmin Sun Java System Application Server Enterprise Edition 8 1 2005Q2 High Availability Administration Guide See this document for information on the Sun Java System Application Server s high availability features The J2EE 1 4 Tutorial http java sun com j2ee 1 4 docs tutoria...

Page 38: ...38 Sun Java System Application Server Enterprise Edition 8 1 2005Q2 Quick Start Guide ...

Reviews: