• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Jboss clustering

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
shravan nanda
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Jboss 5.0.1 not Jboss 4
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Nothing up my sleeve ... and ... presto! A tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic