Keepalived的安装与启动

官方的下载地址:http://www.keepalived.org/download.html

一、安装

# tar xzf keepalived-1.3.4.tar.gz
# cd keepalived-1.3.4
# ./configure --prefix=/usr/local/keepalived/
# make && make install

Tips 1:安装过程中提示:*** WARNING – this build will not support IPVS with IPv6. Please install libnl/libnl-3 dev libraries to support IPv6 with IPVS.

# yum install -y libnl3.x86_64
# yum install -y libnl3-devel.x86_64

Tips 2:configure: error: !!! Please install libnfnetlink headers. !!!

# yum install -y libnfnetlink.x86_64 
# yum install -y libnfnetlink-devel.x86_64

二、配置

配置可以参考:Keepalived的配置详解

三、启动

可以使用命令 /usr/local/keepalived/sbin -h 参看各启动参数。

启动
# ./keepalived -f /usr/local/keepalived/etc/keepalived.conf

 制作快捷启动

在源文件的目录./keepalived-1.3.4/keepalived/etc/init.d下有3个三个快捷启动的文件。

# cp ./keepalived-1.3.4/keepalived/etc/init.d/keepalived /etc/init.d/
# cp  /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/
# cp ./keepalived-1.3.4/keepalived/etc/sysconfig/keepalived /etc/sysconfig/keepalived

#keepalived的快捷启动,必须要执行以上三步,且文件路径必须一致,也不知道什么原因,
# 可能是init.d中的keepalived中已经指明了吧

 这样可以执行service keepalived [start | stop | reload | restart ]

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>