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


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/JONAS_5_1_0/doc/doc-en/html/clustering_guide.html


Configuring the clustering:
---------------------------

First of all, configure the cluster using the newjc command.
Please, refer to the newjc documentation and do not forget to install and configure apache2
as it's described in the Cluster Configuration Guide.


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

Use the Ant build tool:
- ant enableLbMode ear
    for the load-balancing mode, or
- ant enableHaMode ear earHA
    for the hight-avability mode.

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:
-------------------------

1) Start the cluster:

Use for that, the jcl4sc (jcl4sc.bat) command generated by newjc in the root
of the JOnAS bases.

  jcl4sc -c start

This allows to start the cluster, included the cluster daemon, the db node,
the master node and the jbx nodes.


2) Deploy the application:

The sampleCluster2 application is automatically deployed on the cluster if you
have previously build it, before using the jcl4sc command. 

3) Test the application:

Use your webbrowser
    url: http://<hostname>:<apache-port>/sampleCluster2
    ex : http://localhost:80/sampleCluster2

4) Stop the cluster:

jcl4sc stop

This allows to stop the cluster.


You may type jcl4sc -help to get the usage of the command.


Attachments:
-------------
+ example configurations (in exampleConfig):
	- Jakarta Tomcat 6.x (tomcat6-jk.conf)
	- mod_jk (workers.properties, tomcat6-mod_jk.xml)


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