How to Configure cluster.conf Active Active Cluster

#system-config-cluster Graphical Window Interface.
we can create the cluster.conf file.

1)Create the Failover Domain
Creates Nodes with Priority.
2)Create the Resource
3)Create the the service.
3.1)Add the Resource To the Service then 
3.2)add Fail over Domain(nodes with priority).
4)1 is Higher Priority.

How to Read cluster.conf file in Fail over Domain.
1) Check the service tag
service it will try to start their service in theFail over domain.
2.1)In the Failover domain which node has highest Priority.
In that highest priority Node it will try to start their service.
2.2)If the Highest Priority node is Down, 
THEN -- It will check the next Lowest priority node.
IF LOWEST PRIORTY  Node UP then --It will run that service at lowest priority node,
when will  the Highest priority node is up. In that Time
without Human interaction service will automatically migrate from the Lowest Priority Node to Highest Priority Node.

Example of Cluster.conf file
<?xml version="1.0" ?>
<cluster config_version="9" name="Test_cluster">
    <fence_daemon post_fail_delay="0" post_join_delay="3"/>
    <clusternodes>
        <clusternode name="hn1.redhat.com" nodeid="1" votes="1">
            <fence/>
        </clusternode>
        <clusternode name="hn2.redhat.com" nodeid="2" votes="1">
            <fence/>
        </clusternode>
    </clusternodes>
    <cman expected_votes="1" two_node="1"/>
    <fencedevices/>
    <rm>
        <failoverdomains>
            <failoverdomain name="first" ordered="1" restricted="0">
                <failoverdomainnode name="hn1.redhat.com" priority="1"/>
                <failoverdomainnode name="hn2.redhat.com" priority="2"/>
            </failoverdomain>
            <failoverdomain name="second" ordered="1">
                <failoverdomainnode name="hn1.redhat.com" priority="2"/>
                <failoverdomainnode name="hn2.redhat.com" priority="1"/>
            </failoverdomain>
        </failoverdomains>
        <resources>
            <ip address="151.8.18.55" monitor_link="1"/>
            <ip address="151.8.18.56" monitor_link="1"/>
        </resources>

        <service autostart="1" domain="first" name="IP Address-55" recovery="relocate">
            <ip ref="151.8.18.55"/>
        </service>
        <service autostart="1" domain="second" name="IP Address -56" recovery="relocate">
            <ip ref="151.8.18.56"/>
        </service>
    </rm>
</cluster>

Failover Domain
1)hn1.redhat.com
2)hn2.redhat.com

Resource
1)IP Address 151.8.18.55
2)IP Address 151.8.18.56

Service 
1)IP Address -55
2)IP Address -56

Update The Cluster.conf file
# ccs_tool update /etc/cluster/cluster.conf
Config file updated from version 27 to 28
Update complete.

# cman_tool nodes
Node  Sts   Inc   Joined               Name
   1   M    632   2011-09-16 06:26:53  hn1.redhat.com
   2   M    636   2011-09-16 06:26:53  hn2.redhat.com

#ip addr list -- Get the virtual Ip Address
------------------------------------------------------
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 08:00:27:06:76:c7 brd ff:ff:ff:ff:ff:ff
    inet 151.8.18.53/16 brd 151.8.255.255 scope global eth0
    inet 151.8.18.55/16 scope global secondary eth0
    inet6 fe80::a00:27ff:fe06:76c7/64 scope link 

# clustat -l
Cluster Status for Test_cluster @ Fri Sep 16 06:44:36 2011
Member Status: Quorate
 Member Name                             ID   Status
 ------ ----                             ---- ------
 hn1.redhat.com                                 1 Online, Local, rgmanager
 hn2.redhat.com                                 2 Online, rgmanager
Service Information
------- -----------
Service Name      : service:File system Mounting
  Current State   : started (112)
  Flags           : none (0)
  Owner           : hn2.redhat.com
  Last Owner      : hn1.redhat.com
  Last Transition : Fri Sep 16 06:19:27 2011

Service Name      : service:IP Address
  Current State   : started (112)
  Flags           : none (0)
  Owner           : hn1.redhat.com
  Last Owner      : hn2.redhat.com
  Last Transition : Fri Sep 16 06:27:18 2011

Relocate the Service
-r Resource
-m Node
#clusvcadm -r service-name -m host-name
# clusvcadm -r "IP Address-55" -m hn2.redhat.com
Trying to relocate service:IP Address to hn2.redhat.com...Success
service:IP Address is now running on hn2.redhat.com

#watch clustat
Update the Cluster Status

Mount the NFS
</resource><netfs export="/home/jkumar" force_unmount="0" fstype="nfs" host="151.8.18.46" mountpoint="/mnt" name="NFS" options=""/>
Mount Disk
</filesystem><fs device="/dev/sdb1" force_fsck="0" force_unmount="0" fsid="41420" fstype="ext3" mountpoint="/mnt1" name="sdb" options="" self_fence="0"/>

Related post