16.8.4. Configure ISAPI to Balance Client Requests Across Multiple JBoss EAP 6 Servers


This configuration balances client requests across the JBoss EAP 6 servers you specify. If you prefer to send client requests to specific JBoss EAP 6 servers on a per-deployment basis, refer to Section 16.8.3, “Configure the ISAPI Redirector to Send Client Requests to JBoss EAP 6” instead.

This configuration is done on the IIS server, and assumes that JBoss EAP 6 is already configured as per Section 16.3.5, “Configure JBoss EAP 6 to Accept Requests From an External HTTPD”.

Procedure 16.12. Balance Client Requests Across Multiple Servers

  1. Create a directory to store logs, property files, and lock files.

    The rest of this procedure assumes that you are using the directory C:\connectors\ for this purpose. If you use a different directory, modify the instructions accordingly.
  2. Create the isapi_redirect.properties file.

    Create a new file called C:\connectors\isapi_redirect.properties. Copy the following contents into the file.
    # Configuration file for the ISAPI Redirector
    # Extension uri definition
    # Full path to the log file for the ISAPI Redirector
    # Log level (debug, info, warn, error or trace)
    # Use debug only testing phase, for production switch to info
    # Full path to the workers.properties file
    # Full path to the uriworkermap.properties file
    #OPTIONAL: Full path to the rewrite.properties file 
    If you do not want to use a rewrite.properties file, comment out the last line by placing a # character at the beginning of the line. See Step 5 for more information.
  3. Create the uriworkermap.properties file.

    The uriworkermap.properties file contains mappings between deployed application URLs and which worker handles requests to them. The following example file shows the syntax of the file, with a load-balanced configuration. The wildcard (*) character sends all requests for various URL sub-directories to the load-balancer called router. The configuration of the load-balancer is covered in Step 4.
    Place your uriworkermap.properties file into C:\connectors\.
    # images, css files, path /status and /web-console will be
    # provided by nodes defined in the load-balancer called "router"
    # Example of exclusion from mapping, logo.gif won't be displayed  
    # Requests to /app-01 and /app-02 will be routed to nodes defined
    # in the load-balancer called "router"
    # mapping for management console, nodes in cluster can be enabled or disabled here
  4. Create the workers.properties file.

    The workers.properties file contains mapping definitions between worker labels and server instances. The following example file shows the syntax of the file. The load balancer is configured near the end of the file, to comprise workers worker01 and worker02. The workers.properties file follows the syntax of the same file used for Apache mod_jk configuration. For more information about the syntax of the workers.properties file, refer to Section 16.6.4, “Configuration Reference for Apache Mod_jk Workers”.
    Place this file into the C:\connectors\ directory.
    # The advanced router LB worker
    # 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
    # Second EAP server definition
    # Define the LB worker
    # Define the status worker for jkmanager
  5. Create the rewrite.properties file.

    The rewrite.properties file contains simple URL rewriting rules for specific applications. The rewritten path is specified using name-value pairs, as shown in the example below. Place this file into the C:\connectors\ directory.
    #Simple example
    # Images are accessible under abc path
  6. Restart the IIS server.

    Restart your IIS server by using the net stop and net start commands.
    C:\> net stop was /Y
    C:\> net start w3svc

The IIS server is configured to send client requests to the JBoss EAP 6 servers referenced in the workers.properties file, balancing the load equally across the servers.