码迷,mamicode.com
首页 > 其他好文 > 详细

keepalive安装和配置

时间:2014-06-11 10:21:20      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:style   http   tar   get   使用   文件   

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安装和配置

标签:style   http   tar   get   使用   文件   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!