RHEL5.5下的Keepalived编译安装

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RHEL5.5下的Keepalived编译安装相关的知识,希望对你有一定的参考价值。

keepalived简介
keepalived是一个类似于layer3, 4 & 5交换机制的软件,也就是我们平时说的第3层、第4层和第5层交换。Keepalived的作用是检测web服务器的状态,如果有一台web服务器死机,或工作出现故障,Keepalived将检测到,并将有故障的web服务器从系统中剔除,当web服务器工作正常后Keepalived自动将web服务器加入到服务器群中,这些工作全部自动完成,不需要人工干涉,需要人工做的只是修复故障的web服务器。
keepalived下载:
下载地址:http://www.keepalived.org/download.html 可以选择需要的版本。
 wget http://www.keepalived.org/software/keepalived-1.2.1.tar.gz
实验环境
两台Redhat Linux RHEL 5.5:

解压keepalived-1.2.1.tar到/usr/src

cd /usr/src/keepalived-1.2.1
./configure --prefix=/usr/local/keepalived
make
make install
不出意外,安装过程就完毕了,接下来要手动复制一些东西,设置成系统服务启动运行:
可以看到/usr/local/keepalived下面有几个文件,我们需要复制一些文件到其他文件夹里面,下面为操作方法:
cp /usr/local/keepalived/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/
cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/
mkdir /etc/keepalived
cp /usr/local/keepalived/etc/keepalived/keepalived.conf /etc/keepalived/
cp /usr/local/keepalived/sbin/keepalived /usr/sbin/

添加系统服务开机启动:

chkconfig --add keepalived

chkconfig --level 345 keepalived on

手动启动或停止服务是service keepalived start|stop|restart
 接下来是配置conf文件,只有配置/etc/keepalived/keepalived.conf才生效。

本文出自 “boyhack” 博客,请务必保留此出处http://461205160.blog.51cto.com/274918/1740070

以上是关于RHEL5.5下的Keepalived编译安装的主要内容,如果未能解决你的问题,请参考以下文章

keepalived编译安装

编译安装配置keepalived-2.0.17

源码编译安装keepalived

高可用 - 04 Keepalived编译安装

Linux for CentOS 下的 keepalived 安装与卸载以及相关命令操作之详细教程

keepalived源码安装及编译遇到的错误