 ===============================
|       SampleCluster2	        |
 ===============================

Date: 24/04/06
Version: v3.0

Application Overview:
----------------------

This application aims to demonstrate the JOnAS's clustering features in a 'pedagogic' way:

- load balancing at Apache level
	. mod_jk
- failover at the web level (Tomcat)
	. HTTP session replication
- load balancing at EJB level
	. CMI

- failover at EJB level
	. Stateful EJB replication

For a complete description of the application and the cluster configuration
-----------------------------------------------------------------------------

See http://jonas.objectweb.org/current/doc/doc-en/integrated/howto/Clustering.html#Clustering

Directory Structure:
---------------------

/lib        librairies needed by the aplication to run
/output     generated ear,jar,war files
/newjc	    newjc tool used for generating a cluster configuration
/src	    source code


Compiling this application:
----------------------------

A. for one JOnAS  instance:
  Use the Ant build tool:
    ant install

  The application file sampleCluster2.ear is copied to your $JONAS_BASE/apps folder

B. for more JOnAS instances:

  Use the Ant build tool:
    ant ear

Note : By default, the SSB calls are not integrated in the horizontal algorithm. This default
mode enables the load-balancing at the remote interface. When the SSB are marked as replicated
in the jonas-ejb-jar.xml (cluster-replicated element), the load-balancing is disabled, all
the methods calls are sent to the same node but a tx exact-one is ensured. For switching from
one mode to another, you can use the target 'enableHaMode' and 'enableLbMode'.

Running the application:
-------------------------

A. for one JOnAS instance:

 1) start JOnAS:
     jonas start -n node0

 2) deploy the application:
     jonas admin -a sampleCluster2.ear

 3) test the application
     use your webbrowser
      url : http://<hostWebApplicationAddr>/sampleCluster2

 4) stop JOnAS:
     jonas stop -n node0

B. for more JOnAS instances:

   Remark: X is the number of the node in the cluster

 1) start each JOnAS instance:
       jonas start -n nodeX -Ddomain.name=sampleCluster2Domain

 2) deploy the wevApp and the EJBs on the JOnAS instances
            jonas admin -a sampleCluster2.ear -n nodeX

 3) test the application
       use your webbrowser
        url: http://<hostWebApplicationAddr>/sampleCluster2

 4) stop each JOnAS instance:
       jonas stop -n nodeX


Attachments:
-------------
+ example configurations (in exampleConfig):
	- Jakarta Tomcat 5.5.x (server-5.5_director.xml,server-5.5_mod_jk.xml)
	- mod_jk (workers.properties, tomcat_jk.conf)
	- Enhydra Director (enhydra_director.conf)


---------------------------
Good luck!!
=================================================================================
