1 2 Previous Next 21 Replies Latest reply on May 3, 2010 1:31 PM by timfox

    UDP Cluster Exception

    jbaruchs

      Hi, folks!

       

      First, thank you for the great product. Works like charm, except of one strange point.

      I have established UDP cluster according to the Chapter 38 (see the xmls below), and trying to start the exact same code on 2 different machines. One of them starts well, sends and recieves messages. On another one I get "Timed out waiting to receive initial broadcast from discovery group" exception.

      I wonder what it means, and why it appears so inconsistenly?

      Both machines runs WinXP, the second machine differs in having more than one network adapter, but local-bind-port should take care of it, shouldn't it?

       

      Thanks in advance, here are the configs:

      hornetq-configuration.xml

      {code:xml}<configuration xmlns="urn:hornetq"

                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                     xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd

                     urn:hornetq">

          <clustered>true</clustered>

       

          <broadcast-groups>

              <broadcast-group name="my-broadcast-group">

                  <local-bind-port>65432</local-bind-port>

                  <group-address>231.7.7.7</group-address>

                  <group-port>9876</group-port>           

                  <connector-ref connector-name="netty"/>

              </broadcast-group>

          </broadcast-groups>

       

          <discovery-groups>

              <discovery-group name="my-discovery-group">

                  <group-address>231.7.7.7</group-address>

                  <group-port>9876</group-port>

              </discovery-group>

          </discovery-groups>

       

          <connectors>

              <connector name="netty">

                  <factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>

                  <param key="host" value="${hornetq.remoting.netty.host:localhost}"/>

                  <param key="port" value="${hornetq.remoting.netty.port:5445}"/>

              </connector>

          </connectors>

       

          <cluster-connections>

              <cluster-connection name="my-cluster">

                  <address>jms</address>

                  <use-duplicate-detection>true</use-duplicate-detection>

                  <forward-when-no-consumers>false</forward-when-no-consumers>

                  <max-hops>1</max-hops>

                  <discovery-group-ref discovery-group-name="my-discovery-group"/>

              </cluster-connection>

          </cluster-connections>

       

          <acceptors>

             <acceptor name="netty">

                 <factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>

                 <param key="host" value="${hornetq.remoting.netty.host:localhost}"/>

                 <param key="port" value="${hornetq.remoting.netty.port:5445}"/>

             </acceptor>

          </acceptors>

       

          <security-settings>

               ....

          </security-settings>

       

          <address-settings>

              <address-setting match="#">

                  <redistribution-delay>0</redistribution-delay>

                  <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                  <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                  <redelivery-delay>0</redelivery-delay>

                  <max-size-bytes>-1</max-size-bytes>

                  <page-size-bytes>10485760</page-size-bytes>

                  <message-counter-history-day-limit>10</message-counter-history-day-limit>

             </address-setting>

          </address-settings>

       

          <paging-directory>${hornetq.data.dir}/paging</paging-directory>

          <bindings-directory>${hornetq.data.dir}/bindings</bindings-directory>

          <journal-directory>${hornetq.data.dir}/journal</journal-directory>

          <large-messages-directory>${hornetq.data.dir}/large-messages</large-messages-directory>

      </configuration>{code}

       

      hornetq-jms.xml

       {code:xml}<configuration xmlns="urn:hornetq"            
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd">

          <connection-factory name="NettyConnectionFactory">
              <discovery-group-ref discovery-group-name="my-discovery-group"/>
              <entries>
                  <entry name="/ConnectionFactory"/>
                  <entry name="/XAConnectionFactory"/>
              </entries>
              <connection-load-balancing-policy-class-name>
                  org.hornetq.api.core.client.loadbalance.RandomConnectionLoadBalancingPolicy
              </connection-load-balancing-policy-class-name>
          </connection-factory>

          <queue name="DLQ">
              <entry name="/queue/DLQ"/>
          </queue>
          <queue name="ExpiryQueue">
              <entry name="/queue/ExpiryQueue"/>
          </queue>
          <queue name="ExampleQueue">
              <entry name="/queue/ExampleQueue"/>
          </queue>
          <topic name="ExampleTopic">
              <entry name="/topic/ExampleTopic"/>
          </topic>
      </configuration>
      {code}
        • 1. Re: UDP Cluster Exception
          bjchip

          I discovered, when struggling with a jboss installation, that in JBoss the UDP setup connects (and will broadcast on) only the first non-loopback nic it finds (unless it is forced to go to the other adapter).

           

          So the Hornetq implementation MAY have that same limitation.   I am pretty sure it doesn't use both nics at the same time. 

           

          I think you can specify the address attached to the adapter to use.    I'll look for that now myself as I am curious. 

           

          respectfully

          BJ

          • 2. Re: UDP Cluster Exception
            jbaruchs

            Dunno. What do you say about the following paragraph from the manual? Is it somehow related?


            {quote:title=local-bind-address}This is the local bind address that the datagram socket is bound to. If you have multiple network interfaces on your server, you would specify which one you wish to use for broadcasts by setting this property. If this property is not specified then the socket will be bound to the wildcard address, an IP address chosen by the kernel.{quote}

            • 3. Re: UDP Cluster Exception
              bjchip

              Yeah... that's the one.   Hand it the IP of th NIC you want it to use.    Bear with me... I had to get the kids off to school and get breakfast.

               

              Then I have to dual home the VMs and re-order the nics...  naaa... you do it.  :-)

               

              respectfully

              BJ

              • 4. Re: UDP Cluster Exception
                bjchip

                Should be seeing the one with the problem is the one that is single-homed as the one broadcasting will be sending out the wrong nic.   I think.   No coffee yet.   Maybe think is too strong a word.  :-)

                 

                respectfully

                BJ

                • 5. Re: UDP Cluster Exception
                  jbaruchs

                  bjchip wrote:

                   

                  Yeah... that's the one.   Hand it the IP of th NIC you want it to use.    Bear with me... I had to get the kids off to school and get breakfast.

                   

                  Then I have to dual home the VMs and re-order the nics...  naaa... you do it.  :-)

                   

                  respectfully

                  BJ

                  Wait, how can I hand it the IP where it expects port? And the whole idea of UDP is avoiding hardcoded IPs in the config.

                  • 6. Re: UDP Cluster Exception
                    bjchip

                    I am pretty sure you hand it an IP address.  Won't it take one?

                     

                    The whole reason for using UDP in a single-homed situation is exactly what you say, but you can't do that multi-homed.  The stack can't be bound to more than one physical nic.   You really have to specify the nic.

                     

                    respectfully

                    BJ

                    1 of 1 people found this helpful
                    • 7. Re: UDP Cluster Exception
                      jbaruchs
                      Yap, it should be address, you right. The xml sample in the manual is inconsistent with the explanation text. I'll give it a try,although it sucks.
                      • 8. Re: UDP Cluster Exception
                        jbaruchs

                        Didn't work.

                        • 9. Re: UDP Cluster Exception
                          bjchip

                          Interesting.  I have a JBoss Cluster that can't find its two halves because it is using the 2nd of two nics (eth0 is in hosts and is mapped to IP addresses that can't be clustered, eth1 is same-subnet but not named).    

                           

                          I am getting messages through hornetq, but jboss is NOT clustering.  

                           

                          I can cluster it in TCP, I can cluster it with a single nic, I can cluster 5.1... but 4.2.3 in this environment doesn't do the job.  No matter what I set. 

                           

                          But the local-bind-address gave me messages across the two of them (with the resulting confusion being entirely too predictable).   :-)

                           

                          I know a lot more about this than I did even 2 days ago, but still not enough.

                           

                          BJ

                          • 10. Re: UDP Cluster Exception
                            bjchip

                            Hmmm.... I did however, create a new acceptor and connector pair on both sides.  Not localhost.

                             

                            BJ

                            • 11. Re: UDP Cluster Exception
                              jbaruchs

                              Never mind. Dropped the whole JMS stack in favor of Terracotta. Much lighter, much better monitoring and control.

                              • 12. Re: UDP Cluster Exception
                                timfox

                                ROFL.

                                 

                                Terracotta is a distributed caching system, not a messaging system. Completely different tools. If you were trying to make a messaging system play like a cache - well no wonder it didn't do what you want - it's a messaging system not a cache.

                                 

                                Lighter? What are you talking about? HornetQ has a very small footprint. It can deal with terabyte queues and gigabyte messages all while running in just a few tens of MiB of RAM.

                                 

                                HornetQ is also the #1 fastest JMS system in the market. Period. (I'll have more to say on this in a few weeks). Way faster performance than you'll ever get out of terracotta.

                                 

                                Controllable? HornetQ will have a fully fledged graphical management console in the next release

                                 

                                BTW, since you want a cache, not a messaging system, you should look at infinispan. Terracotta's architecture is fundamentally flawed since it basically has a single point of bottleneck so doesn't scale. The infinispan guys will have more to say on that.

                                 

                                Good luck

                                • 13. Re: UDP Cluster Exception
                                  jbaruchs

                                  Ah, I knew you'll kick in here. Sorting out UDP problems is much less interesting, right?

                                   

                                  Well, I need distributed queue. Both solutions should do the job. In JMS I do it with clustered messaging, with Terracotta I do it with shared queue.

                                  • 14. Re: UDP Cluster Exception
                                    timfox

                                    For one thing, any help you get here is done on an ad-hoc basis by community members. Remember you're getting it for free - don't expect everyone to just drop everything and immediately come rushing in to help you. Why are you more important than anyone else?

                                     

                                    Having a good attitude helps too. Rushing in as a stranger, posting a long chain of "stream of consciousness" posts, not asking direct questions, saying things "suck" and storming out again will win you no friends and, like any community, you'll probably get the cold shoulder. Hardly surprising right?

                                     

                                    On the other hand, show a constructive attitude, ask clear concise questions, be friendly and helpful and you'll find people will be very welcoming, and will want to actually help you out with your perceived problems (which probably are just configuration issues).

                                     

                                    Best regards.

                                    1 2 Previous Next