A cluster is a group of JBoss server instances, working in coordination.
Clustering provides:
High Availability
Load Balancing
Scalability.
There are two types of clustering
Horizontal Clustering:
A horizontally clustered environment contains multiple physical machines.
Vertical Clustering:
A vertically clustered environment contains multiple application server instances hosted on the same physical machine .
Creating a Cluster:
The minimal and default configurations do not support clustering.
Step1:
Create two instances cluster1 and cluster2 with the same server configuration (all).
Step2:
Change the port sets to ports-01 and ports-02 and configure the jvmRoute as explained above.
Step3:
Start cluster1; wait for the instance to start and start second instance (cluster2).
The screens look like below
Step4:
Now deploy this (download) application into farm folder of Instance1. The farm folder is located in JBoss_Home/server/Instance1/farm
That’s it you can see that the application is deployed in the farm folder of Instance2.
Open the JMX Console of cluster1.
The http port for ports-01 is 8180 and for ports-02 is 8280
Open the JMX Console of cluster1
http://localhost:8180/jmx-console
Enter jboss and click ApplyFilter.
Click on service=DefaultPartition
DefaultPartition is the name of the default cluster.
From this console you can control the cluster lifecycle.
void start()
This method is used to start the cluster.
void stop()
This method is used to stop the cluster.
Java.lang.String showHistory()
To view cluster members and their history.
How to create a cluster with custom name?
Start the servers as shown below
Starting cluster1:
run –c cluster1 -Djboss.partition.name=MyPartition
Starting cluster2:
run –c cluster2 -Djboss.partition.name=MyPartition
That’s it. Now the cluster will be created with the name MyPartition.
2 comments:
Please provide the JBOSS download link.
you can download jboss 4.2.3 from below:
http://kaz.dl.sourceforge.net/project/jboss/JBoss/JBoss-4.2.3.GA/jboss-4.2.3.GA.zip
Post a Comment