安装keepalived前系统需要安装
yum -y install openssl-devel lftplibnl* popt* libnl* libpopt* gcc*
查看内核方法:cat /proc/version,为啥重点说明下这里呢?因为下面有个步骤是创建软连接到这个内核的目录上,所以重点说明下为啥下面指定的是这个目录。
之后下载keepalived,高版本有的安装时候报错。
wget http://www.keepalived.org/software/keepalived-1.1.17.tar.gz
yum -y install gcc 解决编译./configure 报错
make 时候报错
yum install kernel-devel(安装kernel,有的话不用安装之后软连接)ln -s /usr/src/kernels/2.6.32-220.el6.x86_64/ /usr/src/linux
[root@woyoo keepalived-1.2.4]# yum install libnl* libpopt* popt-static 之后在make && make install
tar zxvf keepalived-1.2.4.tar.gz
cd keepalived-1.2.4
./configure
make && make install
######### 将keepalived做成启动服务,方便管理##########
cp /usr/local/etc/rc.d/init.d/keepalived /etc/init.d/
cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/
mkdir /etc/keepalived/
cp /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/
cp /usr/local/sbin/keepalived /usr/sbin/
service keepalived start