+ -
当前位置:首页 → 问答吧 → tftp成功启动,get或put命令测试出现Error code 1: File not found

tftp成功启动,get或put命令测试出现Error code 1: File not found

时间:2011-12-06

来源:互联网

大家好,这个LVS+DR的配置困扰我好几天了,怎么配都没有结果,找遍了网上的资料,实在是没办法了,请大家帮我分析分析,看看问题到底出在哪里?

网络的大致情况如下:

客户机: 172.16.2.13/24

网关:172.16.2.5/24(eth0),192.168.11.2/24(eth1)(已经将172.16.2.5:80请求转发至192.168.11.10)

Director1:192.168.11.11/24(eth0)

Director2:192.168.11.12/24(eth1)

(以上两台director虚拟出一个192.168.11.10的IP地址)

Real Server 1: 192.168.11.21/24

Real Server 2: 192.168.11.22/24

以上两台Director服务器均为Ubuntu 11.04 Server版,编译安装keepalived 1.2.2,ipvsadm版本均为1.26。

以上两台WWW服务器均为Ubuntu 11.10 Server版,编译安装Nginx 1.0.10

其中,两台机器的keepalived.conf 及 /etc/sysctl.conf 文件配置如下:

【Director1 - Master】:

global_defs {
lvs_id director1
}

# VRRP Configuration

vrrp_instance LVS {
state MASTER
interface eth0
virtual_router_id 51
priority 150
advert_int 1
authentication {
auth_type PASS
auth_pass 123456
}
virtual_ipaddress {
192.168.11.10
}
}

# Virtual Server Configuration - for WWW service

virtual_server 192.168.11.10 80 {
delay_loop 1
lb_algo rr
lb_kind DR
persistence_timeout 60
protocol TCP

# Real Server 1 Configuration

real_server 192.168.11.21 80 {
weight 1
TCP_CHECK {
connection_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}

# Real Server 2 Configuration

real_server 192.168.11.22 80 {
weight 1
TCP_CHECK {
connection_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
}

====================================
【sysctl.conf】

net.ipv4.ip_forward=0
net.ipv4.conf.eth0.arp_ignore=1
net.ipv4.conf.eth0.arp_announce=2
net.ipv4.conf.all.arp_ignore=1
net.ipv4.conf.all.arp_announce=2
====================================

【Director2 - Backup】

global_defs {
lvs_id director2
}

# VRRP Configuration

vrrp_instance LVS {
state BACKUP
interface eth0
virtual_router_id 51
priority 100
advert_int 1
authentication {
auth_type PASS
auth_pass 123456
}
virtual_ipaddress {
192.168.11.10
}
}

# Virtual Server Configuration - for WWW service

virtual_server 192.168.11.10 80 {
delay_loop 1
lb_algo rr
lb_kind DR
persistence_timeout 60
protocol TCP

# Real Server 1 Configuration

real_server 192.168.11.21 80 {
weight 1
TCP_CHECK {
connection_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}

# Real Server 2 Configuration

real_server 192.168.11.22 80 {
weight 1
TCP_CHECK {
connection_timeout 10
nb_get_retry 3
delay_before_retry 3
connect_port 80
}
}
}

====================================
【sysctl.conf】
net.ipv4.ip_forward=0
net.ipv4.conf.eth0.arp_ignore=1
net.ipv4.conf.eth0.arp_announce=2
net.ipv4.conf.all.arp_ignore=1
net.ipv4.conf.all.arp_announce=2
====================================


两台Real Server分别都已经在启动脚本中添加了如下命令:

ifconfig lo:0 192.168.11.10 netmask 255.255.255.0 broadcast 192.168.11.10 up
route add -host 192.168.11.10 dev lo:0

并且sysctl.conf也都已经配成如下形式:

net.ipv4.ip_forward=0
net.ipv4.conf.eth0.arp_ignore=1
net.ipv4.conf.eth0.arp_announce=2
net.ipv4.conf.all.arp_ignore=1
net.ipv4.conf.all.arp_announce=2

【故障描述】

1. 在director 1 和 director 2上可正常运行LVS,使用ethereal 连入192.168.11.0/24网络,可以看到VRRP数据包在发送;

2. 两台director之间的切换也正常,如果关掉一台,另外一台会接管虚拟IP;

但是,无论我访问http://172.16.2.5:80,还是http://192.168.11.10:80,均无法被这两台负载均衡器转发到Real Server上去,始终得到的是TCP connection reset,用ethereal抓包也可以看到,根本未进行三次握手,而是直接由那个虚拟IP地址(即192.168.11.10)直接发回一个TCP Reset。

请大家帮我分析分析,看看这个配置的错误到底在哪里,为什么我的请求总是无法被转发出去?或者请告诉我该从哪些方面入手进行排错,新手初学Ubuntu,问题比较2,万分感激!

作者: spluto   发布时间: 2011-12-06

自己顶一下,大家帮帮忙呀

作者: spluto   发布时间: 2011-12-06