JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide HT T P load-balancing for JBoss Enterprise Application Platform Edition 5.2.0 Jared Morgan Lead Writer and Content Architect Red Hat, Inc. Engineering Content Services jmorgan@redhat.com Joshua Wulf Red Hat, Inc. Engineering Content Services jwulf@redhat.com Laura Bailey Red Hat, Inc. Engineering Content Services lbailey@redhat.
Legal Notice Legal Notice Copyright © 2012 Red Hat, Inc. T he text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Abstract Read this guide to install and configure the supported HT T P connectors for use with JBoss Enterprise Application Platform and JBoss Enterprise Web Server. T his guide covers the Apache T omcat Connector (mod_jk), JBoss HT T P Connector (mod_cluster), Internet Server API (ISAPI) and Netscape Server API (NSAPI), and discusses clustering and load-balancing with regard to each.
Table of Contents Table of Contents Preface 1. File Name Conventions 2. Document Conventions 2.1. T ypographic Conventions 2.2. Pull-quote Conventions 2.3. Notes and Warnings 3. Getting Help and Giving Feedback 3.1. Do You Need Help? 3.2. Give us Feedback I. Apache T omcat Connector (mod_jk) 1. Overview 2. Download and install 3. Configure load balancing using Apache and mod_jk 3.1. Configure worker nodes in mod_jk 3.2. Configuring JBoss to work with mod_jk 4. T roubleshooting and optimizing mod_jk 4.1.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide 14.1. Prerequisites and configuration assumptions 14.2. Configure server instance as a worker node 14.3. Microsoft IIS 6 initial clustering configuration 14.4. Microsoft IIS 7 initial clustering configuration 14.5. Configure a basic cluster with ISAPI 14.6. Configure a load-balancing cluster with ISAPI IV. Netscape Server API (NSAPI) 15. What is Netscape Server API? 16. Configuring the NSAPI connector on Solaris 16.1.
Preface Preface 1. File Name Conventions T he following naming conventions are used in file paths for readability. Each convention is styled so that it stands out from the rest of text: JBOSS_EAP_DIST T he installation root of the JBoss Enterprise Application Platform instance. T his folder contains the main folders that comprise the server such as /jboss-as, /seam, and /resteasy. JBOSS_EWP_DIST T he installation root of the JBoss Enterprise Web Platform instance.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide all distinguishable thanks to context. Key combinations can be distinguished from keycaps by the plus sign that connects each part of a key combination. For example: Press Enter to execute the command. Press Ctrl+Alt+F2 to switch to a virtual terminal. T he first paragraph highlights the particular keycap to press. T he second highlights two key combinations (each a set of three keycaps with each set pressed simultaneously).
Preface package org.jboss.book.jca.ex1; import javax.naming.InitialContext; public class ExClient { public static void main(String args[]) throws Exception { InitialContext iniCtx = new InitialContext(); Object ref = iniCtx.lookup("EchoBean"); EchoHome home = (EchoHome) ref; Echo echo = home.create(); System.out.println("Created Echo"); System.out.println("Echo.echo('Hello') = " + echo.echo("Hello")); } } 2.3.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Document URL: Section Number and Name: Describe the issue: Suggestions for improvement: Additional information: Be sure to give us your name so that you can receive full credit for reporting the issue.
Part I. Apache Tomcat Connector (mod_jk) Part I.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Chapter 1. Overview Apache HT T P server ("Apache") is a well-known web server which can be extended using plug-ins. T he Apache T omcat Connector mod_jk is a plug-in designed to allow request forwarding from Apache to a servlet container. T he module also supports load-balancing HT T P calls to a set of servlet containers while maintaining sticky sessions.
Chapter 2. D ownload and install Chapter 2. Download and install Apache httpd is included in the JBoss Enterprise Web Server binary you download from https://access.redhat.com. mod_jk is included in the native installation binaries for JBoss Enterprise Application Platform and JBoss Enterprise Web Server. Follow the procedures in the JBoss Enterprise Application Platform or JBoss Enterprise Web Server Installation Guide to download and install the correct platform and native binaries.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Chapter 3. Configure load balancing using Apache and mod_jk Follow the tasks in this chapter to correctly configure load balancing using Apache and the mod_jk connector. T ask: Configure Apache to Load mod_jk Complete this task to configure Apache to load mod_jk. Prerequisites Apache and mod_jk installed (Refer to Chapter 2, Download and install). 1. Open HTTPD_DIST/conf/httpd.
Chapter 3. Configure load balancing using Apache and mod_jk # Simple worker configuration file # Mount the Servlet context to the ajp13 worker /jmx-console=loadbalancer /jmx-console/*=loadbalancer /web-console=loadbalancer /web-console/*=loadbalancer d. In HTTPD_DIST/conf/mod-jk.conf, append the following directive. # You can use external file for mount points. # It will be checked for updates each 60 seconds.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide 3. Specify the node name by appending the jvmRoute attribute to the element in server.xml. T he jvmRoute attribute value is the node name defined in HTTPD_DIST/conf/workers.properties. PAGE 16Chapter 4. Troubleshooting and optimizing mod_jk Chapter 4. Troubleshooting and optimizing mod_jk While optimizing the configuration in Apache, mod_jk, mod_proxy, mod_cluster and JBoss typically resolves any and all problems and errors in load balancing, there are exceptions (such as long running servlets that require additional optimization). In most cases, a correctly tuned configuration is the catch all for mod_jk issues.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Common Errors "cping/cpong" Errors Presents with errors like the following: [info] ajp_handle_cping_cpong::jk_ajp_common.c (865): timeout in reply cpong ... [error] ajp_connect_to_endpoint::jk_ajp_common.c (957): (nodeA) cping/cpong after connecting to the backend server failed (errno=110) [error] ajp_send_request::jk_ajp_common.c (1507): (nodeA) connecting to backend failed.
Chapter 4. Troubleshooting and optimizing mod_jk If this does not resolve the issue, proceed to Step 2 b. Confirm that there is no firewall blocking or dropping the AJP connections. General Performance Issues Presents with errors like the following: ERROR [org.apache.coyote.ajp.AjpMessage] (ajp-192.168.0.101-8001-13) Invalid message received with signature 12336 T he above exception when using mod_jk in JBoss Web typically indicates a non AJP request sent to the AJP connector.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide b. For Windows, the options need to be added to run.bat, as it does not read run.conf. c. Check boot.log to see the value of the user.dir environment variable (e.g. /bin), the default location for garbage collection logging when no path is provided. If you are running multiple instances of JBoss against the same directory like so: ./run.sh -c node1 -b 127.0.0.1 -Djboss.messaging.ServerPeerID=1 ./run.sh -c node2 -b 127.
Chapter 4. Troubleshooting and optimizing mod_jk https://access.redhat.com/knowledge/node/19932. 5. If Garbage collection is not responsible for the high CPU, use the thread dump information gathered when validating CPU information to identify the threads. One area that is not a direct consequence of an unoptimized mod_jk configuration but can still cause issues with mod_jk is JVM and garbage collection related problems.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Part II.
Chapter 5. Overview Chapter 5. Overview T he JBoss HT T P Connector mod_cluster is a reduced-configuration, intelligent load-balancing solution for JBoss Enterprise Application Platform, based on technology originally developed by the JBoss mod_cluster community project. T he JBoss HT T P connector load-balances HT T P requests to JBoss Enterprise Application Platform and JBoss Enterprise Web Server worker nodes, using Apache as the proxy server. 5.1.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide T he Proxy Advertisement module, mod_advertise.so, broadcasts the existence of the proxy server via UDP multicast messages. T he server advertisement messages contain the IP address and port number on which the proxy is listening for responses from nodes that wish to join the load-balancing cluster. Note Refer to Section 6.
Chapter 6. Install proxy server components Chapter 6. Install proxy server components Read this chapter to install the JBoss HT T P Connector, mod_cluster, on a JBoss Enterprise Web Server proxy server. 6.1. Apache modules Read this section for expanded definitions of the Apache proxy server modules discussed in Section 5.2, “Components”. You specify these modules as part of T ask: Install Proxy Server Components. 6.1.1. mod_manager.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide SetHandler mod_cluster-manager Order deny,allow Deny from all Allow from 127.0.0.1 When accessing the $LOCATION defined in the Location element in your browser, you will see something like the following. (In this case, $LOCATION was also defined as mod_clusterhandler.) Figure 6.1. mod_cluster Status Transferred corresponds to the POST data sent to the worker node.
Chapter 6. Install proxy server components 1 Verify that the defined alias corresponds to a worker node's server name. LBstatusRecalT ime Defines the interval in seconds between the proxy calculating the status of a worker node. T he default interval is 5 seconds. ProxyPassMatch; ProxyPass ProxyPass maps remote servers into the local server namespace. If the local server has an address http://local.com/, then the following ProxyPass directive would convert a local request for http://local.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide AdvertiseManagerUrl Defines the URL that the worker node should use to send information to the proxy server. By default this directive is not set and no information is sent. AdvertiseBindAddress Defines the address and port over which to send multicast messages. T he syntax is AdvertiseBindAddress address:port. T his allows an address to be specified on machines with multiple IP addresses. T he default value is 0.0.0.0:23364. 6.2.
Chapter 7. Configure basic proxy server Chapter 7. Configure basic proxy server Follow the instructions in this chapter to configure JBoss Enterprise Web Server to use the JBoss HT T P Connector (mod_cluster). 7.1. Basic proxy configuration overview Configuration of the proxy server consists of one mandatory and one optional portion: 1. Configure a proxy server listener to receive worker node connection requests and worker node feedback. 2. Optional: Disable server advertisement.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Order deny,allow Deny from all Allow from PARTIAL_IP_ADDRESS KeepAliveTimeout 60 MaxKeepAliveRequests 0 ManagerBalancerName mycluster AdvertiseFrequency 5 IP_ADDRESS and PORT_NUMBER match the values from the Listen directive. PARTIAL_IP_ADDRESS is the first 1 to 3 bytes of an IP address, to restrict access to a specific subnet - 10.33.144, for example. 3.
Chapter 8. Install node with basic configuration Chapter 8. Install node with basic configuration Read this chapter to install the JBoss HT T P Connector on a worker node, and implement basic configuration for the node to begin immediate operation. 8.1. Worker node requirements Supported Worker Node types JBoss Enterprise Platform 5 JBoss Web component JBoss Enterprise Web Server T omcat service Note JBoss Enterprise Platform worker nodes support all JBoss HT T P Connector functionality.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide 4. Give the worker a unique identity Edit JBOSS_EAP_DIST/jboss-as/server/PROFILE/deploy/jbossweb.sar/server.xml and add a jvmRoute attribute and value to the Engine element, as shown: Use a unique jvmRoute value for each node. 5.
Chapter 8. Install node with basic configuration A proxy server using the JBoss HT T P Connector can advertise itself via UDP multicast. T o receive these multicast messages, open port 23364 for UDP connections on the worker node's firewall.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Chapter 9. Advanced configuration Read this chapter to configure advanced features of the JBoss HT T P Connector. 9.1. Static proxy configuration Server advertisement allows worker nodes to dynamically discover and register themselves with proxy servers. If UDP broadcast is not available or server advertisement is disabled then worker nodes must be configured with a static list of proxy server addresses and ports.
Chapter 9. Advanced configuration configuration for directions. Understand the Proxy Configuration parameters discussed in Appendix B, Reference: Java properties 1. Disable dynamic proxy discovery Edit JBOSS_EWS_DIST/tomcat6/conf/server.xml. and set the advertise property of the ModClusterListener to false: 2. Define a mod_cluster listener Add a element to server.xml. PAGE 35JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Chapter 10. Java Properties 10.1. Configuration Properties T he tables below enumerate the configuration properties available to an application server node. T he location for these properties depends on how mod_cluster is configured. 10.1.1.
Chapter 10. Java Properties T able 10.2. Proxy Configuration Attribute Default Description stickySession true Indicates whether subsequent requests for a given session should, if possible, be routed to the same node. stickySessionRemove false Indicates whether the httpd proxy should remove session stickiness in the event that the balancer is unable to route a request to the node to which it is stuck. T his property is ignored if stickySession is false.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide among jvmRoutes with the same domain. T his is primarily used in conjunction with partitioned session replication (e.g. buddy replication). Note: When nodeT imeout is not defined the ProxyT imeout directive Proxy is used. If ProxyT imeout is not defined the server timeout (T imeout) is used (default 300 seconds). nodeT imeout, ProxyT imeout or T imeout is set at the socket level. 10.1.3.
Chapter 10. Java Properties T able 10.3. SSL Configuration Attribute Default Description ssl false Should connection to proxy use a secure socket layer. sslCiphers T he default JSSE cipher suites Overrides the cipher suites used to init an SSL socket ignoring any unsupported ciphers. sslProtocol TLS Overrides the default SSL socket protocol. sslCertificateEncodingAlgorithm T he default JSSE key manager algorithm. T he algorithm of the key manager factory. sslKeyStore System.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide 39 store type. System.getProperty("javax.net.ssl.trustStoreProvider") T he trust store provider. sslTrustStoreProvider 10.1.4. HA Configuration Additional configuration properties when mod_cluster is configured in clustered mode. T able 10.4. HA Configuration Attribute Default Description masterPerDomain false If the domain directive is used, should HA partition use a singleton master per domain. 10.1.5.
Chapter 11. Load Metrics Chapter 11. Load Metrics 11.1. Server-Side Load Metrics A major feature of mod_cluster is the ability to use server-side load metrics to determine how best to balance requests. T he DynamicLoadBalanceFactorProvider bean computes the load balance factor of a node from a defined set of load metrics. @org.jboss.aop.microcontainer.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web :service=ActiveSessionsLoadMetric",exposedInterface=org.jboss.modcluster.lo ad.metric.LoadMetricMBean.
Chapter 11. Load Metrics @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web :service=SendTrafficLoadMetric",exposedInterface=org.jboss.modcluster.load. metric.LoadMetricMBean.class) PAGE 43JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss.web :service=HeapMemoryUsageLoadMetric",exposedInterface=org.jboss.modcluster.l oad.metric.LoadMetricMBean.class) 11.4. Other metrics 1.
Chapter 12. Load balancing demonstration Chapter 12. Load balancing demonstration T he JBoss HT T P Connector includes a load balancing demonstration to show how different server-side scenarios affect the client request routing performed by the load balancing proxy server. T he required configuration is located in the JBOSS_EAP_DIST/mod_cluster/demo directory. T he application consists of two primary components: /server/load-demo.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide service-name Catalina 4. Deploy Demo Web Archive to Worker Node Copy load-demo.war from JBOSS-EAP_DIST/mod_cluster/demo/server into one of the following directories: For JBoss Enterprise Web Server: JBOSS_EWS_DIST/tomcat6/webapps For JBoss Enterprise Application Platform: JBOSS_EAP_DIST/jboss-as/server/PROFILE/deploy 5.
Chapter 12. Load balancing demonstration Session Life Number of seconds a client thread should use a session before invalidating or abandoning it. T his should be a small value, or session stickiness can prevent changes in server load from affecting the proxy server's routing decisions. When sticky sessions are enabled (strongly recommended), the creation of new sessions allows the proxy to balance the workload.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide in something other than a HT T P 200 response. T his section shows you how to configure and start using the demo. T ask: Interact with the Demonstration Complete this task to test the effects of changing load-balancing parameters. Prerequisites Complete T ask: Start the Demo. Complete T ask: Configure Client Control T ab Fields. 1. Click on the Request Balancing tab to see how many requests are going to each of the worker nodes.
Chapter 12. Load balancing demonstration per second for a set time. Server Send T raffic Generates server traffic send load by making a request once per second, to which the server responds with a large byte array. Request Count Generates server load by making numerous requests, increasing the request count on the target server. Params Z ero or more parameters to pass to the specified load creation servlet, for example, Number of Connections and Duration, as seen in the screenshot.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Part III.
Chapter 13. Overview Chapter 13. Overview Read this chapter for a brief introduction about the Internet Server Application Programming Interface (ISAPI). 13.1. What is Internet Server API Internet Server Application Programming Interface (ISAPI) is a multi-tier application programming interface for Microsoft Internet Information Services (IIS) web servers, and other compatible third-party web servers.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Chapter 14. Configuring the ISAPI connector on Windows Read this chapter to learn how to configure the ISAPI connector to use JBoss Enterprise Application Platform as a worker node for a Windows Server 2003 or 2008 master node. 14.1.
Chapter 14. Configuring the ISAPI connector on Windows Start → Run , then type inetmgr . Start → Control Panel → Administrative T ools → Internet Information Services (IIS) Manager T he IIS 6 Manager window opens. 2. In the tree view pane, expand Web Sites 3. Right click on Default Web Site, and then click Properties T he Properties window opens. 4. Click the ISAPI Filters tab. 5.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide 4. Confirm the jboss Web Service Extension displays in the list. 14.4. Microsoft IIS 7 initial clustering configuration Microsoft IIS 7 can be managed using the Management Console, or through the command prompt using the APPCMD.EXE command tool. T erms ISAPI and CGI Restrictions ISAPI and CGI restrictions are request handlers that allow dynamic content to execute on a server. T hese restrictions are either CGI files (.
Chapter 14. Configuring the ISAPI connector on Windows 2. Double-click ISAPI Filters. T he ISAPI Filters Features View opens. 3. In the Actions pane, click Add. T he Add ISAPI Filter window opens. 4. Specify the following values in the Add ISAPI Filter window: Filter name: Specify jboss (exactly as written) Executable: Specify C:\connectors\jboss-ep-5.1\native\sbin\isapi_redirect.dll 5. Click OK to save the values and close the Add ISAPI Filters window.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide # Configuration file for the ISAPI Redirector # Extension uri definition extension_uri=/jboss/isapi_redirect.dll # Full path to the log file for the ISAPI Redirector log_file=c:\connectors\isapi_redirect.log # Log level (debug, info, warn, error or trace) # Use debug only testing phase, for production switch to info log_level=debug # Full path to the workers.properties file worker_file=c:\connectors\workers.
Chapter 14. Configuring the ISAPI connector on Windows C:\> net stop iisadmin /Y C:\> net start w3svc IIS 7 C:\> net stop was /Y C:\> net start w3svc 6. Verify the Logs Ensure you check the ISAPI logs once IIS has restarted. T he logs are saved to the file location specified in the log_file property in isapi_redirect.properties. You should also check IIS logs and the Event Viewer for other events of type Warning or Error. 14.6.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide 3. Create uriworkermap.properties file T he uriworkermap.properties file contains deployed application mapping configuration information. Append the following lines to the file. # images, css files, path /status and /web-console will provided by nodes defined in load-balancer /css/*=router /images/*=router /status=router /web-console|/*=router # Example of exclusion from mapping, logo.
Chapter 14. Configuring the ISAPI connector on Windows 6. Verify the Logs Ensure you check the ISAPI logs once IIS has restarted. T he logs are saved to the file location specified in the log_file property in isapi_redirect.properties. You should also check IIS logs and the Event Viewer for other events of type Warning or Error.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Part IV.
Chapter 15. What is Netscape Server API? Chapter 15. What is Netscape Server API? Read this chapter to gain a basic understanding of the Netscape Server API (NSAPI). NSAPI is a programming interface that allows developers to extend the functionality of web server software by creating applications (referred to as plug-ins) that run inside the server process itself.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Chapter 16. Configuring the NSAPI connector on Solaris T he following tasks describe how to configure the NSAPI connector to use a JBoss Enterprise Platform as a worker node for a Sun Java System Web Server (SJWS) master node. Sun Java System Web Server has been renamed to the Oracle iPlanet Web Server. T he old name is used throughout this guide for clarity. In this section, all of the server instances are on the same machine.
Chapter 16. Configuring the NSAPI connector on Solaris a different IP address with the -b switch. [user@workstation jboss-eap-5.1]$ ./jboss-as/bin/run.sh -b 127.0.0.1 -c default-01 [user@workstation jboss-eap-5.1]$ ./jboss-as/bin/run.sh -b 127.0.0.100 -c default-02 16.3. Initial clustering configuration T ask: Configure Required Elements Complete this task to configure the basic elements required for clustering using Sun Java Web Server (SJWS) and NSAPI.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide 16.4. Configure a basic cluster with NSAPI T ask: Configure a Basic Cluster with NSAPI Complete this task to configure a basic cluster, where requests for particular paths are forwarded to particular worker nodes. T he procedure specifies that worker02 serves the /nc path, while worker01 serves /status and all other paths defined in the first part of the obj.conf file.
Chapter 16. Configuring the NSAPI connector on Solaris 16.5. Configure a load-balanced cluster with NSAPI T ask: Configure a Load-balanced Cluster with NSAPI Complete this task to configure a load-balanced cluster consisting of two worker nodes. Prerequisites T ask: Configure Required Elements SJWS is installed in one of the locations specified in the SJWS file path abbreviation in Section 1, “File Name Conventions”. 1. Define the paths to serve via NSAPI Open SJWS/PROFILE/config/obj.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide # The advanced router LB worker worker.list=router,status #First EAP server definition, port 8009 is standard port for AJP in EAP # #lbfactor defines how much the worker will be used. #The higher the number, the more requests are served #lbfactor is useful when one machine is more powerful #ping_mode=A – all possible probes will be used to determine that #connections are still working worker.worker01.port=8009 worker.worker01.
Part V. Common load balancing tasks Part V.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Chapter 17. HTTP session state replication HT T P session state replication is a means of distributing clients' state across multiple servers. T he following terms are important in understanding load balancing. Software Load Balancer A dedicated software-based service designed to distribute HT T P client session requests across multiple computer servers (cluster).
Chapter 17. HTTP session state replication PAGE 69
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide example,. mod_jk, mod_proxy, mod_cluster) is being used for load balancing for this web application. If set to true, the container will examine the session ID associated with every request and replace the jvmRoute portion of the session ID if it detects a failover. You need only set this to false for web applications whose URL cannot be handled by the JK load balancer.
Chapter 17. HTTP session state replication from clustered web applications where the web.xml file includes the distributable directive. Passivation occurs at three points during the life cycle of a web application: When the container requests the creation of a new session. If the number of currently active sessions exceeds a configurable limit, an attempt is made to passivate sessions to make room in memory. Periodically (by default every ten seconds) as the JBoss Web background task thread runs.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Guide T he name of the JBoss Cache configuration to use is controlled by the cacheName element in the application's jboss-web.xml (see Section 17.1, “Enabling session replication in your application”). In most cases this does not need to be set because the default value of standard-session-cache is appropriate. T he JBoss Cache configurations in the CacheManager service expose a number of options.
Chapter 18. High-Availability Web Sessions Chapter 18. High-Availability Web Sessions JBoss Enterprise Application Server allows you to make web sessions highly available by storing them in a database table. Session Replication Preferred HT T P session replication with JBoss Cache is the preferred approach to securing web session failover. It is strongly recommended to use this approach if possible (refer to Chapter 17, HTTP session state replication).
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide : Note T he className and dataSourceJndiName are compulsory attributes. You can also define further Context and Manager attributes (refer to Section 18.1, “DataSourcePersistentManager Configuration Attributes”.
Chapter 18. High-Availability Web Sessions connectionPassword password to pass to DataSource.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide replicationT riggerString activity executed during a request that makes the session database persistent (the activity with the replication-trigger property SET ) maxUnreplicatedInterval maximum interval between requests, in seconds, after which the session's timestamp is persisted regardless of whether the request caused the session to become dirty in any other way useJK flag determining whether the container assumes a JK-based so
Chapter 19. Using clustered Single Sign-on (SSO) Chapter 19. Using clustered Single Sign-on (SSO) JBoss supports clustered single sign-on (SSO), allowing a user to authenticate to one web application and to be recognized on all web applications that are deployed on the same virtual host, whether or not they are deployed on that same machine or on another node in the cluster. Authentication replication is handled by JBoss Cache.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide applications will be invalidated. A session timeout does not invalidate the SSO if other sessions are still valid. 19.3. Limitations T here are a number of known limitations to this T omcat valve-based SSO implementation: Only useful within a cluster of JBoss servers; SSO does not propagate to other resources. Requires use of container managed authentication (via login-config element in web.xml) Requires cookies.
Chapter 20. Complete working example Chapter 20. Complete working example Following are a set of example configuration files for a complete working example. Proxy Server A proxy server listening on localhost: LoadModule LoadModule LoadModule LoadModule slotmem_module modules/mod_slotmem.so manager_module modules/mod_manager.so proxy_cluster_module modules/mod_proxy_cluster.so advertise_module modules/mod_advertise.so Listen 127.0.0.1:6666
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide 79
Reference: workers.properties Reference: workers.properties Apache httpd Server worker nodes are Servlet containers that are mapped to the mod_jk load balancer. T he worker nodes are defined in HTTPD_DIST/conf/workers.properties. T his file specifies where the different Servlet containers are located, and how calls should be load-balanced across them. T he workers.properties file contains two sections: Global Properties T his section contains directives that apply to all workers.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide You can specify the port directive as part of the host directive by appending the port number after the hostname or IP address. For example: worker.node1.host=192.168.2.1:8009 or worker.node1.host=node1.example.com:8009 port T he port number of the remote server instance listening for defined protocol requests. T he default value is 8009, which is the default listen port for AJP13 workers.
Reference: workers.properties Specifies whether requests for workers with SESSION IDs are routed back to the same worker. T he default is 0 (false). When set to 1 (true), load balancer persistence is enabled. For example, if you specify worker.loadbalancer.sticky_session=0, each request is load balanced between each node in the cluster. In other words, different requests for the same session will go to different servers based on server load. If worker.loadbalancer.
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Reference: Java properties Read this appendix to learn about the JBoss HT T P Connector (mod_cluster) configuration properties that apply to either a JBoss Enterprise Application Platform or JBoss Enterprise Application Platform server node. B.1.
Reference: Java properties returning an error. mod_cluster always uses a CPing/CPong before forwarding a request. T he connectiontimeout value used by mod_cluster is the ping value. Default is -1. balancer Specifies the name of the load-balancer. Default is mycluster. domain Optional parameter, which specifies how load is balanced across jvmRoutes within the same domain. domain is used in conjunction with partitioned session replication (for example, buddy replication).
JBoss Enterprise Application Platform 5 HTTP Connectors Load Balancing Guide Revision history Revision 5.2.0-15 Bump to have book re-Brewed 18 Sep 2012 Russell Dickenson Revision 5.2.0-14 Mon Jul 9 2012 Scott Mumford JBPAPP-9297: Added "T roubleshooting and optimizing mod_jk" Chapter. Revision 5.2.0-13 T ue 26 Jun 2012 Incorporated changes for JBPAPP-4673 and JBPAPP-3961 Eva Kopalová Revision 5.2.0-11 Fri May 18 2012 JBPAPP-4255:Updated iptable text. Scott Mumford Revision 5.2.