JBoss Setup Guide (2006)

Embed Size (px)

Citation preview

  • 7/30/2019 JBoss Setup Guide (2006)

    1/7

    JBoss Clustering with Connect 1.1 Setup Guide

    This document describes how to set up Connect 1.1 on a simple JBoss cluster. Load-balancing

    was set up with sticky sessions, in which a each browser session is bound to a given node.

    Environment Setup

    The tools listed below were used.

    -Java Platform Standard Edition Development Kit (JDK) 5.0-Microsoft SQL Server 2000, Service Pack 4

    -Apache HTTP Server 2.0.58

    -JBoss Application Server 4.0.4 GA

    Apache HTTP Server Installation

    Apache handles the load-balancing configuration for the cluster, and must be installed to takeadvantage of JBoss clustering. This should be done on at least one of the clusters nodes.

    Step 1: Download and run the Apache HTTP Server 2.0.58 Windows Installer from

    http://httpd.apache.org/download.cgi .

    Step 2: Download mod_jk load-balancing binaries for load balancinghttp://www.apache.org/dist/jakarta/tomcat-connectors/jk/binaries/ . Follow the

    instructions to find the stable version that matches your Apache installation.Rename the file to mod_jk.so, and copy it to the /modules

    directory.

    Step 3: Create a file named mod-jk.confin the /confdirectory. Thefile should read:

    # Load mod_jk module# Specify the filename of the mod_jk libLoadModule jk_module modules/mod_jk.so

    # Where to find workers.propertiesJkWorkersFile conf/workers.properties

    # Where to put jk logsJkLogFile logs/mod_jk.log

  • 7/30/2019 JBoss Setup Guide (2006)

    2/7

    # Set the jk log level [debug/error/info]JkLogLevel info

    # Select the log formatJkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

    # JkOptions indicates to send SSK KEY SIZEJkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

    # JkRequestLogFormatJkRequestLogFormat "%w %V %T"

    # Mount your applicationsJkMount /connect/* loadbalancer

    # You can use external file for mount points.# It will be checked for updates each 60 seconds.# The format of the file is: /url=worker# /examples/*=loadbalancer# COMMENT NEXT LINE IF

    JkMountFile conf/uriworkermap.properties

    # Add shared memory.# This directive is present with 1.2.10 and# later versions of mod_jk, and is needed for# for load balancing to work properlyJkShmFile logs/jk.shm

    # Add jkstatus for managing runtime dataJkMount statusOrder deny,allowDeny from allAllow from 127.0.0.1LoadModule should reference the location ofmod_jk.soin your Apache install,

    and JkMountshould list the URLs to forward to the load-balancer. For example, to

    load-balance all URLs, JkMount /*can be used. If you dont want to add an

    external file for more complex forwarding, remove the JkMountFileline and

    skip Step 4.

    Step 4: (optional) To further customize forwarding, create a file nameduriworkermap.propertiesin the /confdirectory. The filecould read:

    # Simple worker configuration file

    # Mount the Servlet context to the ajp13 worker/jmx-console=loadbalancer/jmx-console/*=loadbalancer/web-console=loadbalancer/web-console/*=loadbalancer

  • 7/30/2019 JBoss Setup Guide (2006)

    3/7

    That example would forward requests to the listed URLs to Tomcat.

    Step 5: Create a file named workers.properties in the /confdirectory.

    The file should read:

    This would set up evenly-weighted round-robin load balancing with sticky sessions.Make sure to enter the correct host for each node. To add additional nodes, follow the

    example of first two, adding the new nodes name to the

    worker.loadbalancer.balance_workers line.

    JBoss Application Server Installation

    Next, JBoss must be installed. Note that these steps must be taken on each node in the cluster.

    Step 1: Run the installer for JBoss Application Server 4.0.4 fromhttp://labs.jboss.com/portal/jbossas/download/index.html . Be sure to run the

    installer, not to choose Download. This ensures you will download all the neededcomponents into one default server directory, minimizing the customization

    needed. For simplicity, select the all configuration, select all the install packs

    # Define list of workers that will be used# for mapping requestsworker.list=loadbalancer,status

    # Define Node1# modify the host as your host IP or DNS name.worker.node1.port=8009

    worker.node1.host=DR72N81.phys.misyshealthcare.comworker.node1.type=ajp13worker.node1.lbfactor=1worker.node1.cachesize=10

    # Define Node2# modify the host as your host IP or DNS name.

    worker.node2.port=8009worker.node2.host= BR72N81.phys.misyshealthcare.comworker.node2.type=ajp13worker.node2.lbfactor=1worker.node2.cachesize=10

    # Load-balancing behaviourworker.loadbalancer.type=lb

    worker.loadbalancer.balance_workers=node1,node2worker.loadbalancer.sticky_session=1#worker.list=loadbalancer

    # Status worker for managing load balancerworker.status.type=status

  • 7/30/2019 JBoss Setup Guide (2006)

    4/7

    listed, and keep default as the config name. Do not enable deploymentisolation/call by value, and leave the security options unchecked.

    Step 2: Locate the filejboss-service.xml in /server/default/deploy/tc5-

    cluster.sar/META-INF. Change the property to

    Tomcat-Cluster .

    Step 3: Locate the file server.xml in /server/default/deploy/jbossweb-

    tomcat55.sar. Change the property to match eachnodes worker name. For example, for node 1:

    Step 4: Locate the filejboss-service.xml in/server/default/deploy/jbossweb-tomcat55.sar/META-INF.

    Change the property to instant. and the to true .

    Step 5: (optional) You may notice the JBoss server log outputs a message received from

    member of another partition message every 15-30 seconds. If you wish tosuppress this message to clean the console output, locate the file log4j.xml in

    /server/default/conf. Add the following code to the file:

  • 7/30/2019 JBoss Setup Guide (2006)

    5/7

    Make sure to change the highlighted properties to match your database and hostname.

    Step 4: Delete hsqldb-ds.xml from the /server/default/deploy directory.

    Step 5: Locate standardjaws.xml in the /server/default/conf directory.

    Modify to java:/Connect , to true and to false.

    Step 6: Locate standardjbosscmp-jdbc.xml in the /server/default/conf

    directory. Modify to java:/Connect , to MS

    SQLSERVER2000 and to false.

    Step 7: Locate login-config.xml in the /server/default/confdirectory.

    Make sure there is the following code, and add it if necessary. Make sure to changethe highlighted fields to match your local database.

    Connect

    jdbc:microsoft:sqlserver://hostname:port;DatabaseName=namehere;SelectMethod=cursor

    com.microsoft.jdbc.sqlserver.SQLServerDriveruserpasscreate

    MS SQLSERVER2000

    saconnect11

    connect11

    jboss.jca:service=LocalTxCM,name=Connect

  • 7/30/2019 JBoss Setup Guide (2006)

    6/7

    JBoss Configuration for Connect 1.1

    Finally, each nodes JBoss installation must be configured to deploy Connect.

    Step 1: Follow the steps in the document titled Misys Connect Installation Guide.

    Step 2: It may be necessary to copy standard.jar from Connect1/connect.war/WEB-INF/lib to

    /server/default/lib .

    How To Use the Cluster

    The JBoss cluster setup should now be complete. The steps below should be taken to make sure

    it is properly configured.

    Step 1: Start JBoss on each node one of two ways:-navigate to /bin and run the run.bat file.-on a command prompt, set the working directory to /bin and

    type the command run.

    Step 2: On one node, stop Apache HTTP Server if it is currently running, and restart it.

    Step 3: From a web browser, navigate to http://hostname (with no port number) where

    hostname is replaced by the name of the computer running Apache. If Apache is

    properly configured, you should see a JBoss welcome screen.

    Step 4: Click on the JMX-Console link, which can also be reached directly athttp://hostname/jmx-console . Under the jboss heading, look for

    service=DefaultPartition and click that link. The CurrentView field should showthe IP address of each node in the cluster currently running a JBoss instance.

    Step 5: Return to the JBoss welcome screen, and click the full link beside Tomcat Status.

    If Connect is properly deployed, its address should be listed under Application List.Make a note of that address.

    Step 6: In the web browser, navigate to http://hostname/connect where connect is replaced, ifnecessary, by the address found in Step 5. If the load-balancing was correctly set up,

    this sessions output should be shown completely in one nodes server log.

    Step 7: Begin a new browser session, either on the same computer or a different one, andnavigate to the same URL as in Step 6. This sessions output should be shown

    completely in the other nodes server log.

  • 7/30/2019 JBoss Setup Guide (2006)

    7/7

    Other Sources

    For information more advanced clustering setups, including HTTP state session replication and

    failover, see JBosss clustering setup guide at the following link.http://docs.jboss.org/jbossas/jboss4guide/r5/html/cluster.chapt.html#clustering-http