Chinaunix首页 | 论坛 | 博客
  • 博客访问: 339234
  • 博文数量: 8
  • 博客积分: 6010
  • 博客等级: 准将
  • 技术积分: 1015
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-01 15:13
文章存档

2010年(8)

我的朋友

分类:

2010-03-24 11:36:30

安装步骤如下:
ln -s /usr/src/kernels/2.6.9-89.0.9.EL-smp-x86_64/  /usr/src/linux
2.6.9-89.0.9.EL-smp-x86_64与uname -a内核配对。
下载
wget
wget

安装
tar zxvf ipvsadm-1.24.tar.gz
cd ipvsadm-1.24
make && make install
cd ..
tar zxvf keepalived-1.1.15.tar.gz
cd keepalived-1.1.15
注意项
引用

Centos5.0以下需要修改以下configure才能通过。
vi /usr/src/linux/include/linux/types.h
/*
typedef __u16 __bitwise __sum16;
typedef __u32 __bitwise __wsum;
*/

./configure
make && make install

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/etc/keepalived/keepalived.conf /etc/keepalived/
cp /usr/local/sbin/keepalived /usr/sbin/

service keepalived start

为了配合LVS平台,还需如下操作
1、
2、配置master端流量rrd数据采集
cd /home
wget
tar -zxvf lvs-rrd.tar.gz
vi lvs-rrd/lvs.rrd.update
根据用户实际情况来修改如下参数
引用

RRDTOOL="/usr/bin/rrdtool"
IPVSADM="/sbin/ipvsadm"
WORKDIR="/home/lvs-rrd/performance"

3、定制采集作业
*/2 * * * * /home/lvs-rrd/lvs.rrd.update 2> /dev/null > /dev/null

4、LVS管理平台端会定期来捉取performance中的*.rrd文件,用户可以通过ssh或ftp,系统默认采用rsync+ssh方式,配置可参考实践rsync+ssh实现代码同步

问题总结
1、make keepalived时提示:
make[2]: Leaving directory `/home/install/lvs/keepalived-1.1.15/keepalived/core'
make[2]: Entering directory `/home/install/lvs/keepalived-1.1.15/keepalived/check'
gcc -g -O2  -I/usr/src/linux/include -I../include -I../../lib -Wall -Wunused -Wstrict-prototypes -D_KRNL_2_6_ -D_WITH_LVS_ -D_HAVE_IPVS_SYNCD_ -D_WITHOUT_VRRP_  -c check_daemon.c
In file included from /usr/src/linux/include/linux/netlink.h:5,
                 from ../include/vrrp_netlink.h:35,
                 from check_daemon.c:40:
/usr/src/linux/include/linux/types.h:158: error: syntax error before "__sum16"
/usr/src/linux/include/linux/types.h:158: warning: type defaults to `int' in declaration of `__sum16'
/usr/src/linux/include/linux/types.h:158: warning: data definition has no type or storage class
/usr/src/linux/include/linux/types.h:159: error: syntax error before "__wsum"
/usr/src/linux/include/linux/types.h:159: warning: type defaults to `int' in declaration of `__wsum'
/usr/src/linux/include/linux/types.h:159: warning: data definition has no type or storage class
make[2]: *** [check_daemon.o] Error 1
make[2]: Leaving directory `/home/install/lvs/keepalived-1.1.15/keepalived/check'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/home/install/lvs/keepalived-1.1.15/keepalived'
make: *** [all] Error 2
解决:
引用

vi /usr/src/linux/include/linux/types.h
/*
typedef __u16 __bitwise __sum16;
typedef __u32 __bitwise __wsum;
*/


2、master、backup的/var/log/messagse显示
Nov 23 17:46:41 SN2008-06-070 Keepalived_vrrp: receive an invalid ip number count associated with VRID!
Nov 23 17:46:41 SN2008-06-070 Keepalived_vrrp: bogus VRRP packet received on eth0 !!!
Nov 23 17:46:41 SN2008-06-070 Keepalived_vrrp: VRRP_Instance(VI_1) Dropping received VRRP packet...
Nov 23 17:46:42 SN2008-06-070 Keepalived_vrrp: receive an invalid ip number count associated with VRID!
Nov 23 17:46:42 SN2008-06-070 Keepalived_vrrp: bogus VRRP packet received on eth0 !!!
Nov 23 17:46:42 SN2008-06-070 Keepalived_vrrp: VRRP_Instance(VI_1) Dropping received VRRP packet...

解决:
引用

修改 virtual_router_id 的值,与网络中不能重复。


3、在/var/log/messages中Keepalived_vrrp不生效,即无vrrp日志。
解决:
引用

重新编译源码包,可能是由于修改types.h后才configure。
阅读(1150) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

ancery2010-07-07 16:40:17

多谢兄弟的分享和指点,遇到的错误都可以通过兄弟提供的方法解决!!!