![]() |
JBoss 4.0
When JBoss is started, three different configurations can be specified: default, all, or minimal. The minimal configuration is not sufficient for Asynchronous HTTP Server deployments, as it does not include JMS. The default configuration can be used in single node deployments, but the all configuration is required for clustered deployments. Table 2-1 below contains the location of the directory containing the jbossmq-destinations-service.xml file for each valid JBoss configuration.
Table 2-2 JBoss Configuration Files
Configuration Directory default [jboss-install-dir]/server/default/deploy/jms/ all [jboss-install-dir]/server/all/deploy-hasingleton/jms/Note: All information on JBoss 4.0 in this section is based on the compressed archive (zip or gz) and not the JBoss installer application.
To configure the JMS topics, add the following code to the selected jbossmq-destinations-service.xml file:
<mbean code="org.jboss.mq.server.jmx.Topic" name="jboss.mq.destination:service=Topic,name=icefaces.contextEventTopic"> <depends optional-attribute-name="DestinationManager"> jboss.mq:service=DestinationManager </depends> <depends optional-attribute-name="SecurityManager"> jboss.mq:service=SecurityManager </depends> <attribute name="SecurityConf"> <security> <role name="guest" read="true" write="true" create="true"/> </security> </attribute> </mbean> <mbean code="org.jboss.mq.server.jmx.Topic" name="jboss.mq.destination:service=Topic,name=icefaces.responseTopic"> <depends optional-attribute-name="DestinationManager"> jboss.mq:service=DestinationManager </depends> <depends optional-attribute-name="SecurityManager"> jboss.mq:service=SecurityManager </depends> <attribute name="SecurityConf"> <security> <role name="guest" read="true" write="true" create="true"/> </security> </attribute> </mbean>Plug-ins are modules that can be added to a web server installation and can be configured to enable interaction between the web server of choice and the application server of choice. Typically, plug-ins can be used as a load-balancer for the web server by proxying the requests to the back-end application servers, or can be used to proxy requests for dynamic content to the back-end server(s).
JBoss uses the Apache Tomcat Servlet container, which is configured with the Apache HTTP Server via the Tomcat plug-in known as mod_jk.
1. First, copy the mod_jk.so module supplied by the Apache Software Foundation into the Apache's /module directory. You can obtain this module from the following web site: http://tomcat.apache.org/connectors-doc/howto/apache.html
2. Create a new file called mod_jk.conf in the Apache HTTP Server's /conf directory and add the following code to it:
LoadModule jk_module modules/mod_jk.so JkWorkersFile conf/workers.properties JkLogFile /var/log/httpd/mod_jk.log JkLogLevel info JkMount /* myworker1worker.list = myworker1 worker.myworker1.port = 8009 worker.myworker1.host = localhost worker.myworker1.type = ajp13 worker.myworker1.lbfactor = 1The ajp13 refers to a worker inside JBoss that listens to port 8009. This example shows both the Apache HTTP Server and JBoss running on the same machine (hence, the localhost is the hostname of myworker1), but it is recommended to run the Apache HTTP Server and JBoss instances on separate machines.
4. The mod_jk.conf needs to be loaded. To achieve this, add the following to Apache's configuration file right after the LoadModule directives:
Include conf/mod_jk.conf5. Finally, the ProxyPass and ProxyPassReverse directives that route all requests other than blocking requests to the application server, need to be removed from the Apache configuration file.
For more information on how to install and configure Apache Tomcat's plug-in, refer to the Server Configuration Reference for Apache Tomcat 5.0.x and Apache Tomcat Configuration Reference for Apache Tomcat 5.5.x which can be found at:
With the new Apache 2.2.x load-balance and failover capabilities the mod_jk became obsolete. However, for non-clustered deployments, it is still more desirable to make use of the AJP protocol. To do this without the mod_jk module, the mod_proxy_ajp module is required. In the Apache configuration file where all modules are being loaded, add the following if not already added:
LoadModule proxy_ajp_module modules/mod_proxy_ajp.soTo utilize the AJP protocol, the ProxyPass and ProxyPassReverse directives, which route all requests other than blocking requests to the application server, need to be rewritten to the following:
ProxyPass /application-name ajp://host:port/application-name ProxyPassReverse /application-name ajp://host:port/application-nameThe default port for the AJP protocol is 8009.
Note: The previous ProxyPass and ProxyPass Reverse directives must appear on a single line in your configuration file.
This section explains how to set up a clustered deployment of JBoss Application Servers. It includes steps for configuring the cluster, JMS and web server. The following discussion relates to a clean installation of JBoss, and represents a simplified process for configuring JBoss for clustered deployments of ICEfaces applications. Additional deployment-specific issues may exist. Refer to your JBoss documentation for additional information.
This example cluster consists of two servers (nodes) as shown in the table below.
IP Address Server Name Description 192.168.1.100 Node1 Server 192.168.1.101 Node2 ServerThe JBoss cluster requires no special configuration.
The file [jboss-install-dir]/server/all/deploy-hasingleton/jms/jbossmq-destinations-service.xml on each node of the cluster must be modified to include these ICEfaces topics:
See Configuring JMS for JBoss 4.0 for specifics on adding these two topics.
On each node, the name of the node needs to be specified in the file [jboss install dir]/server/all/deploy/jbossweb-tomcat5x.sar/server.xml. In this file, locate the Engine container and add a jvmRoute attribute like the following:
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1"> ... </Engine>1. The contents of the file mod_jk.conf, created in step 2 of the previous Apache HTTP Server 2.0.x section, should be changed to the following:
LoadModule jk_module modules/mod_jk.so JkWorkersFile conf/workers.properties JkLogFile /var/log/httpd/mod_jk.log JkLogLevel info JkMount /* loadbalancer2. The contents of the file worker.properties, created in step 3 of the previous Apache HTTP Server 2.0.x section, should be changed to the following:
worker.list = loadbalancer worker.node1.port = 8009 worker.node1.host = 192.168.1.100 worker.node1.type = ajp13 worker.node1.lbfactor = 1 worker.node2.port = 8009 worker.node2.host = 192.168.1.101 worker.node2.type = ajp13 worker.node2.lbfactor = 1 worker.loadbalancer.type = lb worker.loadbalancer.balance_workers = node1, node2 worker.loadbalancer.sticky_session = 1Note: With Apache HTTP Server 2.0.x as the front-end, a clustered deployment of the Asynchronous HTTP Server is not supported. However, when the Asynchronous HTTP Server is deployed to one node in the cluster, this version of Apache can be used. All ICEfaces applications can still be deployed to the cluster on all nodes.
Apache 2.2.x comes with its own support for load balancing and failover. To utilize the load balancing features, the following steps need to be taken.
1. The ProxyPass and ProxyPassReverse directives for all requests, including the blocking requests, need to be rewritten to the following:
# The following two directives will route all blocking requests to the # Asynchronous HTTP Server. ProxyPass /application-name/block/receive-updated-views balancer://application-name-async-http-server-cluster lbmethod=bytraffic nofailover=Off ProxyPassReverse /application-name/block/receive-updated-views balancer://application-name-async-http-server-cluster # The following two directives will route all other requests to the # application server. ProxyPass /application-name balancer://application-name-application-server-cluster stickysession=JSESSIONID lbmethod=bytraffic nofailover=On ProxyPassReverse /application-name balancer://application-name-application-server-clusterNote: The previous ProxyPass and ProxyPass Reverse directives must appear on a single line in your configuration file.
2. Additionally the balance members for each balancer need to be specified right after the ProxyPass and ProxyPassReverse directives as follows:
<Proxy balancer://application-name-application-server-cluster> BalancerMember ajp://192.168.1.100:8009/application-name route=node1 BalancerMember ajp://192.168.1.101:8009/application-name route=node2 </Proxy> <Proxy balancer://application-name-async-http-server-cluster> BalancerMember http://192.168.1.100:51315/application-name /block/receive-updated-views BalancerMember http://192.168.1.101:51315/application-name /block/receive-updated-views </Proxy>3. In order to have load balancing support, the mod_proxy_balancer module is required. In the Apache configuration file where all modules are being loaded, add the following if not already added:
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
|
Copyright 2005-2007. ICEsoft Technologies, Inc. http://www.icesoft.com |