{"id":390,"date":"2010-10-24T20:58:33","date_gmt":"2010-10-24T19:58:33","guid":{"rendered":"http:\/\/kudzia.eu\/b\/?p=390"},"modified":"2011-04-30T10:22:10","modified_gmt":"2011-04-30T09:22:10","slug":"heartbeat-generic-ha-configuration","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2010\/10\/heartbeat-generic-ha-configuration\/","title":{"rendered":"heartbeat &#8211; generic HA configuration"},"content":{"rendered":"<p>few configuration files i use on highly-available active-standby clusters running under debian.<br \/>\n<!--more--><\/p>\n<p>my very simplistic heartbeat setup  [ under debian ] consists of two servers:<\/p>\n<ul>\n<li>ser0 [preferred active node] with permanently assigned 10.0.0.2\/24 at eth0<\/li>\n<li>ser0b [hot-standby node waiting to replace master] with permanently assigned 10.0.0.3\/24 at eth0<\/li>\n<\/ul>\n<p>&#8216;floating ip&#8217; &#8211; assigned to the active node is 10.0.1.1\/24 assigned to eth1<\/p>\n<p>in this case service that gets high availability is apache. i separately sync apache&#8217;s configs and content that is served from ser0 to ser0b.<\/p>\n<p>files below are identical on both machines with one marked exception:<\/p>\n<p>\/etc\/ha.d\/authkeys:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nauth 1\r\n1 md5 somethingrandom\r\n<\/pre>\n<p>\/etc\/ha.d\/haresources<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nser0 ha.sh\r\n<\/pre>\n<p>\/etc\/ha.d\/ha.cf<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nkeepalive 2\r\ndeadtime 10\r\nudpport        694 \r\n; below - address permanently assigned to the peer node . this is for master:\r\nucast eth1 10.0.0.3\r\n; and on slave i have \r\n; ucast eth1 10.0.0.2\r\nudp     eth0\r\nlogfacility     local0\r\nauto_failback on\r\n\r\nnode    ser0\r\nnode    ser0b\r\n<\/pre>\n<p>\/etc\/init.d\/ha.cf <\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n#!\/bin\/bash\r\ncase &amp;quot;$1&amp;quot; in\r\n  start)\r\n        ip link set dev eth1 up\r\n        # bind 'floating' ip to the interface\r\n        ip a a 10.0.1.1\/24 dev eth1\r\n        # you might want to add some route-changes here if needed\r\n        \/usr\/lib\/heartbeat\/send_arp -r 10 eth1 10.0.0.1 auto 10.0.0.255 255.255.255.0\r\n        # to make sure apache reloads it's config when machine becomes master\r\n        \/etc\/init.d\/apache2 restart\r\n  ;;\r\n\r\n  stop)\r\n        # we are no longer active, un-bind 'floating' ip from the interface\r\n        ip a d 10.0.1.1\/24 dev eth1\r\n        # you could stop it as well or just skip this step\r\n        \/etc\/init.d\/apache2 restart\r\n  ;;\r\nesac\r\nexit 0\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>few configuration files i use on highly-available active-standby clusters running under debian.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-390","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/390","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=390"}],"version-history":[{"count":3,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/390\/revisions"}],"predecessor-version":[{"id":572,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/390\/revisions\/572"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}