martin
martin

Reputation: 980

How to disable clustering in JBoss 5?

does any one know how to deactivate the automatic clustering in a JBoss 5.1.0? we have a JBoss running on each developer machine and because we are all in the same network, they do an auto clustering. The problem could be solved if each of us could get its own multicast ip, but the network hardware is not capable of that.

Isn't there a switch in jboss to deactivate this?

Upvotes: 3

Views: 5590

Answers (3)

Wenbing Li
Wenbing Li

Reputation: 12992

You can use different multicast or partition name to avoid conflict.

However, if you want to disable clustering in "production" or "all" configuration , you need to do following actions:

Remove

  • farm/
  • deploy-hasingleton/
  • deploy/cluster/

In deploy/messaging/*-persistence-service.xml, change Clustered to false:

<attribute name="Clustered>false</attribute>

and remove

<depends optional-attribute-name="ChannelFactoryName">jboss.jgroups:service=ChannelFactory</depends>

In conf/bootstrap/profile.xml, replace

<bean name="BootstrapProfileFactory" class="org.jboss.system.server.profileservice.StaticClusteredProfileFactory">

with

<bean name="BootstrapProfileFactory" class="org.jboss.system.server.profileservice.repository.StaticProfileFactory">

and remove the "farmURIs" property a few lines below that.

Replace deploy/httpha-invoker.sar with http-invoker.sar from the default profile

In the deployers/clustering-deployer-jboss-beans.xml, comment out WebAppClusteringDependencyDeployer.

In SOA-P, if you are removing clustering, you will need to take a few additional steps.

  • Copy the server/default/deploy/jbpm.esb/hibernate.cfg.xml to server//deploy/jbpm.esb/hibernate.cfg.xml

  • Remove server//deploy/riftsaw* and cp -R server/default/deploy/riftsaw* server//deploy/

Upvotes: 3

Julien Kronegg
Julien Kronegg

Reputation: 5271

Under Eclipse under Windows, you can run the server using the following JVM property (see Open Launch Configuration) :

-Djboss.partition.name=${env_var:COMPUTERNAME}

This way each of the developer machine will have its own cluster (with a single server if you run only one server). Under Linux, you will need to replace COMPUTERNAME by HOSTNAME.

If you run JBoss AS from the command line, you would use something like -Djboss.partition.name=%COMPUTERNAME% under Windows (not tested).

Note that using -Djgroups.udp.ip_ttl=0 (as proposed in another answer) has the following drawbacks:

  • server startup is slower (4 minutes instead of 1 minute in my case);
  • there are a lot of NAKACK warn/error logs;
  • the JGroups UDP multicast is limited to the local machine which could conflict with other applications based on JGroupds UDP;
  • other servers on the same machine with the same configuration will be in the same cluster, which may not be desired.

Upvotes: 4

skaffman
skaffman

Reputation: 403611

You can do this by setting the TTL (time-to-live) on the multicast packets to zero. Clustering will still be enabled, but none of the JBoss servers running on the developer machines will be able to locate each other.

When starting JBoss, set the jgroups.udp.ip_ttl system property, e.g.

-Djgroups.udp.ip_ttl=0

You'll need to hack that into the JBoss startup script, most likely.

Upvotes: 3

Related Questions