heartbat想必大家都知道,也都熟悉,他是用于操作系统的双机热备,通过心跳线来感知对方的。

 即:两台主机之间互相ping对方ip,当一台主机感知不到另外一台主机时,虚拟IP立刻飘到另外一台主机上,实现业务。

网络拓扑:

两台设备,对外都是一个地址172.16.1.10,其实这是虚拟ip,两台主机需要各有两块网卡,一个作为提供业务,一个作为心跳线。

debian系统双机heartbat配置_配置文件


heartbat具体的配置:

  1. 配置两块网卡的地址 

debian系统双机heartbat配置_操作系统_02

2.分别确认两台主机的主机名

debian系统双机heartbat配置_ip地址_03

debian系统双机heartbat配置_ip地址_04

3.上传heartbat的软件包,给予执行权限

debian系统双机heartbat配置_配置文件_05

4.执行bin包,安装heartbat

debian系统双机heartbat配置_网卡_06

5.更改配置文件ha.cf,分别写对方的ip地址;网关地址

debian系统双机heartbat配置_软件包_07

debian系统双机heartbat配置_ip地址_08

6.更改haresources文件,配置虚拟ip

debian系统双机heartbat配置_软件包_09

debian系统双机heartbat配置_网卡_10

7.重新启动heartbat服务

debian系统双机heartbat配置_软件包_11

8.当使用ifconfig时,可以查看到这个地址即配置完成

debian系统双机heartbat配置_网卡_12