Chinaunix首页 | 论坛 | 博客
  • 博客访问: 193607
  • 博文数量: 44
  • 博客积分: 2021
  • 博客等级: 大尉
  • 技术积分: 937
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-03 22:55
文章分类

全部博文(44)

文章存档

2009年(2)

2008年(42)

我的朋友

分类: LINUX

2008-05-13 20:50:31


下载
tar -zxvf vrrpd-1.0.tar.gz
cd vrrpd-1.0
[root@work_monitor vrrpd-1.0]# vi INSTALL

1. uncompress the source
2. cd in the directory
3. type 'make'
4. if everything is ok, there is now a file 'vrrpd' in the directory
5. copy vrrpd in your path (e.g /usr/sbin) and vrrpd.8 in your man path
   (e.g. /usr/man/man8)

it requires to be run as root.

[root@work_monitor vrrpd-1.0]# cp vrrpd /usr/bin/.

[root@work_monitor vrrpd-1.0]# vrrpd -h
vrrpd version 0.4
Usage: vrrpd -i ifname -v vrid [-f piddir] [-s] [-a auth] [-p prio] [-nh] ipaddr
  -h       : display this short inlined help
  -n       : Dont handle the virtual mac address
  -i ifname: the interface name to run on
  -v vrid  : the id of the virtual server [1-255]
  -s       : Switch the preemption mode (Enabled by default)
  -a auth  : (not yet implemented) set the authentification type
             auth=(none|pass/hexkey|ah/hexkey) hexkey=0x[0-9a-fA-F]+
  -p prio  : Set the priority of this host in the virtual server (dfl: 100)
  -f piddir: specify the directory where the pid file is stored (dfl: /var/run)
  -d delay : Set the advertisement interval (in sec) (dfl: 1)
  ipaddr   : the ip address(es) of the virtual server

[root@work_monitor vrrpd-1.0]#vrrpd -i eth0 -v 100 -f /var/run 192.168.1.178
192.168.1.178来做virtual server

[root@work_monitor vrrpd-1.0]#ip add show
1: lo: mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:00:5e:00:01:64 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.105/24 brd 255.255.255.255 scope global eth0
    inet 192.168.1.178/32 scope global eth0
    inet6 fe80::200:5eff:fe00:164/64 scope link
       valid_lft forever preferred_lft forever
3: sit0: mtu 1480 qdisc noop
    link/sit 0.0.0.0 brd 0.0.0.0
命令运行后vip就产生了

用这个vrrp可以来做web的ha,当然也可做很多的ha,用两台相同机器来对外服务以提高可用性
用vrrp协议来确认当前一台为master,别外一台为backup,当master 挂了,backup自动接管以对外提供服务,提供高可用性的服务
当然用vrrp也可以用来路由的双路备份,对内部客户端透明
这种应用在现实中有相当多的例子

阅读(1255) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~