8 Replies Latest reply on Feb 26, 2002 11:17 AM by Bill Burke

    Can't get 2 JBoss servers act as a cluster

    adrian Newbie

      Hi all -

      I have just bought the JBoss clustering document and tried to set up a simple cluster with two nodes.
      I have a simple stateless bean performing an add operation (over rmi) that works fine under a single JBoss server.

      In the conf of both servers I added the following lines in jboss-service.xml file:


      <mbean-ref-list name="SynchronizedMBeans">
      <mbean-ref-list-element>JBOSS-SYSTEM:service=HASessionState</mbean-ref-list-element>
      <mbean-ref-list-element>JBOSS-SYSTEM:service=HAJNDI</mbean-ref-list-element>
      </mbean-ref-list>





      then, I diployed the bean adding the jboss.xml file as in the documentation (in the META-INF directory of the ear file). In the client I have both server urls in the java.naming.provider.url property.

      But the request always goes to the second server of the naming list.

      Could somebody tell me why is that?!
      What am I missing here?!

      What I don't understand is how the two servers find out one about the other, because in the conf there's no reference about that and it doesn't seem to have to do with any broadcast .. at least at the beginning (when the group of servers is set up).

      I'm using JBoss 1.0 alpha for win NT, win NT 4.0 SP6 and sun jdk 1.3.

      Thanks in advance and best regards,

      Adrian


        • 1. Re: Can't get 2 JBoss servers act as a cluster
          Bill Burke Master

          Hi,
          I have purchased the documentation for JBoss. I have downloaded JBoss-all and ran the build. I have done all required, as mentioned in the documentation. Yet the clustering does not work. Could u pls tell me where HAPartition has to be put into the jboss-services.xml and the format.
          Please do tell me as my requirement is urgent
          Karl

          • 2. Re: Can't get 2 JBoss servers act as a cluster
            adrian Newbie

            Hi again -

            About the cluster set up, I didn't know that JavaGroups uses IP multicast and the last question is obsolete. My last experience with group-programming was a few years ago with MPI where you had to specify manually the list of hosts belonging to a cluster :)

            However, I cannot get the cluster running no matter what I do.

            The cluster-service.xml is as following:

            <?xml version="1.0" encoding="UTF-8"?>


            <!-- ===================================================================== -->
            <!-- -->
            <!-- Sample Clustering Service Configuration -->
            <!-- -->
            <!-- ===================================================================== -->





            JBOSS-SYSTEM:service=Naming

            <!-- ==================================================================== -->
            <!-- Cluster Partition: defines cluster -->
            <!-- ==================================================================== -->


            <mbean-ref-list name="SynchronizedMBeans">
            <mbean-ref-list-element>JBOSS-SYSTEM:service=HASessionState</mbean-ref-list-element>
            <mbean-ref-list-element>JBOSS-SYSTEM:service=HAJNDI</mbean-ref-list-element>
            </mbean-ref-list>


            <!-- ==================================================================== -->
            <!-- HA Session State Service for SFSB -->
            <!-- ==================================================================== -->

            <!--mbean code="org.jboss.ha.hasessionstate.server.HASessionStateService" name="JBOSS-SYSTEM:service=HASessionState">
            </mbean-->

            <!-- ==================================================================== -->
            <!-- HA JNDI -->
            <!-- ==================================================================== -->






            I can mention that I tried both to add the above conf in jboss-service.xml or to manually add the above file in the deploy directory. In both cases the HAJNDI system starts.

            The jboss.xml is as follows:


            <enterprise-beans>

            <ejb-name>mybeab</ejb-name>
            <jndi-name>mybean</jndi-name>
            True
            <cluster-config>
            <partition-name>DefaultPartition</partition-name>
            <home-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin< /home-load-balance-policy>
            <bean-load-balance-policy>org.jboss.ha.framework.interfaces.RoundRobin< /bean-load-balance-policy>
            </cluster-config>

            </enterprise-beans>


            If I put the bean in deploy directory, the bean is deployed but it doesn't seem to be deployed "cluster wide" as long as no reference to that can be found in the logs. If I put it in the deploy/farm directory, the server doesn't seem to consider it.

            Or the servers don't get to know one about the other.


            I can mention here that I run a simple multicast example and a java group example program on my network and they worked fine.

            But for the ejb, the request always goes to one server.

            What could it be? Are there any other configuration parameters? I see an empty directory conf/cluster, are there any conf files to be put there?

            Any other ideas?

            Again, I'm using two win nt 4.0 sp.6 boxes with JBoss 3.0 alpha and sun jdk 1.3.

            Thanks in advance and best regards,

            Adrian

            • 3. Re: Can't get 2 JBoss servers act as a cluster
              Alan Lewis Newbie

              Adrian,

              You are right that the nodes use IP-multicast to find one another. With JBoss Clustering, as long as the nodes are assigned to the same partition (which they are by default) you don't have to configure them in order for them to connect to one another.

              I suspect that your two machines have dynamically assigned IP addresses, as is often the case with developer machines. If this is so, then clustering won't work. In order to use clustering all the nodes must have static IP addresses.

              If this doesn't work, then I would suggest trying the JBoss beta which just came out. I haven't had a chance to play with the beta too much yet, but I know that it contains many clustering bug fixes and improvements since the alpha. You can get it here:

              http://sourceforge.net/project/showfiles.php?group_id=22866

              Hope this helps. If it does not then please post more info and I'll try to help further if I can. I can attest for the fact that clustering DOES work, so don't give up hope :)

              Regards,
              Alan

              • 4. Re: Can't get 2 JBoss servers act as a cluster
                Sacha Labourey Master

                Hello,

                Can you please try again with a fresh CVS checkout? I've just removed a few bugs in this area.

                Thank you. Cheers,



                Sacha

                • 5. Re: Can't get 2 JBoss servers act as a cluster
                  Jim Hazen Expert

                  Can I ask why clustering wouldn't work with machines having dynamically assigned IP addresses? What exactly is the restriction here? I know a fair amount of companies that use DHCP and other dynamic means to assign IP addresses to production machines. This is due to the volume of production machines and the need for easy configuration and maintenance. The IPs are essentially static, but also have some dynamic elements. I'm unclear as to why this would have any effect on the application.

                  • 6. Re: Can't get 2 JBoss servers act as a cluster
                    Karl Newbie

                    Hi,
                    I have purchased the documentation for JBoss. I have downloaded JBoss-all and ran the build. I have done all required, as mentioned in the documentation. Yet the clustering does not work. Could u pls tell me where HAPartition has to be put into the jboss-services.xml and the format.
                    Please do tell me as my requirement is urgent
                    Karl

                    • 7. Re: Can't get 2 JBoss servers act as a cluster
                      Sacha Labourey Master

                      Hello,

                      What is your *exact* problem?

                      "clustering does not work" is not sufficient to help you.

                      And clustering work ;)

                      Cheers,



                      Sacha

                      • 8. Re: Can't get 2 JBoss servers act as a cluster
                        Bill Burke Master

                        Are you using 3.0 beta? If so, you do not have to do any MBean configuration at all. By default there is a cluster-service.xml that sets up a default partition.