7 Replies Latest reply on Jan 2, 2013 10:59 AM by Justin Bertram

    Two clusters on same network

    Alexander Hartner Expert

      I would like to run two (or more) hornetq clusters on the same network. Initially I was hoping that simply having different data directories would be sufficient, however this does not seem to be the case as messages were distributed across all servers. I then changed the cluster-connection name on one of the clusters from mycluster to my-other-cluster

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

      However messages were still being distributed between the clusters.  Only once I changed the discovery-group name did message remain on their respective cluster.

      <discovery-groups>

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

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

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

            <refresh-timeout>10000</refresh-timeout>

          </discovery-group>

        </discovery-groups>

       

        <cluster-connections>

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

            <address>jms</address>

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

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

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

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

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

          </cluster-connection>

        </cluster-connections>

      This suggests that the discovery-group name is sufficient to distinguish between clusters. I want to confirm that this is the case and that this is the minimum amount of change to the configuration to ensure each cluster can run independenly of each other, while still being able to discover and access nodes within the same cluster.