LVS IPVS负载均衡机制详解

 

IPVS的负载均衡机制有三种:

         Virtual Server via NAT

         Virtual Server via IP Tunneling

         Virtual Server 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:

 

SOURCE 202.100.1.2:3456 DEST 202.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:

 

SOURCE 202.100.1.2:3456 DEST 172.16.0.3:8000

Replies get back to the load balancer as:

 

SOURCE 172.16.0.3:8000 DEST 202.100.1.2:3456

The packets would be written back to the virtual server address and returned to the client as:

 

SOURCE 202.103.106.5:80 DEST 202.100.1.2:3456

 

 


 

2、  IP Tunneling

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

IP Tunneling(IP隧道):在原数据包上封装一层IP地址,让私有网络的数据可以在公网上传输。(VPN就是这么实现的)

 


3、  Direct Routing

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

Direct Route(直接路由):通过Mac地址广播。

LoadBalance服务器和所有后端服务器必须在同一网段,要能够进行Mac广播。

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值