LVS IPVS负载均衡机制详解
IPVS的负载均衡机制有三种:VirtualServer via NAT
VirtualServer via IP Tunneling
VirtualServer via Direct Routing
1、 NAT
http://www.linuxvirtualserver.org/VS-NAT.html
NAT(网络地址转换):直接篡改数据包的源/目的地址。
Packet rewriting works as follows.
The incoming packet for web service would has source and destination addresses as:
SOURCE202.100.1.2:3456DEST202.103.106.5:80
The load balancer will choose a real server, e.g. 172.16.0.3:8000. The packet would be rewritten and forwarded to the server as:
SOURCE202.100.1.2:3456DEST172.16.0.3:8000
Replies get back to the load balancer as:
SOURCE172.16.0.3:8000DEST202.100.1.2:3456
The packets would be written back to the virtual server address and returned to the client as:
SOURCE202.103.106.5:80DEST202.100.1.2:3456
2、 IP Tunneling
http://www.linuxvirtualserver.org/VS-IPTunneling.html
IPTunneling(IP隧道):在原数据包上封装一层IP地址,让私有网络的数据可以在公网上传输。(VPN就是这么实现的)
3、 Direct Routing
http://www.linuxvirtualserver.org/VS-DRouting.html
DirectRoute(直接路由):通过Mac地址广播。
LoadBalance服务器和所有后端服务器必须在同一网段,要能够进行Mac广播。
页:
[1]