本文共 3025 字,大约阅读时间需要 10 分钟。
For the sample configuration we will have two nodes called ha01 and ha02, and we will service an IP address, that we will call the Virtual IP address (VIP), on anactive / passive configuration. Both nodes will need to have name resolution configured either through DNS or the /etc/hosts file.
First of all, we need to add the repositories to be able to install heartbeat. We add the following to /etc/apt/sources.list
deb http://ppa.launchpad.net/ubuntu-ha/ppa/ubuntu karmic maindeb-src http://ppa.launchpad.net/ubuntu-ha/ppa/ubuntu karmic main
Then, we issue the following:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com B64F0AFA
Now, we can install pacemaker-heartbeat:
sudo apt-get update && sudo apt-get install pacemaker-heartbeat
Pacemaker-Heartbeat needs 3 main configuration files. These are /etc/ha.d/authkeys, /etc/ha.d/ha.cf, and /var/lib/heartbeat/crm/cib.xml. There is a fourth configuration file, /etc/logd.cf, which contains the log settings.
auth 11 md5 DesiredPassword
sudo chmod 600 /etc/ha.d/authkeys
logfile /var/log/ha-log
or do as root
sed -e 's/#logfile*/logfile/' /usr/share/doc/heartbeat/logd.cf > /etc/logd.cf
use_logd onudpport 694keepalive 2warntime 15deadtime 30initdead 30mcast eth0 239.0.0.43 694 1 0node ha01 ha02crm respawn
scp /etc/ha.d/authkeys ha02:~scp /etc/ha.d/ha.cf ha02:~scp /etc/logd.cf ha02:~
sudo mv authkeys /etc/ha.d/sudo mv ha.cf /etc/ha.d/sudo mv logd.cf /etc/
sudo /etc/init.d/heartbeat start
crm_attribute --attr-name symmetric-cluster --attr-value truecrm_attribute --attr-name default-resource-stickiness --attr-value INFINITYcrm_attribute --attr-name stonith-enabled --attr-value false
cibadmin -o resources -C -x /tmp/resources.xml
After editing above file, you need to tell Heartbeat to add it to the cluster configuration.
cibadmin -o constraints -C -x /tmp/resources.xml
from :
see also :
转载地址:http://tutxi.baihongyu.com/