<?xml version="1.0"?>
<!--
This is an example of a cluster.conf file to run qpidd under rgmanager.
This example assumes a 3 node cluster, with nodes named mrg32, mrg34 and mrg35.
There is no fencing in this configuration.
-->

<cluster alias="qpid-hot-standby" config_version="4" name="qpid-hot-standby">
  <!-- The cluster has 3 nodes. Each has a unique nodid and one vote for quorum. -->
  <clusternodes>
    <clusternode name="mrg32" nodeid="1">
      <fence/>
    </clusternode>
    <clusternode name="mrg34" nodeid="2">
      <fence/>
    </clusternode>
    <clusternode name="mrg35" nodeid="3">
      <fence/>
    </clusternode>
  </clusternodes>
  <cman/>
  <!-- Optionally you can specify logging, this is the most verbose -->
  <rm log_level="7" log_facility="daemon">

    <!--
	There is a failoverdomain for each node containing just that node.
	This lets us stipulate that the qpidd service should always run on all nodes.
    -->
    <failoverdomains>
      <failoverdomain name="mrg32-domain" restricted="1">
	<failoverdomainnode name="mrg32"/>
      </failoverdomain>
      <failoverdomain name="mrg34-domain" restricted="1">
	<failoverdomainnode name="mrg34"/>
      </failoverdomain>
      <failoverdomain name="mrg35-domain" restricted="1">
	<failoverdomainnode name="mrg35"/>
      </failoverdomain>
    </failoverdomains>

    <resources>
      <!-- This script starts a qpidd broker acting as a backup. -->
      <script file="/etc/init.d/qpidd" name="qpidd"/>

      <!-- This script promotes the qpidd broker on this node to primary. -->
      <script file="/etc/init.d/qpidd-primary" name="qpidd-primary"/>

      <!-- This is a virtual IP address for broker replication traffic. -->
      <ip address="20.0.10.200" monitor_link="1"/>

      <!-- This is a virtual IP address on a seprate network for client traffic. -->
      <ip address="20.0.20.200" monitor_link="1"/>
    </resources>

    <!-- There is a qpidd service on each node, it should be restarted if it fails. -->
    <service name="mrg32-qpidd-service" domain="mrg32-domain" recovery="restart">
      <script ref="qpidd"/>
    </service>
    <service name="mrg34-qpidd-service" domain="mrg34-domain" recovery="restart">
      <script ref="qpidd"/>
    </service>
    <service name="mrg35-qpidd-service" domain="mrg35-domain"  recovery="restart">
      <script ref="qpidd"/>
    </service>

    <!-- There should always be a single qpidd-primary service, it can run on any node. -->
    <service name="qpidd-primary-service" autostart="1" exclusive="0" recovery="relocate">
      <script ref="qpidd-primary"/>
      <!-- The primary has the IP addresses for brokers and clients. -->
      <ip ref="20.0.10.200"/>
      <ip ref="20.0.20.200"/>
    </service>
  </rm>
  <fencedevices/>
  <fence_daemon clean_start="0" post_fail_delay="0" post_join_delay="3"/>
</cluster>

