Apple Java Application Server Guide Version 10 3
|
|
Bookmark Apple Java Application Server Guide Version 10 3 |
About Apple Java Application Server Guide Version 10 3Here you can find all about Apple Java Application Server Guide Version 10 3 like manual and other informations. For example: review.
Apple Java Application Server Guide Version 10 3 manual (user guide) is ready to download for free.
On the bottom of page users can write a review. If you own a Apple Java Application Server Guide Version 10 3 please write about it to help other people. [ Report abuse or wrong photo | Share your Apple Java Application Server Guide Version 10 3 photo ]
Manual
Preview of first few manual pages (at low quality). Check before download. Click to enlarge.
Download
(English)Apple Java Application Server Guide Version 10.3, size: 1.9 MB |
Apple Java Application Server Guide Version 10 3
Video review
DOWNGRADE iOS4 iPhone 3gS to 3.1.2
User reviews and opinions
| Mnemosynea |
1:10am on Sunday, October 17th, 2010 ![]() |
| You can get a Nano or Touch for around a third of the price and still get Music, Podcasts, Apps, Clip, FM Radio and Camera. Overpriced content consumption table. Very responsive touch screen, high res screen Content Consumption only. Not great value for money. No camera. | |
| Jonar Roman |
2:38am on Friday, October 8th, 2010 ![]() |
| Awesome game player, and has replaced my laptop but I do not have to need for business and so I do not know about how those work. Great for traveling,... | |
| gbio |
5:37am on Sunday, September 26th, 2010 ![]() |
| My Company uses Citrix, so I am able to run Windows Applications, SAP, even flash and all my GO TO corporate applications on the device. The iPad is exactly what I expected, easy to use, very well executed so long as you understand that it is mainly a device to consume media. | |
Comments posted on www.ps2netdrivers.net are solely the views and opinions of the people posting them and do not necessarily reflect the views or opinions of us.
Documents

Organization of This Document
This document has the following chapters:
Application Server Overview (page 9) provides an overview of JBoss for Mac OS X Server. Configuring Applications (page 11) explains how to perform certain tasks with the deployment tool, such as opening, configuring, and saving application archives. Configuring and Deploying Suns Pet Store (page 21) walks you through configuring and deploying Suns Pet Store application in Mac OS X Server. Administering Application Servers (page 37) teaches you how to manage application servers, which are JBoss instances running on one or more computers. Balancing User Load and Replicating Sessions (page 47) explains how to enable an application to be distributable among cluster nodes and walks you through configuring HTTP load balancing for Pet Store using three computers.
This document also contains a revision history, a glossary, and an index.
See Also
To use this document to its fullest, you should download its companion files, which are packaged in Application_Server_companion.zip, located in the same webpage from which you obtained this document. For an introduction to J2EE, visit http://java.sun.com/j2ee. You can get detailed information on JBoss at http://jboss.org.
C H A P T E R
Application Server Overview
JBoss is an open-source highly popular Java-based application server. Based on the Java 2, Enterprise Edition (J2EE) platform, JBoss provides an affordable delivery system for enterprise applications. Applications that follow the J2EE standard can be deployed on other application servers, such as WebLogic, WebSphere, and JRun, with little or no modification. JBoss provides many useful features in addition those defined in the J2EE standard, including support for clustering, session replication, mail, and security. Mac OS X Server includes two easy-to-use, HTML-based tools that facilitate the configuration of J2EE applications for deployment: The deployment tool and the management tool. The deployment tool allows you to open application or component archives (EAR files, WAR files, JAR files, SAR files, and so on) without having to manually decompress the archives. The application lets you view or change the values of settings specified in the META-INF and WEB-INF directories of the archives. See Configuring Applications (page 11) for more information. The management tool allows you to manage application servers (JBoss instances) running on one or more computers. This application lets you start and stop services provided by individual application servers, configure services, and create data sources, queues, and topics. See Administering Application Servers (page 37) for details. This chapter provides an overview of JBoss for Mac OS X Server.
JBoss in Mac OS X Server
Mac OS X Server version 10.3 includes JBoss version 3.2.2RC2. To provide a high level of availability, Mac OS X Server includes a watchdog process that ensures that the application server is always running (if you turn on the application server in Server Admin). If the application server freezes or crashes, the daemon restarts it automatically. In addition, Mac OS X Server offers load balancing and session failover through Apache and JBoss:
Apache, coupled with the mod_jk plug-in, provides HTTP load balancing with session affinity (sticky sessions) and connects to JBoss instances through AJP connectors. JBoss offers session failover through HTTP session state replication in the cluster configuration. JBoss also provides load balancing for enterprise beans, including failover for stateful session beans, and support for session affinity.
In Mac OS X Server, JBoss is configured to use Tomcat (using the AJP connector) as its web server and servlet container. In addition, HTTP and HTTPS (through port 8443) are enabled by default. You can manage the application server from the Server Admin application. This provides you with a simple way to start, stop, and monitor the application server. You can use the command line, if you prefer. Mac OS X Server includes two applications that allow you to deploy applications on JBoss and monitor their performance. They are the JBoss deployment tool and the JBoss management tool. The deployment tool allows you to configure an application or an application component so that, for example, it accesses the appropriate data sources and database tables when its run. This is how application developers decouple business logic from the database engine that is used to persist data. That way, you can use the database engine that meets your needs and not the one the developer used while developing the application. For details on the deployment tool, see Configuring Applications (page 11). The management tool lets you administer the local (running on the computer you are logged in to) application server, and monitor local and remote (running on a computer in the local network) application servers. As part of administering an application server, you may start and stop services, configure services, deploy applications, and add data sources, queues, and topics. When monitoring an application server, the management tool lets you access the statistics provided by the resources and services running on it. For example, a service may indicate its name, its purpose, and when it was started. For more information on the management tool, see Administering Application Servers (page 37).
Configuring Your Application
The following sections teach you how to start the deployment tool and configure your application.
Starting the JBoss Deployment Tool
To start the deployment tool, double-click DeploymentTool.woa in /Library/JBoss/Applications or enter the following command in Terminal:
$ /Library/JBoss/Applications/DeploymentTool.woa/DeploymentTool
After a moment, the Load Application window appears. Note: Running the JBoss Deployment Tool requires a web browser that supports Frames and Javascript. Some web browsers may need to have pop-up blocking disabled.
Loading Your Application
The Load Application window is where you specify the location of the application or component you want to configure. Although the window is titled Load Application, you can also use the deployment tool to configure EAR files, WAR files, and JAR files. Figure 3-1 shows the Load Application window.
Figure 2-1 The Load Application window of the deployment tool
Enter the full path to the file in the text field in the Load Application window, and click Load Application. Note: The file path you enter in the text field is from the perspective of the server the deployment tool runs on. That is, if you access the deployment tool from a web browser that runs on a different computer, the archive you configure must reside on the server, not the computer the web browser runs on. Normally, you cannot save an application with invalid XML files. That is, you have to configure all the elements that show up in red in the main window. You can override this by deselecting Validate XML Files in the Load Application window. However, you may not be able to reload an application that has been saved in this state.
After the deployment tool loads the application, it displays the Loaded Application window, shown in Figure 3-2.
Figure 2-2 The Loaded Application window
Click Click here to continue to move on. The deployment tool displays the main window (also known as the navigation window). The main window presents a hierarchy of components generated from the XML files present in the META-INF and WEB-INF directories of the components contained in the archive you opened. For example, Figure 3-3 shows the components present in the petstore.ear file of Sun Microsystems Pet Store application. You must configure the items in red to save the application. Configuring Your Applications Components (page 17) shows you how to do this.
Figure 2-3
The deployment-tool main window
Figure 3-3 shows the components of the petstore.ear archive. The following list describes some of the items in the main window:
PetStoreEAR (Application) Represents the Pet Store enterprise-application archive. Application Settings Clicking this link allows you to configure settings that affect all the modules in the archive when the application is deployed. AsyncSenderEJB (EJB) Represents the archive (JAR file) that contains the files that define the AsyncSender enterprise bean (the asyncsender-ejb.jar file). Clicking the Module Settings link lets you configure module-wide settings and set default values for some settings for all the enterprise beans defined in the module. See Configure the Customer Module (page 25) for an example. PetStoreWAR (WebApp) Represents the archive (WAR file) that contains the files that define the web module of the Pet Store enterprise application.
Configuring Your Applications Components
To configure a component, you choose it from the main window by clicking the appropriate link. This causes the deployment tool to display the configuration window for the component. As you can see in Figure 3-4, this is a tabbed window that contains one or more panes, which you use to configure specific aspects of the component. The configuration window also contains a Quick Config pane, which contains elements of the component that you must configure for the application to be deployable. Figure 3-4 shows the Quick Config pane of the CatalogEJB module. It indicates that the JBoss resource references must be configured. The JBoss resource references also appear in the JNDI Resource Refs pane. However, you need to configure them in only one of the two panes.
Figure 2-4 The Quick Config pane of a components configuration window
Note: For applications with many components, you may want to configure the Quick Config pages of the invalid components and save the application. Then you can configure each component further in a piecemeal fashion. Some settings apply to an entire module, for example, security roles. In addition, some module settings serve as defaults for settings of individual components in the module. Figure 3-5 shows some of the module settings of the CustomerJAR module of the petstore.ear application. Configuring modules settings can help to speed up the configuration of a module. See Configure Module-Wide Settings (page 25) for an example.
Figure 2-5
A module-settings window
After configuring the elements in a pane, you click Update to confirm the changes. Keep in mind that the changes are not saved until you save the application.
Saving a Configured Application
To save a configured application, that is, when no components are shown in red in the main window, click Save in the top of the main window. The Save Application window (Figure 3-6) appears.
Figure 2-6 The Save Application window of the deployment tool
Enter the destination of the configured application in the text field of the Save Application window, and click Save Application.
Deploying Your Application
To deploy a configured application from the deployment tool, simply save the application to /Library/JBoss/3.2/deploy in a single-server deployment or /Library/JBoss/3.2/farm in a cluster deployment.
Configuring and Deploying Suns Pet Store
Pet Store is a sample J2EE application from Sun Microsystems. Pet Store showcases the power and flexibility of the J2EE platform. This chapter provides a tutorial on the configuration of Suns Pet Store for deployment in Mac OS X Server. Suns Pet Store is comprised of several applications. This tutorial uses the Pet Store enterprise application and the Supplier enterprise application. In this tutorial you obtain the Pet Store files from Sun, prepare your Mac OS X Server system for a Pet Store deployment, and configure the Pet Store and Supplier applications for deployment on JBoss. Note: The companion files of this document include configured Pet Store archives that are ready for deployment using MySQL as the database engine. Theyre at Application_Server_companion/Configured_Pet_Store_archives. You need to perform only the steps listed in Set Up the Environment (page 21) and Deploy and Test the Application (page 35). See http://developer.java.sun.com/developer/releases/petstore for more information on Suns Pet Store application.
Set Up the Environment
Before you can configure an enterprise application for deployment in Mac OS X Server, make sure that you have all the files you need. Then create any necessary tables in your database, and ensure that the appropriate processes are running: 1. Get Pet Store from Sun. Download the Pet Store enterprise application from http://developer.java.sun.com/developer/releases/petstore, and place the petstore1.3.2 directory in your home directory. (Pet Store 1.3.2 is also included as part of this documents companion files.) 2. Configure MySQL: a. Launch MySQL Manager, located in /Applications/Server.
b. Click the lock button, and authenticate as the system administrator.
Click Install and then click Start.
d. Quit MySQL Manager. 3. Create the Pet Store Tables: a. In Terminal, run the mysql command-line tool.
Configure the Supplier Enterprise Application
The following sections guide you through configuring the Supplier enterprise application.
Open the supplier.ear file in the Deployment Tool
1. 2. 3. 4. 5. In the PetStoreEAR window, click Load. In the text field in the Load Application window, enter the path to the supplier.ear file, and click Load Application or press Return. In the navigation window, click Connect. If the Connect to Server window indicates that youre not connected to the application server, click Connect to Server. Close the Connect to Server window.
1. 2. 3. 4. Under SupplierEAR (Application), click Application Settings. In the SupplierEAR window, click the JBoss tab. Set J2EE Compliant Class Loading to no, and click Update. Close the window.
Configure the Supplier Module
The following sections explain how to configure the SupplierJAR module.
Configure the Module Settings
1. 2. 3. 4. 5. Under SupplierJAR (EJB), click Module Settings. In the SupplierJAR window, click the CMP - Default Settings tab. From the Datasource pop-up menu, choose MySQL 4.0.14 (java:/MySqlDS). From the Datasource Mapping pop-up menu, choose mySql, and click Update. Close the window.
Configure the Inventory Enterprise Bean
1. 2. 3. Under SupplierJAR (EJB), click Enterprise Beans. Then click InventoryEJB. From the Table Name pop-up menu, choose SUPP_Inventory. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. Click Update to finish configuring the Inventory enterprise bean, and close the window.
Configure the OrderFulfillmentFacade Enterprise Bean
1. 2. 3. 4. Under Enterprise Beans under SupplierJAR (EJB), click OrderFulfillmentFacade. In the JBoss Resource Refs list in the OrderFulfillmentFacadeEJB window, select url/EntityCatalogURL, and click Edit. In the Res URL text field, enter http://localhost:8080/opc/EntityCatalog.jsp, and click Update. Click Update to finish configuring the OrderFulfillmentFacade enterprise bean, and close the window.
Configure the SupplierOrder Message-Driven Bean
1. 2. 3. Under Enterprise Beans under SupplierJAR (EJB), click SupplierOrderMDB. In the JBoss Resource Refs list, select jms/QueueConnectionFactory, and click Edit. From the Jndi Name pop-up menu, choose /ConnectionFactory, and click Update.
4. 5. 6. 7. 8.
In the JBoss Resource Refs list, select jms/TopicConnectionFactory, and click Edit. From the Jndi Name pop-up menu, choose /ConnectionFactory, and click Update. In the JBoss Resource Env Refs list, select jms/opc/InvoiceTopic, and click Edit. From the Jndi Name pop-up menu, choose /topic/opc/InvoiceTopic, and click Update. Click Update to finish configuring the SupplierOrder message-driven bean, and close the window.
Configure the SupplierPurchaseOrder Module
These sections explain how to configure the SupplierPurchaseOrderJAR module.
1. 2. 3. 4. 5. 6. 7. 8. 9. Under SupplierPurchaseOrderJAR (EJB), click Module Settings. In the SupplierPurchaseOrderJAR window, click the CMP - Default Settings tab. From the Datasource pop-up menu, choose MySQL 4.0.14 (java:/MySqlDS). From the Datasource mapping pop-up menu, choose mySql. From the Entity Command Name pop-up menu, choose no-select-before-insert. Click the CMP - PK Generation tab. In the Unknown Pk Class text field, enter java.lang.Long. In the Field Name text field, Enter pk. In the Column Name text field, enter pk.
10. Set Auto Increment to yes, and click Update. 11. Close the window.
1. 2. 3. Under SupplierPurchaseOrderJAR (EJB), click Enterprise Beans. Then click AddressEJB. From the Table Name pop-up menu in the AddressEJB window, choose PS_Address. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. Click Update to finish configuring the Address enterprise bean, and close the AddressEJB window.
1. 2. 3. Under Enterprise Beans under SupplierPurchaseOrderJAR (EJB), click ContactInfoEJB. From the Table Name pop-up menu in the ContactInfoEJB window, choose PS_ContactInfo. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. Click Update to finish configuring the ContactInfo enterprise bean, and close the window.
Configure the LineItem Enterprise Bean
1. 2. 3. Under Enterprise Beans under SupplierPurchaseOrderJAR (EJB), click LineItemEJB. From the Table Name pop-up menu in the LineItemEJB window, choose SUPP_LineItem. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. Click Update to finish configuring the LineItem enterprise bean, and close the window.
Configure the SupplierOrder Enterprise Bean
1. 2. 3. Under Enterprise Beans under SupplierPurchaseOrderJAR (EJB), click SupplierOrderEJB. From the Table Name pop-up menu in the SupplierOrderEJB window, choose SUPP_SupplierOrder. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. Click Update to finish configuring the SupplierOrder enterprise bean, and close the window.
Configure the Supplier Web Application Module
1. Under SupplierWAR (WebApp), click Module Settings.
2. 3. 4. 5. 6.
In the JBoss Resource Env Refs list, select jms/opc/InvoiceTopic, and click Edit. From the Jndi Name pop-up menu, choose /topic/opc/InvoiceTopic, and click Update. In the JBoss Resource Refs list, select jms/TopicConnectionFactory, and click Edit. From the Jndi Name pop-up menu, choose /ConnectionFactory, and click Update. Click Update to finish configuring the Supplier web-application module, and close the window.
1. 2. 3. In the navigation window, click Save. In the text field in the Save Application window, enter /Library/Configured_Apps/supplier.ear, and click Save Application. Close the window.
Deploy and Test the Application
To deploy Pet Store in Mac OS X Server, copy the configured files to /Library/JBoss/3.2/deploy. (You can also use the management tool to deploy the application. See Deploying Applications (page 46) for details.) After about a minute, open http://localhost:8080/petstore in your web browser. You could also have saved the EAR files directly to the JBoss deploy directory. However, its generally safer to configure application files of undeployed archives. Follow these steps to test Pet Store: 1. 2. 3. 4. 5. 6. 7. 8. Open http://localhost:8080/petstore in a web-browser window. Click the link that takes you to the store. In the Welcome to the BluePrints Petstore webpage, click Birds. In the Items webpage, click Amazon Parrot. In the Product webpage, click Add to Cart. In the Cart webpage, click Check Out. In the Sign On webpage, click Sign In. In the Enter Order Information webpage, click Submit.
If you get an error page during the test, make sure JBoss is running and recheck the configuration settings described in Configure the Pet Store Enterprise Application (page 22) and Configure the Supplier Enterprise Application (page 31).
Administering Application Servers
Application-server management involves configuring the services available in an application server, turning services on and off, deploying applications, and monitoring application-server resources. This chapter teaches how to manage application servers, which are JBoss instances running on one or more computers.
Logging In to the Management Tool
Figure 4-4
The JBoss Management Console window showing the Statistics pane of the Pet Store ShoppingCart enterprise bean
When youre done managing, click JBoss in the server list, and click Logout or Change Configuration.
Configuring Application Servers
To configure local application servers, choose the configuration you want to modify from the Modify configuration pop-up menu, and click Modify configuration in the Configuration page. The JBoss Management Console window appears. This window allows you to select a service and change its configuration. For example, to configure the transaction-connection factory service, select jms-ds.xml under services in the application-server list. You can also configure the provider and the session pool of the transaction-connection factory service by clicking the triangle next to jms-ds.xml in the application-server list and selecting the appropriate item, as shown in Figure 5-5.
Figure 4-5 The JBoss Management Console window showing one of the configuration panes for the JMS Directory Service
Note: After youre done making changes, you have to restart the application server for the changes to take effect.
Monitoring Application Servers
To monitor application servers, enter the name of the computer on which the application server is running (by default, localhost) and the JNDI port of the application server (by default, 1099) in the Configuration page, and click Monitor host. To view the statistics provided by particular applications, resources, or services, select the appropriate item in the application-server list. The statistics appear in the Statistics pane, shown in Figure 5-6.
Figure 4-6
The JBoss Management Console window showing the statistics of the Deploy Service
Starting and Stopping Services
You can start and stop services while managing or configuring application servers. To do so, in the application server list, select the application server you want to configure, and click Start/Stop Services in the Host Information pane. The Start or Stop Services pane is displayed in the right side of the JBoss Management Console window, as shown in Figure 5-7.
Figure 4-7
The JBoss Management Console window showing the Start or Stop Services pane
Creating a Data Source
You can create a data source while managing or configuring application servers. To do so, select the application server you want to add the data source to in the server list. Next, enter the name of the data source in the Datasource Name text field in the Create a Datasource group in the Host Information pane, choose a data-source type from the Datasource Type pop-up menu, and click Create Datasource. Enter the appropriate information in the Local TX Datasource pane, and click Update. Note: Make sure to enter a unique JNDI name in the Jndi Name text field of the Local TX Datasource pane. The newly added data source appears under the Resources group in the application-server list.
Creating a Topic or a Queue
You can create a topic or a queue while managing or configuring an application server. Follow these steps to create a topic or a queue: 1. 2. In the application server list, select the application server you want to add the topic or queue to. From the Topic or Queue pop-up menu in the Create a Topic or Queue group in the Host Information pane, choose Topic or Queue.
In the Topic or Queue Name text field, enter the name of the topic or queue. Enter the name of the file in which the topic or queue configuration is to be saved in the Filename text field.
Deploying Applications
You can deploy applications while managing or configuring application servers. Follow these steps to deploy an application: 1. 2. 3. Select the application server you want to deploy the application or service on in the application server list. In the Select an application to deploy group in the Host Information pane, click Choose File, and choose the file to deploy. Click Deploy Application.
Balancing User Load and Replicating Sessions
HTTP load balancing provides a way to distribute user load among a group of application servers. The application servers can be standalone or configured as a cluster, in which case they are know as nodes. Load balancing is better used with sticky sessions. This means that once the load balancer (a web server) forwards a client request to a particular application server, it sends all further requests from the client to the same application server. Using load balancing across standalone application servers allows you to scale your deployment with little increase in request-processing overhead. However, when an application server fails, other application servers cannot pick up the failed-servers load, which may provide an undesirable user experience: Users may have to log in to the application again or may lose the contents of their shopping carts. Load balancing across clustered application servers (or nodes) provides session replication among the nodes, so that when a node fails, another node can take over its duties with little or no user impact. However, as you add nodes to the cluster, each request may take longer to process. This chapter explains how to enable an application to be distributable among cluster nodes and walks you through configuring HTTP load balancing for Suns Pet Store using three computers: One serving only as the web server and load balancer, and the other two serving as application-server nodes.
The file as configured in Mac OS X Server is shown in Figure 6-2.
Figure 5-2 The workers.properties file in /etc/httpd
13. Change line 2 to:
worker.list=loadbalancer
14. Change line 8 so that it references the first node. It should look similar to this:
worker.JBoss1.host=node1.mydomain.com
15. Change line 12 to:
worker.JBoss1.cachesize=10
16. Uncomment lines 26 through 28. 17. Change line 26 so that it looks like this:
worker.JBoss2.port=9007
18. Change line 27 so that it references the second node. It should look similar to this:
worker.JBoss2.host=node2.mydomain.com
19. Change line 31 to:
worker.JBoss2.cachesize=10
20. Add the following line to the file to enable sticky sessions:
worker.loadbalancer.sticky_session=1
21. Save the file.
Enable Load Balancing in the Application Servers
For load balancing to work, each application server has to report its existence to the web server. Follow these steps to configure the application-server so that they identify themselves to the web server: 1. Open the jboss-service.xml file, located at
/Library/JBoss/3.2/deploy-cluster/deploy/jbossweb-tomcat41.sar/META-INF, in a text
editor. For non-cluster deployment, open the jboss-service.xml file at
/Library/JBoss/3.2/deploy-standalone/deploy/jbossweb-tomcat41.sar/META-INF.
Look for the following line:
<Engine name="MainEngine" defaultHost="localhost">
Edit the line so that it looks like this:
<Engine jvmRoute="JBoss1" name="MainEngine" defaultHost="localhost">
Look for the following lines:
<!--Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="9007" minProcessors="5" maxProcessors="200" address="0.0.0.0" enableLookups="false" acceptCount="50" debug="0" connectionTimeout="20000" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/-->
5. 6. 7.
Remove the !-- at the beginning of the first line and the -- and end of the last line while making sure to leave the left angle bracket and the right angle bracket in place. Save the file. Repeat steps 1 through 6 for the second application server, but set jvmRoute to "JBoss2" in step 3.
Test the Configuration
Follow these steps to make sure that client requests are balanced among the application servers: 1. 2. Start the Web service in the web-server computer. Start the application server in each of the application-server computers and run the following commands on both:
$ cd /Library/JBoss/Logs $ tail -f localhost_access<today's_date_YYYY-MM-DD>.log
management tool HTML-based application through which an application-server configuration can be modified. It also allows for the viewing of statistics of resources and services deployed on application servers, starting and stopping services, and adding topics, queues, and data sources. Pet Store Pet Store is a sample J2EE application from Sun Microsystems, which showcases the power and flexibility of the J2EE platform. queue A queue is a JMS construct that allows for point-to-point messaging between applications. A message sent to a queue can be received by only one application. When several applications are subscribed to the queue, the messages are load balanced between the subscribers. server Computer running Mac OS X Server. topic Topics are one of the message distribution center types for J2EE-based applications. Message senders send messages only to topics instead of specific applications, while only the applications interested in receiving messages sent to a particular topic subscribe to the topic and, therefore, receive the messages sent to it. A topic can have one or more subscribers. Any message sent to the topic is broadcasted to all the topics subscribers.
G L O S S A R Y
Chapter 5
Administering Application Servers
Logging In to the Management Tool 47 Choosing a Task 51 Managing Application Servers 51 Configuring Application Servers 55 Monitoring Application Servers 56
Starting and Stopping Services 57 Creating a Data Source 58 Creating a Topic or a Queue 59 Deploying Applications 59
Chapter 6
Balancing User Load and Replicating Sessions
Distributable Applications 61 Load Balancing and Clustering 63 Enable Load Balancing in the Web Server 63 Enable Load Balancing in the Application Servers Test the Configuration 67
Appendix A
Document Revision History
Glossary
Figure 3-1 Figure 3-2 Figure 3-3 Figure 3-4 Figure 3-5 Figure 3-6
The Load Application window of the deployment tool The Loaded Application window 20 The deployment-tool main window 21 The Quick Config pane of a components configuration window 23 A module-settings window 24 The Save Application window of the deployment tool
Table 4-1
Relationship information for the Customer module
Figure 5-1 Figure 5-2 Figure 5-3 Figure 5-4 Figure 5-5 Figure 5-6 Figure 5-7
The Configuration window of the management tool 52 The JBoss Management Console window 52 The JBoss Management Console window showing the Security Configuration pane of the log-in configuration service 53 The JBoss Management Console window showing the Statistics pane of the Pet Store ShoppingCart enterprise bean 54 The JBoss Management Console window showing one of the configuration panes for the JMS Directory Service 56 The JBoss Management Console window showing the statistics of the Deploy Service 57 The JBoss Management Console window showing the Start or Stop Services pane 58
F I G U R E S
T A B L E S
Figure 6-1 Figure 6-2 The WebApp window of the petstore.ear archive The workers.properties file in /etc/httpd 65
Table A-1 Document revision history
C H A P T E R
JBoss is a powerful Java-based open-source application server that is very popular among Java 2, Enterprise Edition (J2EE) application developers. This document describes how to configure and use the JBoss application server in Mac OS X Server, which lets you deploy J2EE applications easily and reliably. This document is intended for system administrators, J2EE application assemblers, and developers. It assumes you have a solid background in system administration and J2EE technology. You must be familiar with Mac OS X Server, especially how to use Terminal to issue shell commands. Knowledge of database engines, such as MySQL, is helpful but not required. This document has the following chapters:
Application Server Overview (page 11) provides an overview of JBoss for Mac OS X Server. Configuring Applications (page 15) explains how to perform certain tasks with the deployment tool, such as opening, configuring, and saving application archives. Configuring and Deploying Suns Pet Store (page 27) walks you through configuring and deploying Suns Pet Store application in Mac OS X Server. Administering Application Servers (page 47) teaches you how to manage application servers, which are JBoss instances running on one or more computers. Balancing User Load and Replicating Sessions (page 61) explains how to enable an application to be distributable among cluster nodes and walks you through configuring HTTP load balancing for Pet Store using three computers.
JBoss in Mac OS X Server Apple Computer, Inc. January 22, 2004
Application Server Overview the database engine that meets your needs and not the one the developer used while developing the application. For details on the deployment tool, see Configuring Applications (page 15). The management tool lets you administer the local (running on the computer you are logged in to) application server, and monitor local and remote (running on a computer in the local network) application servers. As part of administering an application server, you may start and stop services, configure services, deploy applications, and add data sources, queues, and topics. When monitoring an application server, the management tool lets you access the statistics provided by the resources and services running on it. For example, a service may indicate its name, its purpose, and when it was started. For more information on the management tool, see Administering Application Servers (page 47).
Three Deployment Configurations
In Mac OS X Server, all the JBoss configurable settings are set up for maximum J2EE compliance. There are three standard deployment configurations in JBoss for Mac OS X Server:
The development configuration offers increased logging and also consults schema documents. As a result, an application is not deployed when the configuration files do not adhere to their respective schemas. The standalone configuration is set up for high performance on a single server. The cluster configuration is optimized for high performance on a cluster of servers. This includes load balancing as well as session replication among stateful session beans and HTTP sessions.
Three Deployment Congurations Apple Computer, Inc. January 22, 2004
Before you can deploy an application on an application server, you have to start the application server and then configure or assemble the application. This is the process through which you specify data sources, database mappings, JNDI resources, and so on. You configure J2EE applications by modifying XML files in META-INF and WEB-INF directories in application archives. Performing this task manually is tedious and error prone. The JBoss deployment tool allows you to configure applications without having to unarchive EAR files, WAR files, or JAR files, as the tool lets you configure these files directly. This chapter explains how to start the application server and configure and deploy your application.
Starting the Application Server
To configure an application using the deployment tool, you must connect to a running application server. Follow these steps to start the application server on a computer. 1. Launch Server Admin, located in /Applications/Server. 2. In the Computers & Services list, select Application Server.
Starting the Application Server Apple Computer, Inc. January 22, 2004
Conguring Applications
Figure 3-2 The Loaded Application window
2. Click Click here to continue to move on. The deployment tool displays the main window (also known as the navigation window). The main window presents a hierarchy of components generated from the XML files present in the META-INF and WEB-INF directories of the components contained in the archive you opened. For example, Figure 3-3 shows the components present in the petstore.ear file of Sun Microsystems Pet Store application. You must configure the items in red to save the application. Configuring Your Applications Components (page 22) shows you how to do this.
Figure 3-3 The deployment-tool main window
Figure 3-3 shows the components of the petstore.ear archive. The following list describes some of the items in the main window:
PetStoreEAR (Application) Represents the Pet Store enterprise-application archive. Application Settings Clicking this link allows you to configure settings that affect all the modules in the archive when the application is deployed.
AsyncSenderEJB (EJB) Represents the archive (JAR file) that contains the files that define the AsyncSender enterprise bean (the asyncsender-ejb.jar file). Clicking the Module Settings link lets you configure module-wide settings and set default values for some settings for all the enterprise beans defined in the module. See Configure the Customer Module (page 32) for an example. PetStoreWAR (WebApp) Represents the archive (WAR file) that contains the files that define the web module of the Pet Store enterprise application.
Configuring Your Applications Components
To configure a component, you choose it from the main window by clicking the appropriate link. This causes the deployment tool to display the configuration window for the component. As you can see in Figure 3-4, this is a tabbed window that contains one or more panes, which you use to configure specific aspects of the component. The configuration window also contains a Quick Config pane, which contains elements of the component that you must configure for the application to be deployable. Figure 3-4 shows the Quick Config pane of the CatalogEJB module. It indicates that the JBoss resource references must be configured. The JBoss resource references also appear in the JNDI Resource Refs pane. However, you need to configure them in only one of the two panes.
Figure 3-4 The Quick Config pane of a components configuration window
Note: For applications with many components, you may want to configure the Quick Config pages of the invalid components and save the application. Then you can configure each component further in a piecemeal fashion.
Some settings apply to an entire module, for example, security roles. In addition, some module settings serve as defaults for settings of individual components in the module. Figure 3-5 shows some of the module settings of the CustomerJAR module of the petstore.ear application. Configuring modules settings can help to speed up the configuration of a module. See Configure Module-Wide Settings (page 32) for an example.
Configure the Customer Module
The following sections guide you through the configuration of the Customer module.
Configure Module-Wide Settings
This section walks you through setting the data source and data-source mapping for the enterprise beans in the Customer module. It also details how to configure the relationships between some of the enterprise beans. 1. Under CustomerJAR (EJB), click Module Settings. 2. In the CustomerJAR window, click the CMP - Default Settings tab. 3. From the Datasource pop-up menu, choose MySQL 4.0.14 (java:/MySqlDS). 4. From the Datasource Mapping pop-up menu, choose mySQL, and click Update.
Conguring and Deploying Suns Pet Store 5. From the Entity Command Name pop-up menu, choose no-select-beforeinsert.
The advantage of configuring the database and the data-source mapping at the module level is that the settings apply to all the enterprise beans in the module. Therefore, you dont have to configure those settings for each enterprise bean in the module, unless they differ from the ones set for the module. 6. Click the CMP - PK Generation tab.
Conguring and Deploying Suns Pet Store 7. In the Unknown Pk Class text field, enter java.lang.Long. 8. In the Field Name text field, enter pk. 9. In the Column Name text field, enter pk. 10. Set Auto Increment to yes.
11. Click the CMP - Relationships tab. 12. Configure the relationships. Table 4-1 lists the relationship information for the customer module.
Relationship name
Role name
Column name
account_fk address_fk
CustomerEJB-AccountEJB Relationship
AccountEJB
ContactInfoEJB-AddressEJB Relationship AddressEJB
Table 4-1 Relationship information for the Customer module
profile_fk contactInfo_fk creditCard_fk
CustomerEJB-ProleEJB Relationship
ProleEJB
AccountEJB-ContactInfoEJB Relationship ContactInfoEJB AccountEJB-CreditCardEJB Relationship CreditCardEJB
Perform the following steps to configure each relationship listed in Table 4-1. a. In the Ejb Relations list, select the relationship to configure, and click Edit. b. In the Relationship Roles list, click the corresponding relationship role. c. Click New next to the Key Fields list. d. In the Field Name text field, enter pk. e. From the Column Name pop-up menu, choose the name of the appropriate column, and click Update. f. Click Update to finish configuring the relationship role. g. Click Update to finish configuring the relationship. 13. Click Update to finish configuring the Customer module settings, and close the window.
Configure the Account Enterprise Bean
1. Under CustomerJAR (EJB), click Enterprise Beans. Then click AccountEJB. 2. From the Table Name pop-up menu in the AccountEJB window, choose PS_Account. 3. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. 4. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. 5. Click Update to finish configuring the Account enterprise bean, and close the window.
Configure the Address Enterprise Bean
1. Under Enterprise Beans under CustomerJAR (EJB), click AddressEJB. 2. From the Table Name pop-up menu in the AddressEJB window, choose PS_Address. 3. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. 4. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. 5. Click Update to finish configuring the Address enterprise bean, and close the window.
Configure the ContactInfo Enterprise Bean
1. Under Enterprise Beans under CustomerJAR (EJB), click ContactInfoEJB. 2. From the Table Name pop-up menu in the ContactInfoEJB window, choose PS_ContactInfo. 3. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. 4. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. 5. Click Update to finish configuring the ContactInfo enterprise bean, and close the window.
Configure the CreditCard Enterprise Bean
1. Under Enterprise Beans under CustomerJAR (EJB), click CreditCardEJB. 2. From the Table Name pop-up menu in the CreditCardEJB window, choose PS_CreditCard. 3. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update.
Conguring and Deploying Suns Pet Store 4. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. 5. Click Update to finish configuring the CreditCard enterprise bean, and close the window.
Configure the Customer Enterprise Bean
1. Under Enterprise Beans under CustomerJAR (EJB), click CustomerEJB. 2. From the Table Name pop-up menu in the CustomerEJB window, choose PS_Customer. 3. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. 4. Click Update to finish configuring the Customer enterprise bean, and close the window.
Configure the Profile Enterprise Bean
1. Under Enterprise Beans under CustomerJAR (EJB), click ProfileEJB. 2. From the Table Name pop-up menu in the ProfileEJB window, choose PS_Profile. 3. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. 4. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. 5. Click Update to finish configuring the Profile enterprise bean, and close the window.
Save the Application
To save the configured PetStore application, click Save in the navigation window and choose a location for it: 1. Using the Finder or Terminal, create a directory under /Library named Configured_Apps. 2. In the main window, click Save. 3. In the text field in the Save Application window, enter /Library/ Configured_Apps/petstore.ear, and click Save Application. 4. Close the window.
Configure the Supplier Enterprise Application
The following sections guide you through configuring the Supplier enterprise application.
Congure the Supplier Enterprise Application Apple Computer, Inc. January 22, 2004
Open the supplier.ear file in the Deployment Tool
1. In the PetStoreEAR window, click Load. 2. In the text field in the Load Application window, enter the path to the supplier.ear file, and click Load Application or press Return. 3. In the navigation window, click Connect. 4. If the Connect to Server window indicates that youre not connected to the application server, click Connect to Server. 5. Close the Connect to Server window.
1. Under SupplierEAR (Application), click Application Settings. 2. In the SupplierEAR window, click the JBoss tab. 3. Set J2EE Compliant Class Loading to no, and click Update. 4. Close the window.
Configure the Supplier Module
The following sections explain how to configure the SupplierJAR module.
Configure the Module Settings
1. Under SupplierJAR (EJB), click Module Settings. 2. In the SupplierJAR window, click the CMP - Default Settings tab. 3. From the Datasource pop-up menu, choose MySQL 4.0.14 (java:/MySqlDS). 4. From the Datasource Mapping pop-up menu, choose mySql, and click Update. 5. Close the window.
Configure the Inventory Enterprise Bean
1. Under SupplierJAR (EJB), click Enterprise Beans. Then click InventoryEJB. 2. From the Table Name pop-up menu, choose SUPP_Inventory. 3. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. 4. Click Update to finish configuring the Inventory enterprise bean, and close the window.
Configure the OrderFulfillmentFacade Enterprise Bean
1. Under Enterprise Beans under SupplierJAR (EJB), click OrderFulfillmentFacade. 2. In the JBoss Resource Refs list in the OrderFulfillmentFacadeEJB window, select url/EntityCatalogURL, and click Edit. 3. In the Res URL text field, enter http://localhost:8080/opc/EntityCatalog.jsp, and click Update. 4. Click Update to finish configuring the OrderFulfillmentFacade enterprise bean, and close the window.
Configure the SupplierOrder Message-Driven Bean
1. Under Enterprise Beans under SupplierJAR (EJB), click SupplierOrderMDB. 2. In the JBoss Resource Refs list, select jms/QueueConnectionFactory, and click Edit. 3. From the Jndi Name pop-up menu, choose /ConnectionFactory, and click Update. 4. In the JBoss Resource Refs list, select jms/TopicConnectionFactory, and click Edit. 5. From the Jndi Name pop-up menu, choose /ConnectionFactory, and click Update. 6. In the JBoss Resource Env Refs list, select jms/opc/InvoiceTopic, and click Edit.
Conguring and Deploying Suns Pet Store 7. From the Jndi Name pop-up menu, choose /topic/opc/InvoiceTopic, and click Update. 8. Click Update to finish configuring the SupplierOrder message-driven bean, and close the window.
Configure the SupplierPurchaseOrder Module
These sections explain how to configure the SupplierPurchaseOrderJAR module.
1. Under SupplierPurchaseOrderJAR (EJB), click Module Settings. 2. In the SupplierPurchaseOrderJAR window, click the CMP - Default Settings tab. 3. From the Datasource pop-up menu, choose MySQL 4.0.14 (java:/MySqlDS). 4. From the Datasource mapping pop-up menu, choose mySql. 5. From the Entity Command Name pop-up menu, choose no-select-beforeinsert. 6. Click the CMP - PK Generation tab. 7. In the Unknown Pk Class text field, enter java.lang.Long. 8. In the Field Name text field, Enter pk. 9. In the Column Name text field, enter pk. 10. Set Auto Increment to yes, and click Update. 11. Close the window.
1. Under SupplierPurchaseOrderJAR (EJB), click Enterprise Beans. Then click AddressEJB. 2. From the Table Name pop-up menu in the AddressEJB window, choose PS_Address.
Conguring and Deploying Suns Pet Store 3. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. 4. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. 5. Click Update to finish configuring the Address enterprise bean, and close the AddressEJB window.
1. Under Enterprise Beans under SupplierPurchaseOrderJAR (EJB), click ContactInfoEJB. 2. From the Table Name pop-up menu in the ContactInfoEJB window, choose PS_ContactInfo. 3. Map the CMP fields to the appropriate column names by selecting the field in the Cmp Fields list, clicking Edit, choosing the corresponding column name from the Column Name list, and clicking Update. 4. Click the CMP - Mapping tab. From the Entity Command Name pop-up menu, choose mysql-get-generated-keys. 5. Click Update to finish configuring the ContactInfo enterprise bean, and close the window.
Deploy and Test the Application Apple Computer, Inc. January 22, 2004
Application-server management involves configuring the services available in an application server, turning services on and off, deploying applications, and monitoring application-server resources. This chapter teaches how to manage application servers, which are JBoss instances running on one or more computers.
Logging In to the Management Tool
Before you can log in to the management tool, the tool must be running. You can launch the management tool by executing the following command:
$ /Library/JBoss/Applications/JBossManagement.woa/JBossManagement
You log in to the management tool through your web browser. To connect to the management tool, enter the following URL into the Address text field in your web browser: https://localhost:40000.
Logging In to the Management Tool Apple Computer, Inc. January 22, 2004
Alternatively, you can click Manage JBoss in the Settings pane in the Server Admin window. To log in to the management tool you must enter the user name and password of an administrator of your computer or a user who is a member of the appserveradm group or the appserverusr group. There are two types of users with the authority to use the management tool: administrator users (which are members of the appserveradm group) and monitor users (which are members of the appserverusr group). The user defined while configuring Mac OS X Server for the first time is added to the appserveradm group. Note: The management tool allows only registered users to manage, configure, or monitor application servers. If you enter the name of a registered user in the Username text field but enter an incorrect password in the Password text field, you can only monitor the application server. Also, only members of appserveradm and appserverusr can launch the management tool. To authorize another user to manage application servers with the management tool, execute the following command in the command line, and restart your computer:
$ sudo /usr/bin/dscl. -create Groups/appserveradm GroupMembership <user_ID>
If you need to authorize a user to only monitor application servers with the management tool, execute the following command, and restart the computer:
$ sudo /usr/bin/dscl. -create Groups/appserverusr GroupMembership <user_ID>
You can also use NetInfo Manager to add users to the appserveradm and appserverusr groups: 1. Launch NetInfo Manager, located in /Applications/Utilities. 2. If the lock in the bottom-left corner of the window is locked, click it and authenticate yourself and the servers administrator. 3. In the / column, select groups. Then select the appropriate group in the groups column. 4. In the Properties list, select users and choose Directory > New Value. 5. Replace new_value with the appropriate user name.
6. Save the changes and restart your computer.
Choosing a Task
After logging in to the management tool, the Configuration window appears. This window lets you choose the kind of activity you want to perform with the management tool. There are three activities to choose from:
Managing: Allows you to start and stop services, configure services, observe resource statistics, create data sources, create topics or queues, and deploy applications. Configuring: Lets you start and stop services, create data sources, create topics or queues, and deploy applications. Monitoring: Allows you to observe resource statistics of application servers.
Managing Application Servers
To manage an application server, enter the JNDI port of the application server you want to manage (by default, 1099) in the Configuration window (shown in Figure 5-1), and click Manage localhost.
Choosing a Task Apple Computer, Inc. January 22, 2004
Figure 5-1 The Configuration window of the management tool
The left side of the JBoss Management Console window (shown in Figure 5-2) lists the application servers available and the resources they provide. You specify the resource you want to manage by clicking the triangle next to the appropriate resource type and selecting a resource from the list that appears.
Figure 5-2
The JBoss Management Console window
Managing Application Servers Apple Computer, Inc. January 22, 2004
Administering Application Servers For example, to change an application servers security configuration, click the triangle next to the Services resource group and select login-config.xml. After that, the Security Configuration pane (shown in Figure 5-3) appears on the right side of the window, showing the application policy list, which you can modify by clicking the appropriate buttons. However, any changes you make take effect only after you restart the application server.
Figure 5-3
The JBoss Management Console window showing the Security Configuration pane of the log-in configuration service
When youre managing the services deployed on the application server, you can also monitor the statistics of deployed applications and resources. For example, if you deploy Suns Pet Store in your application server, log in to the management
Monitoring Application Servers Apple Computer, Inc. January 22, 2004
Figure 5-6 The JBoss Management Console window showing the statistics of the Deploy Service
Starting and Stopping Services
You can start and stop services while managing or configuring application servers. To do so, in the application server list, select the application server you want to configure, and click Start/Stop Services in the Host Information pane. The Start or Stop Services pane is displayed in the right side of the JBoss Management Console window, as shown in Figure 5-7.
Starting and Stopping Services Apple Computer, Inc. January 22, 2004
Figure 5-7 The JBoss Management Console window showing the Start or Stop Services pane
Creating a Data Source
You can create a data source while managing or configuring application servers. To do so, select the application server you want to add the data source to in the server list. Next, enter the name of the data source in the Datasource Name text field in the Create a Datasource group in the Host Information pane, choose a data-source type from the Datasource Type pop-up menu, and click Create Datasource.
Creating a Data Source Apple Computer, Inc. January 22, 2004
Administering Application Servers Enter the appropriate information in the Local TX Datasource pane, and click Update. Note: Make sure to enter a unique JNDI name in the Jndi Name text field of the Local TX Datasource pane. The newly added data source appears under the Resources group in the application-server list.
Creating a Topic or a Queue
You can create a topic or a queue while managing or configuring an application server. Follow these steps to create a topic or a queue: 1. In the application server list, select the application server you want to add the topic or queue to. 2. From the Topic or Queue pop-up menu in the Create a Topic or Queue group in the Host Information pane, choose Topic or Queue. 3. In the Topic or Queue Name text field, enter the name of the topic or queue. 4. Enter the name of the file in which the topic or queue configuration is to be saved in the Filename text field.
Deploying Applications
You can deploy applications while managing or configuring application servers. Follow these steps to deploy an application: 1. Select the application server you want to deploy the application or service on in the application server list. 2. In the Select an application to deploy group in the Host Information pane, click Choose File, and choose the file to deploy.
Creating a Topic or a Queue Apple Computer, Inc. January 22, 2004
Administering Application Servers 3. Click Deploy Application.
Deploying Applications Apple Computer, Inc. January 22, 2004
HTTP load balancing provides a way to distribute user load among a group of application servers. The application servers can be standalone or configured as a cluster, in which case they are know as nodes. Load balancing is better used with sticky sessions. This means that once the load balancer (a web server) forwards a client request to a particular application server, it sends all further requests from the client to the same application server. Using load balancing across standalone application servers allows you to scale your deployment with little increase in request-processing overhead. However, when an application server fails, other application servers cannot pick up the failed-servers load, which may provide an undesirable user experience: Users may have to log in to the application again or may lose the contents of their shopping carts. Load balancing across clustered application servers (or nodes) provides session replication among the nodes, so that when a node fails, another node can take over its duties with little or no user impact. However, as you add nodes to the cluster, each request may take longer to process. This chapter explains how to enable an application to be distributable among cluster nodes and walks you through configuring HTTP load balancing for Suns Pet Store using three computers: One serving only as the web server and load balancer, and the other two serving as application-server nodes.
16. Uncomment lines 26 through 28. 17. Change line 26 so that it looks like this:
worker.JBoss2.port=9007
18. Change line 27 so that it references the second node. It should look similar to this:
worker.JBoss2.host=node2.mydomain.com
19. Change line 31 to:
worker.JBoss2.cachesize=10
20. Add the following line to the file to enable sticky sessions:
worker.loadbalancer.sticky_session=1
21. Save the file.
Enable Load Balancing in the Application Servers
For load balancing to work, each application server has to report its existence to the web server. Follow these steps to configure the application-server so that they identify themselves to the web server: 1. Open the jboss-service.xml file, located at /Library/JBoss/3.2/deploycluster/deploy/jbossweb-tomcat41.sar/META-INF, in a text editor. For non-cluster deployment, open the jboss-service.xml file at /Library/JBoss/ 3.2/deploy-standalone/deploy/jbossweb-tomcat41.sar/META-INF. 2. Look for the following line:
<Engine name="MainEngine" defaultHost="localhost">
3. Edit the line so that it looks like this:
<Engine jvmRoute="JBoss1" name="MainEngine" defaultHost="localhost">
4. Look for the following lines:
<!--Connector className="org.apache.coyote.tomcat4.CoyoteConnector" port="9007" minProcessors="5" maxProcessors="200" address="0.0.0.0" enableLookups="false" acceptCount="50" debug="0" connectionTimeout="20000" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/-->
5. Remove the !-- at the beginning of the first line and the -- and end of the last line while making sure to leave the left angle bracket and the right angle bracket in place. 6. Save the file. 7. Repeat steps 1 through 6 for the second application server, but set jvmRoute to "JBoss2" in step 3.
Test the Configuration
Follow these steps to make sure that client requests are balanced among the application servers: 1. Start the Web service in the web-server computer. 2. Start the application server in each of the application-server computers and run the following commands on both:
$ cd /Library/JBoss/Logs $ tail -f localhost_access<todays_date_YYYY-MM-DD>.log
3. In the web-server computer, connect to http://<host_name>/petstore/ index.jsp. The first node should show a log entry similar to this:
17.203.255.255 - - [26/Sep/2003:15:56:58 -0800] "GET /petstore/index.jsp HTTP/1.1" 200 2769
ContactInfoEJB 43 InventoryEJB 41 LineItemEJB 43 OrderFulllmentFacade 41 SupplierEAR 40 SupplierJAR 40 SupplierOrderEJB 44 SupplierOrderMDB 41 SupplierPurchaseOrderJAR 42 SupplierWAR 44
Tomcat 12 topics, creating 59
WAR les 11 watchdog process 12 WEB-INF directory 11, 15, 20 workers.properties le 64
Tags
DGS3100 Client Rifle Plus 200 Pupillo CO606 MD 2998 5095MH UN22C4000PD Review Ryobi P110 WF-T8500TP JVM410H Head C 10 Research WM1 Franklincovey-plan Plus FS-1118MFP S-W150S Hasbro Clue WD9541 XL200 Alivesata2-glan Abit BG7 Behringer B212 QC5000 00 Media 200 AF360FGZ MF3110 WD-11401TB 64840 SH52TH-W RM200B Forerunner 405 Stylus D78 Pack SW AT-150 M45-S2693 Photosmart 315 Acoustics GT40 AMW 540 AML 125 Dvdr3380-31 AWF1373 Controller 26LG3000 BS 250 Lrsc26915SW Motorokr Z6 Ry30120 DRC-400 HD-56ZR7U Janome 204D MC-E781 PET730 HF3475 Impressa X7 6I-8I EC-01 GCC-4520B Handheld LAC-M1500R CLX-3160 C3300 D A60-S166 CCD-TRV58E Prev1 75 A LBT-G1 HS650 Keypad Storageworks SAN Force NN-E251W NS-70 MHC-RX55 HDC-SD9P Makita 4328 Nokia N800 5000I COM800 3 3 CY-PA2003N MF350 LN32C530 Mesuper ASR08T NR100 SRW-5500 GI100 Sbctt650 RCR311B HR4001C HDC-504 PJ501 Aekmqpn MC-3920 NN-SD768B VBP3000 RC-50 Dispatch SGH-E330
manuel d'instructions, Guide de l'utilisateur | Manual de instrucciones, Instrucciones de uso | Bedienungsanleitung, Bedienungsanleitung | Manual de Instruções, guia do usuário | инструкция | návod na použitie, Užívateľská príručka, návod k použití | bruksanvisningen | instrukcja, podręcznik użytkownika | kullanım kılavuzu, Kullanım | kézikönyv, használati útmutató | manuale di istruzioni, istruzioni d'uso | handleiding, gebruikershandleiding
Sitemap
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101



