-
1. Re: Setting up multiple instances of JBoss in different mach
shoeb1981 Dec 17, 2007 5:17 AM (in response to viswanadhvk)This is fairly simple. You start your server with the partition name (check out jboss manual for partition name variable to be used at the time of server start up, you might need to modify you run.bat/sh file also.
You may also need to specify the mcast address the same way you would do the partition name.
Start the server on all machines. They will form the cluster.
To really take the advantage of the clustering, you might need to change the way you call components on the server from the client. If you have not changed the Ha-jndi port of the server, you would specify the server url from within your client, like this:
String url="jnp://host1:1100/,jnp://host2:1100,....."; -
2. Re: Setting up multiple instances of JBoss in different mach
viswanadhvk Dec 18, 2007 11:55 AM (in response to viswanadhvk)HI shoeb,
Thanks for your reply.
Let me briefly explain you, what I did .
I am using windows XP , and JBoss 4.2.1.
(1) I changed DefaultPartition to TestPartition at " all\deploy\cluster-service.xml "<server> <!-- ==================================================================== --> <!-- Cluster Partition: defines cluster --> <!-- ==================================================================== --> <mbean code="org.jboss.ha.framework.server.ClusterPartition" name="jboss:service=${jboss.partition.name:TestPartition}"> <!-- Name of the partition being built --> <attribute name="PartitionName">${jboss.partition.name:TestPartition}</attribute>
(2) Even though I am NOT using SFSB (Stateful Session Bean) .
I modified the below code at cluster-service.xml for "SFSB"
changed DefaultPartition to TestPartition<!-- ==================================================================== --> <!-- HA Session State Service for SFSB --> <!-- ==================================================================== --> <mbean code="org.jboss.ha.hasessionstate.server.HASessionStateService" name="jboss:service=HASessionState"> <depends>jboss:service=Naming</depends> <!-- We now inject the partition into the HAJNDI service instead of requiring that the partition name be passed --> <depends optional-attribute-name="ClusterPartition" proxy-type="attribute">jboss:service=${jboss.partition.name:TestPartition}</depends> <!-- JNDI name under which the service is bound --> <attribute name="JndiName">/HASessionState/Default</attribute> <!-- Max delay before cleaning unreclaimed state. Defaults to 30*60*1000 => 30 minutes --> <attribute name="BeanCleaningDelay">0</attribute> </mbean>
(3)I modified the "HA-JNDI" also at cluster-service.xml
changed DefaultPartition to TestPartition
<!-- ==================================================================== --> <!-- HA JNDI --> <!-- ==================================================================== --> <mbean code="org.jboss.ha.jndi.HANamingService" name="jboss:service=HAJNDI"> <!-- We now inject the partition into the HAJNDI service instead of requiring that the partition name be passed --> <depends optional-attribute-name="ClusterPartition" proxy-type="attribute">jboss:service=${jboss.partition.name:TestPartition}</depends> <!-- Bind address of bootstrap and HA-JNDI RMI endpoints --> <attribute name="BindAddress">${jboss.bind.address}</attribute> <!-- Port on which the HA-JNDI stub is made available -->
(4) I modified at the "HA-Invokers"
changed DefaultPartition to TestPartition<!-- ==================================================================== --> <!-- HA Invokers --> <!-- ==================================================================== --> <mbean code="org.jboss.invocation.unified.server.UnifiedInvokerHA" name="jboss:service=invoker,type=unifiedha"> <depends>jboss:service=TransactionManager</depends> <depends optional-attribute-name="Connector" proxy-type="attribute">jboss.remoting:service=Connector,transport=socket</depends> <depends>jboss:service=${jboss.partition.name:TestPartition}</depends> </mbean>
(5) I changed at "Distributed cache invalidation"<!-- ==================================================================== --> <!-- Distributed cache invalidation --> <!-- ==================================================================== --> <mbean code="org.jboss.cache.invalidation.bridges.JGCacheInvalidationBridge" name="jboss.cache:service=InvalidationBridge,type=JavaGroups"> <!-- We now inject the partition into the HAJNDI service instead of requiring that the partition name be passed --> <depends optional-attribute-name="ClusterPartition" proxy-type="attribute">jboss:service=${jboss.partition.name:TestPartition}</depends> <depends>jboss.cache:service=InvalidationManager</depends> <attribute name="InvalidationManager">jboss.cache:service=InvalidationManager</attribute> <attribute name="BridgeName">DefaultJGBridge</attribute> </mbean>
in all the above places I changed the name of the partition name. I changed from DefaultPartition to TestPartition, thats it. Other than that I haven't changed any thing.
(6) I changed another file called farm-service.xml
which is at "I changed all\deploy\deploy.last\farm-service.xml"<!-- ===================================================================== --> <!-- --> <!-- Sample Farming Service Configuration --> <!-- --> <!-- ===================================================================== --> <server> <mbean code="org.jboss.ha.framework.server.FarmMemberService" name="jboss:service=FarmMember,partition=${jboss.partition.name:TestPartition}" > <!-- We now inject the partition into the HAJNDI service instead of requiring that the partition name be passed --> <depends optional-attribute-name="ClusterPartition" proxy-type="attribute">jboss:service=${jboss.partition.name:TestPartition}</depends> <depends>jboss.web:service=WebServer</depends>
(7) I changed this file also
deploy-hasingleton-service.xml which is at all\deploy\
If I won't change this file , JBoss server showing error message as this Partition (defaultPartition)that it is not deployed yet in the server.So I need to change this.<server> <!-- | | Use the deployer service on the singleton node. | --> <mbean code="org.jboss.ha.singleton.HASingletonController" name="jboss.ha:service=HASingletonDeployer"> <!-- We now inject the partition into the HAJNDI service instead of requiring that the partition name be passed --> <depends optional-attribute-name="ClusterPartition" proxy-type="attribute">jboss:service=${jboss.partition.name:TestPartition}</depends>
In the above files also I changed only name of the 'partition' from 'DefaultPartition' to 'TestPartition'
I did the same changes in 2nd machine also.
Next I started both the machines (one after another, may be 30 secs gap)
with the below command.run.bat -g ,partition name -u <multicast address> -b <this machine IPaddress> -c all run.bat -g TestPartition -u 228.1.2.3 -b 166.35.136.77 -c all
Same I did for 2nd machine also, Of course IP address of that machine.
mcast-address and partition names both are same for both machines.
But both are not recognizing each other.
I also re-started the machines with different start up commands but in vain.
these are the start up commandsrun.bat -g TestPartition -u 228.1.2.3 -b CUSTXIRVMRWW5GG -c all run.bat -b 166.35.136.77 -c all --partition=TestPartition -u 228.1.2.3
Can any body suggest me , what I need to do more. Or please suggest me am I doing any mistake any where.
Thanks!
Viswanadh -
3. Re: Setting up multiple instances of JBoss in different mach
viswanadhvk Dec 18, 2007 4:20 PM (in response to viswanadhvk)Hi all, I solved the problem. The problem was my system is not having mcast open. So instead of using UDP, Iam using TCPPING. It was working fine.
Thanks!
vvk -
4. Re: Setting up multiple instances of JBoss in different mach
gvamsius Jan 30, 2008 11:40 AM (in response to viswanadhvk)"viswanadhvk" wrote:
Hi all, I solved the problem. The problem was my system is not having mcast open. So instead of using UDP, Iam using TCPPING. It was working fine.
Thanks!
vvk
I had the same problem with UDP.
I commented out UDP and used TCPPING, after which my cluster across the machines worked.
It turns out that Linux does not have Multicast enabled by default.
Whereas Solaris has multicast enabled by default.
Use netstat -nr
to find if your box is configured to use multicast