服务器:CentOS-7.x ip:192.168.21.100、192.168.21.101、192.168.21.128 vip(虚拟ip):192.168.21.102 实现目的: 1、三台服务器运行正常的情况下,vip(虚拟ip):192.168.21.102绑定在192.168.21.100上 2、192.168.21.100宕机,vip(虚拟ip):192.168.21.102随机飘逸到192.168.21.101或者192.168.21.128其中的一台上面 3、192.168.21.100、192.168.21.101宕机,vip(虚拟ip):192.168.21.102会飘逸到192.168.21.128上面 4、192.168.21.100、192.168.21.128宕机,vip(虚拟ip):192.168.21.102会飘逸到192.168.21.101上面 5、192.168.21.100恢复,vip(虚拟ip):192.168.21.102又会飘逸到192.168.21.100上面 1、下载安装包 https://www.keepalived.org/software/keepalived-2.2.8.tar.gz 上传keepalived-2.2.8.tar.gz到/data/soft目录 2、安装依赖包 sudo yum install openssl-devel popt-devel libnl3-devel libnfnetlink-devel kernel-devel gcc 3、编译安装keepalived sudo mkdir -p /data/server/keepalived #创建安装目录 cd /data/soft sudo tar zxvf keepalived-2.2.8.tar.gz cd keepalived-2.2.8 sudo ./configure --prefix=/data/server/keepalived #配置,必须看到以下提示,说明配置正确,才能继续安装 Use IPVS Framework : Yes Use VRRP Framework : Yes sudo make #编译 sudo make [...]
查看全文