3 Replies Latest reply on Jun 10, 2011 8:23 AM by benbrowning

    Example config for a symmetric cluster with no discovery?

    codefinger

      Can someone provide me with an example of the hornetq-jms.xml and hornetq-configuration.xml required for symmetric clustering with no discovery?

       

      I have been trying to follow the docs here to set this up:

      http://hornetq.sourceforge.net/docs/hornetq-2.1.2.Final/user-manual/en/html/clusters.html

       

      But I just cannot figure it out.  There are references to the <connection-factory> in the hornetq-jms.xml and <cluster-connections> in hornetq-configuration.xml.  And its unclear what is supposed to go in each.  RIght now i have a hornetq-configuration.xml like this on (for example) node-a in my cluster:

       

      <cluster-connections>

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

              <address>jms</address>

              <connector-ref connector-name="node-b"

                  backup-connector-name="node-a"/>

              <connector-ref connector-name="node-c"

                  backup-connector-name="node-a"/>

          </cluster-connection>

      </cluster-connections>

       

      and a hornetq-jms.xml like this:

       

         <connection-factory name="ConnectionFactory">

            <connectors>

              <connector-ref connector-name="node-a"/>

            </connectors>

            <entries>

               <entry name="ConnectionFactory"/>

            </entries>

         </connection-factory>

       

      The most success I've had is that 3 of the instances in my 4 node cluster receive a message, but the one that initiated it does *not* receive it!

       

      I did seem to have it working at one point - where all nodes received messages.  But once I set up my deploy scripts, i must have lost something critical. 

       

      I would just love a working example of these two files.

       

      Thanks!

       

      Joe

        • 1. Re: Example config for a symmetric cluster with no discovery?
          ataylor

          if you download 2.2.2 it has this exact example shipped

          • 2. Re: Example config for a symmetric cluster with no discovery?
            codefinger

            Is the clustered-static-discovery example the one you are refering to?  it appears to use an element <static-connectors> that is not present in 2.1.2 (which I'm using via Torquebox). 

             

               <cluster-connections>

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

                     <address>jms</address>

                     <connector-ref>netty-connector</connector-ref>

                     <retry-interval>500</retry-interval>

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

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

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

                     <static-connectors>

                        <connector-ref>server1-connector</connector-ref>

                     </static-connectors>

                  </cluster-connection>

               </cluster-connections>

             

            What is the equivelent to this in 2.1.2 hornetq-configuration.xml?

             

            Also, is that example symmetric?  it appears server1-3 are connecting to server0 only.

             

            Thanks!

            • 3. Re: Example config for a symmetric cluster with no discovery?
              benbrowning

              Yes, that example should be symmetric. If you take a look at the clustered-static-oneway example you'll see that it uses <static-connectors allow-direct-connections-only="true">. As I understand it, allow-direct-connections-only defaults to false and when false it means the cluster will discover other members without needing a <connector-ref> element for each member of the cluster. I don't think any harm would come from adding the extra <connector-ref> elements for each server though.