Getting High With Lenny - Page 4
On this page
Heartbeat
HeartBeat man pages
We will be using heartbeat R1-style configuration here simply because I don't understand the R2 xml based syntax, if you do it is recomended to use the R2 style. First add the other node in the hosts file of both nodes so we can have an easier naming scheme. So for node1 do
nano /etc/hosts
and add node2:
192.168.1.200 node2
nano /etc/ha.d/ha.cf
autojoin none #crm on #enables heartbeat2 cluster manager - we want that! use_logd on logfacility syslog keepalive 1 deadtime 10 warntime 10 udpport 694 auto_failback on #resources move back once node is back online mcast eth0 239.0.0.43 694 1 0 bcast eth1 node node1 #hostnames of the nodes node node2
nano /etc/ha.d/authkeys
auth 3 3 md5 failover ## this is just a string, enter what you want ! auth 3 md5 uses md5 encryption
chmod 600 /etc/ha.d/authkeys
Set up some keys so both nodes can log in to each other (defaults, no passphrase):
ssh-keygen
Then copy over the public keys:
scp /root/.ssh/id_rsa.pub 192.168.1.100:/root/.ssh/authorized_keys
scp /root/.ssh/id_rsa.pub 192.168.1.200:/root/.ssh/authorized_keys
If both hosts files know where they can find each other we only need to do this on node1 and can update node2 like so:
/usr/lib/heartbeat/ha_propagate