我使用Apache作为负载平衡器,我尝试使用它的心跳。 要做到这一点,我有2个负载均衡器与不同的IP地址。 这是我的configuration:
在文件/etc/ha.d/ha.cf中:
logfile /var/log/ha-log bcast eth0 keepalive 2 warntime 10 deadtime 30 initdead 120 udpport 694 auto_failback yes node apache-balance-1 node apache-balance-2 uuidfrom nodename respawn hacluster /usr/lib/heartbeat/ipfail
在/etc/ha.d/haresources :(我不确定这个IP地址,它需要是真实的还是虚拟的?)
apache-balance-1 192.168.1.51 apache2
在/etc/ha.d/authkeys中:
auth 2 2 crc
然后我configurationApache来监听VIP。 在两个负载平衡器上编辑/etc/apache2/ports.conf:Listen 192.168.1.51:80 – >当我把这行放在这个文件上时,apache不想重新启动。
一切都好吗? 为了testing它,我closures了balance-1的IP地址,但没有任何工作了,你知道为什么吗? configuration还是testing?
谢谢