首页 > 其他 > 详细

keepalive安装和配置

时间:2014-06-11 10:18:13      阅读:539      评论:0      收藏:0      [点我收藏+]

1、下载安装包并解压

 sudo wget http://www.keepalived.org/software/keepalived-1.2.13.tar.gz 

tar zxvf keepalived-1.2.13.tar.gz 

2、编译安装

cd keepalived-1.2.13

./configure --prefix=/usr/local/keepalived

[如果出现configure: error:

     !!! OpenSSL is not properly installed on your system. !!!

则需要先安装openssl和openssl-devel, yum install openssl openssl-devel]

make 

sudo make install

sudo cp /usr/local/keepalived/sbin/keepalived /usr/sbin/

sudo cp /usr/local/keepalived/etc/sysconfig/keepalived /etc/sysconfig/

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

mkdir /etc/keepalived

cd /etc/keepalive

sudo cp /usr/local/keepalived/etc/keepalived/keepalived.conf ./

3、将keepalived添加到开机启动服务中,并进行测试

chkconfig keepalived on

chkconfig --list | grep keepalived

sudo service keepalived restart

修改keepalived.conf文件(smtp_server 改成localhost, router_id变成NodeMaster, virtual_ipaddress 改成你自己网段内且没有被使用的如10.1.xx.xx/24格式的.

运行ip addr查看vip

运行ping命令访问vip。

4、在从服务器上进行步骤1-3

注意:router_id变成NodeBackup,priority变成99, state变成BACKUP,主从服务器要在同一个网段内。

 

 

 

 

keepalive安装和配置,布布扣,bubuko.com

keepalive安装和配置

原文:http://www.cnblogs.com/zxpo/p/3772949.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!