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

keepalived安装配置

时间:2016-05-13 18:49:35      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:

1.环境配置

ln -s /usr/src/kernels/2.6.32-573.26.1.el6.x86_64/ /usr/src/linux

如果/usr/src/kernels/下没有东西,先安装kernel-devel(yum install kernel-devel)

2.两台linux按安装keepalived

tar -zxvf keepalived-1.2.19.tar.gz
./configure
make 
make install
echo $?
cp /usr/local/etc/rc.d/init.d/keepalived /etc/init.d/
cp /usr/local/etc/sysconfig/keepalived /etc/sysconfig/
mkdir /etc/keepalived
cp /usr/local/etc/keepalived/keepalived.conf  /etc/keepalived/
cp /usr/local/sbin/keepalived /usr/bin/
/etc/init.d/keepalived start ps -ef|grep keep

3.修改配置文件

主节点:

技术分享

备节点:

技术分享

4.测试

技术分享

5.多实例设置

技术分享

6.日志设置(keepalived日志默认在/var/log/messages里面):

设置keepalived使其生成一个独立的日志文件:

vim /etc/sysconfig/keepalived
#KEEPALIVED_OPTIONS="-D"
KEEPALIVED_OPTIONS="-D -S 0 -d"


vim /etc/rsyslog.conf 
#keepalived log
local0.*                                                /var/log/keepalived.log

[root@server05 ~]# /etc/init.d/rsyslog restart
Shutting down system logger:                               [  OK  ]
Starting system logger:                                    [  OK  ]



[root@server05 ~]# /etc/init.d/keepalived restart
Stopping keepalived:                                       [  OK  ]
Starting keepalived:  

[root@server05 log]# ll keepalived.log
-rw-------. 1 root root 34922 May 13 18:11 keepalived.log

keepalived安装配置

标签:

原文地址:http://www.cnblogs.com/vijayfly/p/5490130.html

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