3 Replies Latest reply on Feb 23, 2003 6:01 AM by moorec

    Multiple environments on same machine

    moorec

      How can we have multiple, independent Jboss clusters on the same box but using the same partition name? I thought it would be as simple as changing the UDP mcast_addr="228.1.2.3" to a different address for each group but lookups still bleed over into the other clusters.

      To further explain, we have a dev and tst environment on the same machine. All ip addresses in the configruation files for dev are bound to a logical device like eth0:1 that exposes a unique ip address. All configuration address for test are bound to eth0:2 that exposes it's own unique address.

      When tomcat instances on another server try to address a cluster they can find the wrong cluster even if the are configured to do jndi lookups on specific addresses.

      I hope this makes sense. We do not want to change partition names in the deployment files when moving from dev to test and so on so would like to resolve this issue.

      Thanks

        • 1. Re: Multiple environments on same machine

          On the server you need to:

          1. Change the mcast_addr like you have
          2. change the HAJNDI port

          When configuring clients to connect you need to:

          1. disable dynamic discovery
          2. specify at least one member of the cluster with the new
          HAJNDI port

          I suggest disabling dynamic discovery because the address and port used by the server for dynamic discovery cannot be changed. If you don't turn it off and your cluster is down, clients might accidentily connect to a different cluster.

          Let me know if this works for you.

          -Dave

          • 2. Re: Multiple environments on same machine
            slaboure

            As a Swiss guy, I don't know if I am entitled to answer a question from someone located in Auckland ;)

            OK, ok, long time ago, one of my English teacher was from New Zealand, so by respect for her and the beautiful pictures she showed us of her countries, I'll do it.

            The problem is that only changing the UDP mcast address will make the clustering work correctly (i.e. the JavaGroups part) but no the autodiscovery features which will still use a standard discovery group. I've just updated the possibility to change that on the server (i.e. the AutoDiscovery binding address/port) today.

            What is interesting in your post is that you say the problem persist even if you do a lookup using a specific address. In this case, AutomaticDiscovery shouldn't be used, so I am perplex.

            BTW, have you set the correct binding interface in the JavaGroups properties: when you have multiple NIC, you must define this (check Bela's post on this mailing list)

            What version of JBoss do you use?

            Cheers,



            Sachalinghi ;)

            • 3. Re: Multiple environments on same machine
              moorec

              First let me say - very funny there "Sachalinghi". Don't forget who's sailing your boat :-). I belive I have the solution working now. I can take servers with the same partition name in and out of a partition's membership. It was a combination of many things but I have done the following:

              1) For all environments, I use the same partition name. For example EJBPartition.
              2) For each environment, assign a unique multicast address and port and bind each member of the environment's partition to that combination.
              Also assign each instance to the ip address associated the correct logical interface (like eth0:1 or whatever). For example:
              <UDP mcast_addr="228.1.2.6" mcast_port="45566" bind_addr="ejb2.dev.network"
              ip_ttl="64" ip_mcast="true"
              mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
              ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
              loopback="false" />
              3) For each jboss instance, assign the HAJNDI service to the correct interface card.
              For example:

              jboss:service=EjbDevPartition
              <!-- Name of the partition to which the service is linked -->
              EjbDevPartition
              <!-- RmiPort to be used by the HA-JNDI service
              once bound. 0 => auto. -->
              42001
              <!-- Port on which the HA-JNDI stub is made available -->
              192.168.1.1
              1100
              <!-- Backlog to be used for client-server RMI
              invocations during JNDI queries -->
              50

              4) On the clients - disable automatic discovery. Supply a list of java.naming.provider.urls.

              This took me a while to come up with for one reason. In the cluster-service.xml file of one Jboss Instance, I used the old 3.0.4 "PartitionProperties" format using the following attribute:

              UDP(mcast_addr=228.1.2.5;mcast_port=45567;bind_addr=ejb2.dev.internal):PING:FD(timeout=5000):VERIFY_SUSPECT(timeout=1500):MERGE:NAKACK:UNICAST(timeout=5000):FRAG:FLUSH:GMS:STATE_TRANSFER:QUEUE


              on the other test instance I used the new "PartitonConfig" format:



              <!-- UDP: if you have a multihomed machine,
              set the bind_addr attribute to the appropriate NIC IP address -->
              <!-- UDP: On Windows machines, because of the media sense feature
              being broken with multicast (even after disabling media sense)
              set the loopback attribute to true -->
              <UDP mcast_addr="228.1.2.5" mcast_port="45567" bind_addr="ejb2.dev.internal"
              ip_ttl="64" ip_mcast="true" and so on.

              When I did this, I could bring up one instance but the other would hang. I couldn't therefore get two instances into a single cluster. The only way I could get the two instances to come up was by change the mcast_port on one. They'd come up but unclustered. I cut out all kinds of attrubutes like ip_mcast="true" but nothing worked but changing the port. Finally when I used either the properties or the config on all instances could I get them to work in many different scrnarios.

              Whew!!!! What a dissertation. Any way, I think we're away so thanks for your help sachalingi and dtauzell.