摘要
研究Linux下网络负荷平衡和失效检测、恢复功能的内核实现方式。采用bonding驱动的方式来实现有着一定的局限性。根据IP寻径算法,将主机设置为路由器,以公平的选择算法来为每个连接选择设备,实现基于连接的负载平衡。失效检测通过定时监控各网卡设备的统计数值实现,结合ip route命令实现失效后线路恢复。
The measures to realize the networks' load-balance and fail-over functions in Linux kernel is introduced.The bonding driver has its limitation when it is used in load-balance and fail-over.By setting the host as a router,using a fair arithmetic of path lookup lo assign network device for each link,load-balance can be realized.By monitoring the statistics of the NICs,combining with the ip route command,resumption from fail-over can be carried out.