[[http://tmade.de|Home tmade.de]] [[http://wiki.tmade.de|Home Wiki]] ===== Linux-HA (heartbeat) ==== ==== General Linux-HA ==== http://www.linux-ha.org/Heartbeat http://www.linux-ha.org/wiki/Main_Page ==== Configuration ==== Resource configuration files: /var/lib/heartbeat/crm/cib.xml Heartbeat Initscript: /usr/lib/ocf/resource.d/heartbeat/ ==== Commandline ==== crm_mon –i 2 #Overview Nodes/ Ressources with 2-sec-update cibadmin -E --force #Delete the complete HA-Configuration (resources) cibadmin -U -x /etc/ha.d/pen.xml #Update changes on HA-Config-File crm_resource -r resourcename -M -H target_host #Manual move of a resource crm_resource -r resourcename -C -H target_host #Delete status ob problems for a resource (unmanaged etc.) Example: crm_resource -r group_apache2 -M -H node1 #Move resource "group_apache2" to Node "node1" To stop a resource temporary via cmd: crm_resource --meta -r -p target_role -v stopped To start a resource if heartbeat is running: crm_resource --meta -r -p target_role -v started crm_resource --meta -r squid -p target_role -v started To stop an unmanaged ressource/ clear ressource status: crm_resource -r -C -H node To delete a running ressource permanentely: cibadmin -D -X '' cibadmin -D -X '' ==== Example Heartbeat-Config-File (ha.cf) ==== Heartbeat configuration: /etc/ha.d/ha.cf udpport 694 auto_failback on keepalive 2 deadtime 30 warntime 10 ping 10.0.0.1 #deadping 20 use_logd yes #autojoin any autojoin none crm true ucast eth1 10.0.0.5 ucast eth1 10.0.0.6 #ucast eth0 192.168.232.17 #ucast eth0 192.168.232.18 node nodename1 node nodename2 respawn root /usr/lib64/heartbeat/pingd -m 100 -d 5s -a pingd apiauth ping gid=root uid=root ==== Example Config-File (*.xml) ==== ==== Example "Tomcat" ==== Example heartbeat (ocf) configuration for tomcat: [[server:tomcat#ocf-script|Tomcat-OCF]]