5 Replies Latest reply on May 30, 2006 10:49 AM by annecotter

    Setting bind_addr after using -b startup option

    annecotter

      I am using the -b startup option to set the jboss.bind.address

      org.jboss.Main.main(new String[] {"-b10.10.1.1"});


      Looking at the jboss code, this seems to also set the bind_addr variable used by JGroups.

      I want the cluster traffic to use a different address, so I set it in the cluster-service.xml file

      <TCP bind_addr="192.168.2.1" start_port="11800" loopback="true" />



      However, when I start JBoss the cluster service is binding to the address passed on startup with the -b option (not the one defined in cluster-service.xml)

      Any ideas on how to set the bind_addr correctly after using the -b startup option?

      Thank you in advance!

        • 1. Re: Setting bind_addr after using -b startup option
          brian.stansberry

          You'll need to upgrade your jgroups.jar to version 2.2.8 or later. Then, when you start JBoss, pass in system property ignore.bind.address, e.g.

          ./run.sh -b 192.168.1.10 -Dignore.bind.address=true


          JGroups will check for the system property, and if "true" will ignore the -b switch and use whatever value you set the bind_addr attribute to in your TCP config.

          • 2. Re: Setting bind_addr after using -b startup option
            annecotter

            Thank you for the fast response!

            Unfortunately, upgrading my version of JGroups is not as easy as it sounds. If you have any suggestions that would work with Jboss 4.0.2/JGroups 2.2.7, it would be much appreciated. (Possibly even another way to define the jboss.bind.address ... setting it using an environment variable or -D doesn't do the trick with 4.0.2)

            Anne

            • 3. Re: Setting bind_addr after using -b startup option
              brian.stansberry

              What happens if you try:

              org.jboss.Main.main(new String[] {"-b10.10.1.1", "-Dbind.address=192.168.2.1"});


              Be sure the -D comes after the -b. This may not work if the code that processes the args puts the args in a predetermined order. Looking at org.jboss.Main it's not clear if it does or not.

              This relies on the fact the for historical reasons JGroups actually uses property bind.address rather than jboss.bind.address. org.jboss.Main sets both properties based on the -b switch. But, if it processes -Dbind.address after it processes -b, then your -D config will override the -b one.

              • 4. Re: Setting bind_addr after using -b startup option
                brian.stansberry

                My laptop is bound to 2 networks, and I just tried

                run -c all -b 172.31.90.207 -Dbind.address=192.168.90.164

                and it worked :-)


                run -c all -Dbind.address=192.168.90.164 -b 172.31.90.207

                left JGroups bound to 172.31.90.207, so order is important.

                • 5. Re: Setting bind_addr after using -b startup option
                  annecotter

                  That seems to be exactly what I needed, thanks Brian!

                  Anne