Virtual Server via Direct Routing

 

  This request dispatching approach is similar to the one implemented in IBM's NetDispatcher. The virtual IP address is shared by real servers and the load balancer. The load balancer has an interface configured with the virtual IP address too, which is used to accept request packets, and it directly route the packets to the chosen servers. All the real servers have their non-arp alias interface configured with the virtual IP address or redirect packets destined for the virtual IP address to a local socket, so that the real servers can process the packets locally. The load balancer and the real servers must have one of their interfaces physically linked by a HUB/Switch. The architecture of virtual server via direct routing is illustrated as follows:

  此请求分派方法类似于在IBM的NetDispatcher中实现的方法。 虚拟IP地址由真实服务器和负载均衡器共享。 负载均衡器具有配置有虚拟IP地址的接口,用于接收请求分组,并且它直接将分组路由到所选择的服务器。 所有真实服务器的非arp别名接口配置有虚拟IP地址或重定向到虚拟IP地址的包到本地套接字,使得真实服务器可以在本地处理包。 负载均衡器和真实服务器必须有一个通过HUB /交换机物理连接的接口。

 

 

  When a user accesses a virtual service provided by the server cluster, the packet destined for virtual IP address (the IP address for the virtual server) arrives. The load balancer(LinuxDirector) examines the packet's destination address and port. If they are matched for a virtual service, a real server is chosen from the cluster by a scheduling algorithm, and the connection is added into the hash table which records connections. Then, the load balancer directly forwards it to the chosen server. When the incoming packet belongs to this connection and the chosen server can be found in the hash table, the packet will be again directly routed to the server. When the server receives the forwarded packet, the server finds that the packet is for the address on its alias interface or for a local socket, so it processes the request and return the result directly to the user finally. After a connection terminates or timeouts, the connection record will be removed from the hash table.

  当用户访问由服务器集群提供的虚拟服务时,到达虚拟IP地址(虚拟服务器的IP地址)的分组到达。 负载均衡器(LinuxDirector)检查数据包的目标地址和端口。 如果它们匹配虚拟服务,则通过调度算法从集群中选择真实服务器,并且将连接添加到记录连接的散列表中。 然后,负载平衡器将其直接转发到所选服务器。 当输入数据包属于此连接并且可以在散列表中找到所选服务器时,该数据包将再次直接路由到服务器。 当服务器接收到转发的数据包时,服务器发现该数据包是用于其别名接口或本地套接字上的地址,因此它处理请求并最终直接将结果返回给用户。 连接终止或超时后,连接记录将从哈希表中删除。

 

   The load balancer simply changes the MAC address of the data frame to that of the chosen server and restransmits it on the LAN. This is the reason that the load balancer and each server must be directly connected to one another by a single uninterrupted segment of a LAN. If you meet some arp problem of the cluster, see the arp problem page for more information.

  负载均衡器只需将数据帧的MAC地址更改为所选服务器的MAC地址,并在LAN上重新传输。 这是为什么负载均衡器和每个服务器必须通过LAN的单个不间断段彼此直接连接的原因。 如果遇到集群的某些arp问题,请参阅arp问题页面了解更多信息。

 

官方文档:

http://www.linuxvirtualserver.org/VS-DRouting.html

百度百科:

负载均衡

posted @ 2017-03-06 13:38  reborn枪  阅读(168)  评论(0)    收藏  举报