9 Replies Latest reply on Jan 8, 2014 5:15 PM by andrewbgoode

    jgroups attempting to bind to 0.0.0.0 and failing when attempting to start a clustered instance?

    hatchetman82

      when trying to start an ha configuration im getting this:

       

      SEVERE (OOB-1,null) 2012-06-15 16:53:54,407 [org.jgroups.protocols.UDP] JDKLogImpl failed sending message to clusterhosta/hibernate (119 bytes): java.lang.Exception: dest=0.0.0.0/0.0.0.0:55200 (122 bytes), cause: java.net.BindException: Cannot assign requested address: Datagram send failed
      this seems to be because the "jgroups-udp" socket-binding uses the "public" interface which is defines as "${jboss.bind.address:0.0.0.0} " - 0.0.0.0 in my case.
      looking around i saw guides covering these subjects for older jboss and for jgroups. for example - http://docs.redhat.com/docs/en-US/JBoss_Enterprise_Web_Platform/5/html/Administration_And_Configuration_Guide/jgroups.chapt.html#jgroups-transport
      that guide refers to a jgruops attribute called "receive_on_all_interfaces", which seems to be what i want.
      but how do i set that option for the udp jboss stack on AS 7.1.1 ?
        • 1. Re: jgroups attempting to bind to 0.0.0.0 and failing when attempting to start a clustered instance?
          kazaag

          Setting receive_on_all_interfaces attribute won't fix the issue.  The issue you get is in the sending part; JBoss doesn't know the IP address on which to send the datagram.

           

          The discovery protocol send the bind adress in the ping data; as you didn't specify a routable bind adresse the other node can't send message.

           

          You need to specify a bind address at start up (add "-b x.x.x.x" in the command starting JBoss).  Unless your node have different interface to reach the other cluster members it will work fine.

           

          If you need more help, you will need to provide the cluster topoligie and put in attachment the jGroup part of the JBoss config file.

          • 2. Re: jgroups attempting to bind to 0.0.0.0 and failing when attempting to start a clustered instance?
            henry.short

            I don't know if this is similar to your issue but I'm having an issue binding to 0.0.0.0. When using the standalone-full-ha.xml using Jboss 7.1.1 Final under Windows 7, I see the following error:

            12:15:35,339 INFO  [stdout] (pool-5-thread-1) ------------------------------------------------------------------- 12:15:35,491 ERROR [org.jboss.msc.service.fail] (pool-5-thread-1) MSC00001: Failed to start service jboss.jgroups.channel.cluster: org.jboss.msc.service.StartException in service jboss.jgroups.channel.cluster: java.lang.IllegalArgumentException: failed to start server socket

                      at org.jboss.as.clustering.msc.AsynchronousService$1.run(AsynchronousService.java:62) [jboss-as-clustering-common-7.1.1.Final.jar:7.1.1.Final]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_31]

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_31]

                      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_31]

            Caused by: java.lang.IllegalArgumentException: failed to start server socket

                      at org.jgroups.protocols.FD_SOCK.down(FD_SOCK.java:302) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.FD.down(FD.java:308) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.VERIFY_SUSPECT.down(VERIFY_SUSPECT.java:77) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.BARRIER.down(BARRIER.java:94) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.pbcast.NAKACK.down(NAKACK.java:526) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.UNICAST2.down(UNICAST2.java:485) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.pbcast.STABLE.down(STABLE.java:328) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.pbcast.GMS.down(GMS.java:916) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.FlowControl.down(FlowControl.java:351) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.FlowControl.down(FlowControl.java:351) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.FRAG2.down(FRAG2.java:147) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.stack.ProtocolStack.down(ProtocolStack.java:1033) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.JChannel.down(JChannel.java:730) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.JChannel.connect(JChannel.java:290) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.JChannel.connect(JChannel.java:261) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jboss.as.clustering.jgroups.subsystem.ChannelService.start(ChannelService.java:44) [jboss-as-clustering-jgroups-7.1.1.Final.jar:7.1.1.Final]

                      at org.jboss.as.clustering.msc.AsynchronousService$1.run(AsynchronousService.java:59) [jboss-as-clustering-common-7.1.1.Final.jar:7.1.1.Final]

                      ... 3 more

            Caused by: java.net.BindException: bind_addr /0.0.0.0 is not a valid interface: java.net.BindException: Address already in use: JVM_Bind

                      at org.jgroups.util.Util.createServerSocket(Util.java:3181) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.FD_SOCK.startServerSocket(FD_SOCK.java:562) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      at org.jgroups.protocols.FD_SOCK.down(FD_SOCK.java:299) [jgroups-3.0.6.Final.jar:3.0.6.Final]

                      ... 19 more

            • 3. Re: jgroups attempting to bind to 0.0.0.0 and failing when attempting to start a clustered instance?
              hatchetman82

              first of all thank yo uvery much François, that was indeed the issue.

              however - does this mean that its impossible to simply tell jboss to "listen to al interfaces" ? this would complicate deployment on multi-homed systems (i was aiming for something thet "just works")

              and henry - your issue seems to be that something else has already bound to the designated port - i dont think its the same

              • 4. Re: jgroups attempting to bind to 0.0.0.0 and failing when attempting to start a clustered instance?
                kazaag

                Henry,

                 

                Are you trying to start 2 JBoss on the same machine?  If it isn't the case there is some issue with your config.

                • 5. Re: jgroups attempting to bind to 0.0.0.0 and failing when attempting to start a clustered instance?
                  kazaag

                  You need some how provide the IP identifying the node to jGroup.

                   

                  You can use a different "interface" element for jGroup and keep the public to 0.0.0.0 for the other biding if you need the other elements to bind to all network interfaces.

                   

                  You could also use the "nic" type interface (didn't manage to make it work on Windows) to specify the interface name to use (more info here: https://docs.jboss.org/author/display/AS71/Admin+Guide#AdminGuide-Interfacesandports).

                  • 6. Re: jgroups attempting to bind to 0.0.0.0 and failing when attempting to start a clustered instance?
                    galnitzan

                    I know its an old post, however for the benefit of those that get to this page based on the Exception,

                     

                    adding -Djgroups.bind_addr=ip-address to the command that start jboss helped me.

                     

                    HTH,

                     

                    Gal Nitzan.

                    • 7. Re: jgroups attempting to bind to 0.0.0.0 and failing when attempting to start a clustered instance?
                      bobzer

                      Thank you, very helpful. After adding -Djgroups.bind_addr=127.0.0.1, cluster start working despite the presence of the parameter -b 0.0.0.0

                      • 8. Re: jgroups attempting to bind to 0.0.0.0 and failing when attempting to start a clustered instance?
                        aabajian

                        -Djgroups.bind_addr=127.0.0.1 also resolved my issue, thanks for this!!

                        • 9. Re: jgroups attempting to bind to 0.0.0.0 and failing when attempting to start a clustered instance?
                          andrewbgoode

                          Are you sure you want to use 127.0.0.1?  When I tried that, I effectively got a separate cluster for each node.  Instead, I had to use something like -Djgroups.bind_addr=`hostname -I` (Linux only).