I want to structure a high available server cluster . Now I want to know detail about keepalive and heartbeat, what is the difference between both, and How to choice one.
I want to structure a high available server cluster . Now I want to know detail about keepalive and heartbeat, what is the difference between both, and How to choice one.
Believe the question has been very precisely answered by Willy Tarreau, the author of HAProxy, in http://www.formilux.org/archives/haproxy/1003/3259.html.
Citation from the above link
(Yeah I know it is an old question, but for future reference)
There is no clear, consistent differentiation. Those words are sometimes used more or less interchangeably.
There is a common userland deamon for high availability setups called Keepalived, and the Linux HA project used to have a deamon called Heartbeat, which has now changed to Pacemaker. (I trust you didn't ask for a complete overview of those two systems, and what all the differences are, that would IMHO be off topic.)
In daily use of the terms, I would say the most common use is that:
"Keepalive" refers more generally to a system which keeps a service highly available.
"Heartbeat" refers more specifically to a communication protocol, where to or more members of a high-availability setup periodically send "Yes, I'm still alive!" messages. Their peers then take action if they don't see a "Yes, I'm alive" message before a set time (i.e. the other host has gone down). This is a bit like feeling for a pulse, hence the name.