wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes Jboss clustering Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Jboss clustering" Watch "Jboss clustering" New topic
Author

Jboss clustering

shravan nanda
Greenhorn

Joined: Jun 07, 2010
Posts: 3
Hi All,

Can somebody please post the step by step procedure involved in jboss clustering.

I went through lot of posts, but no one has really posted one for clustering steps to be followed.

I can't understand how to start nodes, when i have to cluster two instances present on two separate machines.

Do i need run ./run.sh -c all -b -- -u -- -g --- command from same box for both the nodes or need to run it from respective machines.

Please please please respond quickly ....

Thanks in advance

Shravan
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10048
    
163

Shravan,

Welcome to JavaRanch

Depending on the version of JBoss AS you are using, look for the "Clustering Guide" in the right version of the docs here

[My Blog] [JavaRanch Journal]
shravan nanda
Greenhorn

Joined: Jun 07, 2010
Posts: 3
Well I am using JBoss 5.1.0 GA. I have read the clustering guides several times.

I still can't understand the step by step procedure involved in it.

When I used weblogic, I was very comfortable with it, as I was able to understand the guide for it.

But Jboss I just can't understand the guide.

Please please post the step by step procedure....like which file we need to edit when to edit ...which lines we need to edit....

I want to do clustering for two instances on two separate machines.

Very urgent.

Thanks in advance.
Vibhuti Goel
Greenhorn

Joined: Sep 24, 2008
Posts: 3
Hope this helps. Just let me know in case.

CREATING THE JBOSS CLUSTERS

Let us try configuring 2 nodes, say node1 and node2

• Create folders namely node1, node2 under jboss4.0.1sp1\server. (Create as many folders as the number nodes you require like node1, node2, node3 etc. Here we consider only 2)

• Copy the jboss4.0.1sp1\server\all to the folders node1, node2

• Create a folder named binding-manager under node1 and node2 folders

• Copy the folder jboss4.0.1sp1\docs\examples\binding-manager to jboss4.0.1sp1\server\node1\

• Rename the file to port-bindings.xml

• In the file jboss4.0.1sp1\server\node1\conf\jboss-service.xml, uncomment the block

<mbean code="org.jboss.services.binding.ServiceBindingManager"
name="jboss.system:service=ServiceBindingManager">
<attribute name="ServerName">ports-01</attribute>
<attribute name="StoreURL">some file </attribute>
<attribute name="StoreFactoryClassName">
org.jboss.services.binding.XMLServicesStoreFactory
</attribute>
</mbean>

• Change the StoreURL as follows
<attribute name="StoreURL">file:../server/node1/binding-manager/port-bindings.xml</attribute>

• Ensure that the following is uncommented <server name="ports-01">

• Copy the folder jboss4.0.1sp1\docs\examples\binding-manager to jboss4.0.1sp1\server\node2\

• Rename the file to port-bindings.xml

• Ensure that the following is uncommented <server name="ports-02">

• In the file jboss4.0.1sp1\server\node2\conf\jboss-service.xml, uncomment the block

<mbean code="org.jboss.services.binding.ServiceBindingManager"
name="jboss.system:service=ServiceBindingManager">
<attribute name="ServerName">ports-01</attribute>
<attribute name="StoreURL">some file </attribute>
<attribute name="StoreFactoryClassName">
org.jboss.services.binding.XMLServicesStoreFactory
</attribute>
</mbean>

• Change <attribute name="ServerName">ports-01</attribute> as
<attribute name="ServerName">ports-02</attribute>

• Change the StoreURL as follows
<attribute name="StoreURL">file:../server/node2/binding-manager/port-bindings.xml</attribute>

• Copy the file jboss4.0.1sp1\server\all\deploy\deploy.last\farm-service.xml to
jboss4.0.1sp1\server\node1\deploy.last and
jboss4.0.1sp1\server\node2\deploy.last

• Open the file jboss-4.0.1sp1\server\node1\deploy\jbossweb-tomcat50.sar\server.xml

• Replace <Engine name="jboss.web" defaultHost="localhost"> with
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node1">

• Open the file jboss-4.0.1sp1\server\node2\deploy\jbossweb-tomcat50.sar\server.xml

• Replace <Engine name="jboss.web" defaultHost="localhost"> with
<Engine name="jboss.web" defaultHost="localhost" jvmRoute="node2">

V. STARTING THE CLUSTERS
The simplest way to start a JBoss server cluster is to start several JBoss instances on the same local network. We can use the “run -c all” command for each instance. These server instances are all started in the “all” configuration and they detect each other automatically and form a cluster.



• Open Command Prompt

o Start node1 from command line with partition name

jboss4.0.1sp1\bin\ run -c node1

o Leave 10 seconds gap

• Open another Command Prompt

o Start node1 from command line with partition name

jboss4.0.1sp1\bin\ run -c node2

• Both the nodes should be up and running

• Now that we have made sure that the port numbers are changed by application server and so no longer we can access 8080 as the default port for web console for node1 and node2.

It might be 8180 and 8280 respectively.

So if you access thru http://localhost:8180/web-console you can access node1 and
similarly http://localhost:8280/web-console you can access node2
shravan nanda
Greenhorn

Joined: Jun 07, 2010
Posts: 3
I am using Jboss 5.0.1 not Jboss 4
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

I still can't understand the step by step procedure involved in it.

What exactly do you not understand? What steps have you tried and where do you run into problems? Setting up clustering is a lengthy process involving many steps (as you can see from Vibhuti's post). We would be able to help you much better if we knew where you were having a problem.

For what it is worth, JBoss in Action contains 2 chapters on clustering, perhaps those would help.


JBoss In Action
edward peel
Greenhorn

Joined: Oct 27, 2009
Posts: 3
here is a nutshell summary from the example given in the .org quick start:

from your jboss bin directory:
$ ./run.sh -c all -g DocsPartition -u 239.255.100.100 -b 192.168.0.101 -Djboss.messaging.ServerPeerID=1

./run.sh = the executable
-c all = use server in jboss_home/server/all directory
-g DocsPartition = this is the partition name, use whatever but should be the same across nodes
-u 239.255.100.100 = this is the multicast address, ususally just pick anything in the 239.255.x.y range and you should be ok
-b 192.168.0.101 = this is the ip of the machine the node is on
-Djboss.messaging.ServerPeerID=1 = this is the peerid, it must be unique for each node,

so the start script that you would run on your second machine for the second node would look like:
$ ./run.sh -c all-node2 -g DocsPartition -u 239.255.100.100 -b 192.168.0.102 -Djboss.messaging.ServerPeerID=2

you can also use nohup to send the process to the background...

now that both nodes should be running, you have to enable and configure the sticky sessions on thw webserver and each server...
Raja Pam
Greenhorn

Joined: Jan 04, 2011
Posts: 19
Hi,

I'm new to JBOSS, trying to do clustering in our application.

Thanks for explaining Clustering in steps.
But i'm using JBOSS 5.0.
I found many of the files mentioned above are missing.
Do we need to follow another set of steps for clustering in JBOSS.
If yes, please guide me with the steps for clustering in JBOSS 5.0
If no, please let me know why are the files like port-bindings.xml, farm-service.xml in deploy.last.
Block to comment in port-bindings.xml and jboss-service.xml ;
jbossweb-tomcat50.sar file in deploy folder ;
deploy and deploy.last are empty.

Request someone please respond, as i need this for my project.
Regards,
raja
Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
Hi Vibhuti,

I ma using JBoss 5.1 and in that I am not finding binding-manager at location:

Copy the folder jboss4.0.1sp1\docs\examples\binding-manager to jboss4.0.1sp1\server\node1\

Can you guide me what is the alternative for that

 
 
subject: Jboss clustering