keepalived实现双机热备
第一部分 测试环境 两台CentOS 7服务器,搭建Apache服务器,主机名分别是Node1和Node2。准备三个IP地址,分别是 Node1:192.168.168.13 Node2:192.168.168.32 虚拟IP地址192.168.168.33 第二部分 安装keepalived 进入 keepalived官网 下载keepalived源码,本次测试下载的源码是keepalived-2.0.18.tar.gz。在Node1和Node2上分别安装keepalived。 解压压缩包 #tar -xzvf keepalived-2.0.18.tar.gz 安装 #./configure --prefix=/usr/local/keepalived --将文件安装在/usr/local/keepalived目录下 #make && make install 第三部分 配置keepalived 在/usr/local/keepalived/etc/keepalived/keepalived.conf进行配置。 主机Node1的配置如下: ! Configuration File for keepalived global_defs { notification_email { acassen@firewall.loc failover@firewall.loc sysadmin