keepalived安装实录

keepalived安装全程实录

两台主机一台为主(master)63.23一台为辅  (backup)63.52        virtual  63.21

可以使用haproxy+keepalived作为高可用负载均衡方案

下载地址 http://www.keepalived.org/software/ XXXXX版本      http://haproxy.1wt.eu/#down

解压keepalived进入目录

#./configure

#make             #make install 

在执行./confugure 是出现:

 

只有一项yes ,因为keepalived没有找到内核目录导致的,解决方法是编译的时候

#./confugure   --with-kenel-dir=/usr/src/kernels/2.6.18-194.el5-i686

如果没有内核请查看内核版本#uname -a   下载内核

配置keepalived

#cp /usr/local/etc/rc.d/init.d/keepalived /etc/rc.d/init.d/

# cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/

# mkdir /etc/keepalived

# cp /usr/local/tec/keepalived/keepalived.conf /etc/keepalived/

# cp /usr/local/sbin/keepalived  /usr/sbin/

为系统启动方面  #vi /etc/rc.local    添加 /etc/init.d/keepalived start

在主服务器  # vi /etc/keepalived/keepalived.conf      在文件这个位置修改

在backup机器上同上修改  把优先级小于100

启动keepalived服务器   #service keepalived start   或 #/etc/init.d/keepalived start

 # ip a 

验证keepalived状态命令

# curl  http:// ip地址

 

你可能感兴趣的:(keepalived,职场,休闲,简单安装)