如何用生产的实际数据testingtesting环境

我有以下的基础设施:

1x负载平衡器(nginx)4x apache上游1x mysql服务器

该网站是非常繁忙的,我买了其他6个服务器,以取代以前的基础设施。

由于设置是不同的,我想透过实时数据testing我的新服务器基础设施。 我发现https://github.com/wangbin579/tcpcopy,但由于某种原因,它不适合我(它不会发送99%的请求)。

我必须说我没有物理访问服务器,也不能操纵交换机。 这两台服务器在两个不同的networking中(当然,他们看到对方)。

谢谢你的时间 :)

您可以使用iptables TEE目标在iptables(8)页中尝试在负载平衡器级别复制stream量:

TEE The TEE target will clone a packet and redirect this clone to another machine on the local network segment. In other words, the nexthop must be the target, or you will have to configure the nexthop to forward it further if so desired.

  --gateway ipaddr Send the cloned packet to the host reachable at the given IP address. Use of 0.0.0.0 (for IPv4 packets) or :: (IPv6) is invalid. To forward all incoming traffic on eth0 to an Network Layer logging box: -t mangle -A PREROUTING -i eth0 -j TEE --gateway 2001:db8::1 

修复你的日志。

最好的方法是使用日志中的实际数据重播stream量(也许速度不同)。 标准的apache日志不够好,因为它们没有包含所有的头文件(假设你的应用程序使用这些头文件来为简便的页面提供网页爬虫)并且不包含POST数据。

因此,请使您的应用程序正确logging并在新设置中重播日志。 并确保200%不会发送任何数据,也不会更改实时数据:)