From VVCWiki
Jump to navigationJump to search

Configuration files

  • /etc/hosts		localhost		c20.chepkov.lan c20		c21.chepkov.lan c21
  • /etc/ha.d/ha.cf
crm yes
use_logd on
udpport 694
bcast eth0
keepalive 1
warntime 5
deadtime 15
initdead 60
node c20.chepkov.lan
node c21.chepkov.lan
# Ping default host
respawn root /usr/lib64/heartbeat/pingd -m 200 -d 5
deadping 10
  • /etc/ha.d/authkeys
auth 1
1 sha1 3c2749538df51665ad8dfab76a6d90f7
chmod 0600 /etc/ha.d/authkeys
  • /var/lib/heartbeat/crm/cib.xml
<cib admin_epoch="0" num_updates="1" epoch="1" >
  • /etc/logd.conf
logfacility	local2
  • /etc/syslog.conf
local2.*						/var/log/heartbeat.log
touch /var/log/heartbeat.log

Initial configuration

  • crm_config
crm_attribute --attr-name symmetric-cluster --attr-value true
crm_attribute --attr-name default-resource-stickiness --attr-value 1000
crm_attribute --attr-name stonith-enabled --attr-value false
  • constraints


  <rsc_location id="location_rg0" rsc="rg0">
    <rule id="prefered_location_rg0" score="100">
      <expression attribute="#uname" operation="eq" value="c20.chepkov.lan"/>
  <rsc_location id="location_rg1" rsc="rg1">
    <rule id="prefered_location_rg1" score="100">
      <expression attribute="#uname" operation="eq" value="c21.chepkov.lan"/>
  <rsc_location id="rg0-needs-ping" rsc="rg0">
    <rule score="-INFINITY" boolean_op="or">
      <expression attribute="pingd" operation="not_defined"/>
      <expression attribute="pingd" operation="lte" value="0"/>
  <rsc_location id="rg1-needs-ping" rsc="rg1">
    <rule score="-INFINITY" boolean_op="or">
      <expression attribute="pingd" operation="not_defined"/>
      <expression attribute="pingd" operation="lte" value="0"/>


cibadmin -R -o constraints -x constraints.xml
  • resources
   <group id="rg0">
     <primitive id="ip_rg0" class="ocf" type="IPaddr2" provider="heartbeat">
           <nvpair name="ip" value=""/>
           <nvpair name="nic" value="eth0"/>
           <nvpair name="cidr_netmask" value=""/>
     <primitive id="drbd_u00" class="heartbeat" type="drbddisk" provider="heartbeat">
           <nvpair name="1" value="u00"/>
     <primitive id="fs_u00" class="ocf" type="Filesystem" provider="heartbeat">
           <nvpair name="device" value="/dev/drbd0"/>
           <nvpair name="directory" value="/u00"/>
           <nvpair name="fstype" value="ext3"/>
           <nvpair name="options" value="noatime"/>
cibadmin -R -o resources -x resources.xml

Heartbeat Cluster operations

  • check cluster status
crm_mon -1 -r
  • Migrate Resource group to specific node without creating constraint
crm_resource -M -f -Q -r rg0 -H c20.chepkov.lan

Wait until resource will be migrated, then

crm_resource -U -r rg0
  • Mark resource unmanageable by cluster
crm_resource -p is_managed -r apache_svn -t primitive -v off
  • Stop resource
crm_resource --meta -r rg0 -p target_role -v stopped
  • Remove stopped role
crm_resource --meta -r rg0 -d target_role