RH Cluster suite

From Tuxunix
Jump to: navigation, search

Prérequis

  • Réseau
IP Port Number
Port Number Protocol Compenent
5404, 5405 UDP corosync/cman (Cluster Manager)
11111 TCP ricci (propagates updated cluster information)
21064 TCP dlm (Distributed Lock Manager)
16851 TCP modclusterd
  • Stockage :

San ou SCSI + Quorum

Installation

#> yum install rgmanager ricci ccs
  • Init du password pour ricci
#> passwd ricci
  • Création du quorum :
#> mkqdisk -c /dev/mapper/mpathXX -l QUORUM-DISK
  • Info quorum :
#> mkqdisk -L -d
mkqdisk v0.6.0
/dev/dm-18:
/dev/mapper/mpath11:
/dev/mpath/360060e80167bcc0000017bcc00003022:
       Magic:                eb7a62c2
       Label:                QUROUM-DISK
       Created:              Tue Mar 24 11:53:17 2015
       Host:                 srv1
       Kernel Sector Size:   512
       Recorded Sector Size: 512

Configuration

LVM

vi /etc/lvm/lvm.conf

modifier les lignes :

filter = [ "a|/dev/cciss/.*|", "a|/dev/mapper/mpath.*|", "r|.*|" ]
volume_list = [ "rootvg", "vg_projet", "@<cluster node name>" ]
dracut --force
filter = [ "a|/dev/cciss/.*|", "a|/dev/mapper/mpath.*|", "r|.*|" ]
volume_list = [ "rootvg", "vg_projet", "@<cluster node name>" ]
dracut --force

Vérification de la conf :

[root@srv1 ~]# egrep "^[ ]*locking_type|^[ ]*volume_list|^[ ]*filter =" /etc/lvm/lvm.conf
filter = [ "a|/dev/cciss/.*|", "a|/dev/mapper/mpath.*|", "r|.*|" ]
locking_type = 1
volume_list = [ "rootvg", "vg_projet", "@<cluster node name>" ]

Fichier Hosts

[root@psu789 ~]# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
X.X.X.X srv1 

X.X.X.X srv1-cl
X.X.X.X srv2-cl

Fichier Cluster

<cluster config_version="4" name="<Cluster name>">
    <logging logfile_priority="info" syslog_priority="notice"/>
    <fence_daemon/>
         <clusternodes>
              <clusternode name="<serveur 1>-cl" nodeid="1">
                   <fence>
                        <method name="fence_par_<serveur 1>-cons">
                             <device name="<serveur 1>-cons"/>
                        </method>
                   </fence>
         </clusternode>
         <clusternode name="<serveur 2>-cl" nodeid="2">
              <fence>
                   <method name="fence_par_<serveur 2>-cons">
                        <device name="<serveur 2>-cons"/>
                   </method>
              </fence>
         </clusternode>
         </clusternodes>
    <cman expected_votes="3"/>
    <fencedevices>
         <fencedevice agent="fence_ilo" delay="10" ipaddr="<ip console serveur 1>" lanplus="1" login="<user console>" name="<serveur 1>-cons" passwd="<passwd user console>" power_wait="4"/>
         <fencedevice agent="fence_ilo" delay="1" ipaddr="<ip console serveur 2>" lanplus="1" login="<user console>" name="<serveur 2>-cons" passwd="<passwd user console>" power_wait="4"/>
    </fencedevices>
    <rm>
    <failoverdomains>
         <failoverdomain name="<Cluster name>" nofailback="1" ordered="0" restricted="0">
              <failoverdomainnode name="<serveur 1>-cl"/>
              <failoverdomainnode name="<serveur 2>-cl"/>
         </failoverdomain>
    </failoverdomains>
    <resources/>
    <service autostart="0" domain="<Cluster name>" exclusive="0" name="<>" recovery="relocate">
              <lvm name="lvm_<>" vg_name="<vg name>"/>
              <fs device="/dev/<vg name>/<lv name>" force_fsck="0" force_unmount="1" fstype="ext4" mountpoint="<point de montage>" name="<nom lv user friendly>" options="" self_fence="0"/>
              <ip address="<ip package>" monitor_link="1"/>
    </service>
    </rm>
    <totem token="60000"/>
    <quorumd allow_kill="0" interval="3" label="<label Quorum Disk>" reboot="0" tko="8" votes="1"/>
</cluster>

Commandes

clustat

#> clustat
Cluster Status for CL-TEST @ Tue Mar 24 17:01:17 2015
Member Status: Quorate

Member Name                                              ID   Status
------ ----                                              ---- ------
srv1-cl                                                    1 Online, Local
srv2-cl                                                    2 Online
/dev/dm-18                                                 0 Online, Quorum Disk

cman_tool

#> cman_tool status
Version: 6.2.0
Config Version: 4
Cluster Name: CL-TEST
Cluster Id: 8638
Cluster Member: Yes
Cluster Generation: 8
Membership state: Cluster-Member
Nodes: 2
Expected votes: 3
Quorum device votes: 1
Total votes: 3
Node votes: 1
Quorum: 2
Active subsystems: 9
Flags: Dirty
Ports Bound: 0 178
Node name: srv1-cl
Node ID: 1
Multicast addresses: 239.192.33.223
Node addresses: 158.157.92.223

fence_tool

#> /sbin/fence_tool -h
Usage:
fence_tool <join|leave|dump|dumpconfig|readconfig> [options]

Actions:
 join             Join the default fence domain
 leave            Leave default fence domain
 dump             Dump debug buffer from fenced

Options:
 -m <n>           Delay join up to n seconds for all nodes in cluster.conf
                  to be cluster members
 -w               Wait for join to complete
 -V               Print program version information, then exit
 -h               Print this help, then exit
 -t <n>           Maximum time in seconds to wait
 -Q               Fail if cluster is not quorate, don't wait

Troubleshooting

  • Les votes :

1 noeud = 1 vote

1 quorum = 1 vote