4 Replies Latest reply on Aug 31, 2007 12:14 PM by David M

    Making 1 Jboss listen to 2 IPs

    David M Newbie

      I'm using JBoss 4.2 together with a LVS Ultramonkey load balancing setup. My Jboss nodes have a virtual IP assigned, as well as the machine's true IP. I need my JBoss instance to listen and respond to both IPs.

      I have tried using -b 0.0.0.0, but that seems to cause JBoss clustering to fail.

      I could use either of two solutions:
      1. A way for clustering to work while JBoss listens on 0.0.0.0 (all interfaces)
      2. A way for JBoss to listen on two specific IPs.

      I've been unable to find documentation on this, and would really appreciate it if anyone could give me some pointers.

      Thanks,
      David

        • 2. Re: Making 1 Jboss listen to 2 IPs
          David M Newbie

          Thank you, I read the link, and have tried adding the following attributes to my in cluster-service.xml

          bind_addr="192.168.128.100"
          receive_on_all_interfaces="true"
          send_on_all_interfaces="true"

          But I still see clustering errors. My machine is 192.168.128.100, and the other machine in the cluster is 192.168.128.83. They are both started with ./run.sh -b 0.0.0.0 -c all --partition=DefaultPartition -u 228.1.2.6, and both have made the changes above to cluster-service.xml. If I start the servers with the -b parameter as the true IP (192.168.128.100 and .83) then clustering works. If 0.0.0.0, then I see these errors:

          ERROR [UDP] failed sending message to 192.168.128.83:32961 (0 bytes)
          java.io.IOException: Invalid argument
          at java.net.PlainDatagramSocketImpl.send(Native Method)
          at java.net.DatagramSocket.send(DatagramSocket.java:612)
          at org.jgroups.protocols.UDP._send(UDP.java:338)
          at org.jgroups.protocols.UDP.sendToSingleMember(UDP.java:299)
          at org.jgroups.protocols.TP.doSend(TP.java:940)
          at org.jgroups.protocols.TP.send(TP.java:926)
          at org.jgroups.protocols.TP.down(TP.java:712)
          at org.jgroups.stack.Protocol.receiveDownEvent(Protocol.java:517)
          at org.jgroups.stack.Protocol.passDown(Protocol.java:551)
          at org.jgroups.protocols.Discovery.up(Discovery.java:246)
          at org.jgroups.stack.Protocol.receiveUpEvent(Protocol.java:488)
          at org.jgroups.stack.Protocol.passUp(Protocol.java:538)
          at org.jgroups.protocols.TP.handleIncomingMessage(TP.java:908)
          at org.jgroups.protocols.TP.handleIncomingPacket(TP.java:850)
          at org.jgroups.protocols.TP.access$400(TP.java:45)
          at org.jgroups.protocols.TP$IncomingPacketHandler.run(TP.java:1296)
          at java.lang.Thread.run(Thread.java:595)


          Any more tips, help, links appreciated,
          David

          • 3. Re: Making 1 Jboss listen to 2 IPs
            Brian Stansberry Master

            Give this a try:

            ./run.sh -b 0.0.0.0 -c all --partition=DefaultPartition -u 228.1.2.6 -Djgroups.bind.address=192.168.128.100

            If you use -b 0.0.0.0, JBoss will assign InetAddress.getLocalHost().getHostName() to system property jgroups.bind.address, and that will take precedence over your XML value. Directly assigning the system property will override that.

            • 4. Re: Making 1 Jboss listen to 2 IPs
              David M Newbie

              Thanks for the advice!

              Actually, I think my problem was in trying to set JBoss's IP, when all I wanted to do was set Tomcat's listening IPs. If I keep running jboss's run.sh with the system's IP for -b, but edit the jboss-web.deployment/server.xml file so that the elements don't specify an IP, then Tomcat will listen on all ports, but JBoss's clustering will run as normal.

              Thanks for the help!
              David