13.7.4. Configure NSAPI as a Load-balancing Cluster
Overview
This task configures the NSAPI connector to redirect client requests to JBoss Enterprise Application Platform servers in a load-balancing configuration. To use NSAPI as a simple HTTP connector with no load-balancing, refer to Section 13.7.3, “Configure NSAPI as a Basic HTTP Connector” instead.
Prerequisites
- You must complete Section 13.7.2, “Configure the NSAPI Connector on Oracle Solaris” before continuing with the current task.
Procedure 13.17. Task
Define the URL paths to redirect to the JBoss Enterprise Application Platform servers.
Edit theIPLANET_CONFIG/obj.conf
file. Locate the section which starts with<Object name="default">
, and add each URL pattern to match, in the format shown by the example file below. The stringjknsapi
refers to the HTTP connector which will be defined in the next step. The example shows the use of wild-cards for pattern matching.<Object name="default"> [...] NameTrans fn="assign-name" from="/status" name="jknsapi" NameTrans fn="assign-name" from="/images(|/*)" name="jknsapi" NameTrans fn="assign-name" from="/css(|/*)" name="jknsapi" NameTrans fn="assign-name" from="/nc(|/*)" name="jknsapi" NameTrans fn="assign-name" from="/jmx-console(|/*)" name="jknsapi" NameTrans fn="assign-name" from="/jkmanager/*" name="jknsapi" </Object>
Define the worker that serves each path.
Continue editing theIPLANET_CONFIG/obj.conf
file. Directly after the closing tag for the section you modified in the previous step (</Object>
), add the following new section and modify it to your needs:<Object name="jknsapi"> ObjectType fn=force-type type=text/plain Service fn="jk_service" worker="status" path="/jkmanager(/*)" Service fn="jk_service" worker="router" </Object>
Thisjksnapi
object defines the worker nodes used to serve each path that was mapped to thename="jksnapi"
mapping in thedefault
object. Everything except for URLs matching/jkmanager/*
is redirected to the worker calledrouter
.Define the workers and their attributes.
Create a file calledworkers.properties
in
. Paste the following contents into the file, and modify them to suit your environment.IPLANET_CONFIG
/conf/connector/# The advanced router LB worker # A list of each worker worker.list=router,status # First JBoss Enterprise Application Platform server # (worker node) definition. # Port 8009 is the standard port for AJP # worker.worker01.port=8009 worker.worker01.host=127.0.0.1 worker.worker01.type=ajp13 worker.worker01.ping_mode=A worker.worker01.socket_timeout=10 worker.worker01.lbfactor=3 # Second JBoss Enterprise Application Platform server worker.worker02.port=8009 worker.worker02.host=127.0.0.100 worker.worker02.type=ajp13 worker.worker02.ping_mode=A worker.worker02.socket_timeout=10 worker.worker02.lbfactor=1 # Define the load-balancer called "router" worker.router.type=lb worker.router.balance_workers=worker01,worker02 # Define the status worker worker.status.type=status
Theworkers.properties
file uses the same syntax as Apache mod_jk. For information about which options are available, refer to Section 13.4.4, “Configuration Reference for Apache Mod_jk Workers”.Save and exit the file.Restart the iPlanet Web Server.
Choose one of the following procedures, depending on whether you run iPlanet Web Server 6.1 or 7.0.iPlanet Web Server 6.1
IPLANET_CONFIG/../stop IPLANET_CONFIG/../start
iPlanet Web Server 7.0
IPLANET_CONFIG/../bin/stopserv IPLANET_CONFIG/../bin/startserv
Result
The iPlanet Web Server redirects the URL patterns you have configured to your JBoss Enterprise Application Platform servers in a load-balancing configuration.