1、下载依赖软件
yum -y install gcc pcre-devel zlib-devel openssl-devel make gcc gcc-c++ ncurses-devel bison openssl-devel libnl libnl-devel
2、安装libnfnetlink-devel依赖
在红帽官网下载对应的rpm,进行安装
首先卸载系统中的低版本libnfnetlink-1.0.1-4.el7.x86_64.rpm
rpm -e libnfnetlink-1.2.1-4.el7.x86_64.rpm
rpm -ivh libnfnetlink-1.0.1-4.el7.x86_64.rpm
rpm -ivh libnfnetlink-devel-1.0.1-4.el7.x86_64.rpm
3、执行编译命令
./configure --prefix=/usr/local/keepalived-1.4.0
4、编译
make && make install
5、拷贝配置文件
cp /usr/local/keepalived/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/
6、系统启动
cp /usr/local/keepalived/keepalived/etc/init.d/keepalived /etc/rc.d/init.d/
7、拷贝网络配置
cp /usr/local/keepalived/keepalived/etc/sysconfig/keepalived /etc/sysconfig/
8、拷贝可执行文件
cp /usr/local/keepalived/sbin/keepalived /usr/sbin/
9、加入systemctl启动
chkconfig --add keepalived
ifconfig eno1:0 xx.134.131.200 broadcast xx.134.131.200 netmask 255.255.255.255 up
删除虚拟ip
ip addr del 10.134.131.200/32 dev enp7s0f0