02-11-2013 | Remy van Elst | Text only version of this article
What the hell are all the components?
Resource Agents: Scripts that know how to control various services
Pacemaker is the thing that starts and stops services (like your database or mail server) and contains logic for ensuring both that they are running, and that they are only running in one location (to avoid data corruption).
But it cant do that without the ability to talk to instances of itself on the other node(s), which is where Heartbeat and/or Corosync come in.
Think of Heartbeat and Corosync as dbus but between nodes. Somewhere that any node can throw messages on and know that they'll be received by all its peers. This bus also ensures that everyone agrees who is (and is not) connected to the bus and tells Pacemaker when that list changes.
If you want to make sure that the commands below execute on all cluster nodes, append the
-w parameter to the crm command, it stands for
wait. Like so:
crm -w resource stop virtual-ip.
crm_mon --one-shot -V
Execute on node you want to put in standby.
crm node standby
Put node online again (after standby)
Execute on node you want to put online again.
crm node online
If you want to put a node online or in standby from another cluster node, append the node name to the commands above, like so:
crm node standby NODENAME
crm configure property stonith-enabled=false
crm configure primitive failover-ip ocf:heartbeat:IPaddr2 params ip=10.0.2.10 cidr_netmask=32 op monitor interval=10s
This tells Pacemaker three things about the resource you want to add. The first field, ocf, is the standard to which the resource script conforms to and where to find it. The second field is specific to OCF resources and tells the cluster which namespace to find the resource script in, in this case heartbeat. The last field indicates the name of the resource script.
crm ra classes
heartbeat lsb ocf / heartbeat pacemaker stonith
crm ra list ocf pacemaker
ClusterMon Dummy HealthCPU HealthSMART Stateful SysInfo SystemHealth controld o2cb ping pingd
crm ra list ocf heartbeat
AoEtarget AudibleAlarm CTDB ClusterMon Delay Dummy EvmsSCC Evmsd Filesystem ICP IPaddr IPaddr2 IPsrcaddr IPv6addr LVM LinuxSCSI MailTo ManageRAID ManageVE Pure-FTPd Raid1 Route SAPDatabase SAPInstance SendArp ServeRAID SphinxSearchDaemon Squid Stateful SysInfo VIPArip VirtualDomain WAS WAS6 WinPopup Xen Xinetd anything apache conntrackd db2 drbd eDir88 ethmonitor exportfs fio iSCSILogicalUnit iSCSITarget ids iscsi jboss ldirectord lxc mysql mysql-proxy nfsserver nginx oracle oralsnr pgsql pingd portblock postfix proftpd rsyncd scsi2reservation sfex symlink syslog-ng tomcat vmware
crm configure primitive apache-ha ocf:heartbeat:apache params configfile=/etc/apache2/apachd2.conf op monitor interval=1min
crm configure colocation apache-with-ip inf: apache-ha failover-ip
crm configure order apache-after-ip mandatory: failover-ip apache-ha
crm resource stop $`RESOURCENAME
crm configure delete $RESOURCENAME
crm node delete $NODENAME
crm configure property stop-all-resources=true
crm resource cleanup $RESOURCENAME
crm configure erase
crm configure property no-quorum-policy=ignore
crom configure rsc_defaults resource-stickiness=100
In order to be able to bind on a IP which is not yet defined on the system, we need to enable non local binding at the kernel level.
echo 1 > /proc/sys/net/ipv4/ip_nonlocal_bind
Add this to
net.ipv4.ip_nonlocal_bind = 1