全部博文(2759)
分类: 云计算
2014-07-30 10:11:10
原文地址:云计算-Azure-3.负载均衡集 作者:syxian
一、Azure负载均衡集介绍
Azure的负载均衡目前只支持四层,LB的算法是Azure自己的不能修改。算法主要依赖于五元组 (source IP, source port, destination IP, destination port, protocol type)
Layer-4 Load Balancer, Hash based distribution
Microsoft Azure Load Balancer is a Layer-4 type load balancer. Microsoft Azure load balancer distributes load among a set of available servers (virtual machines) by computing a hash function on the traffic received on a given input endpoint. The hash function is computed such that all the packets from the same connection (TCP or UDP) end up on the same server. The Microsoft Azure Load Balancer uses a 5 tuple (source IP, source port, destination IP, destination port, protocol type) to calculate the hash that is used to map traffic to the available servers. The hash function is chosen such that the distribution of connections to servers is fairly random. However, depending on traffic pattern, it is possible for different connections to get mapped to the same server. (Note that the distribution of connections to servers is NOT round robin, neither there is any queuing of requests, as has been mistakenly mentioned in some articles and some blogs). The basic premise of the hash function is given a lot of requests coming from a lot of different clients, you will get a nice distribution of requests across the servers.
二、创建负载均衡集
a)创建一台虚拟机LB101,新建一个云服务LB101。
b)创建第二台虚拟机LB102,使用已有的云服务LB101。
由于LB101已经使用了LB101云服务的22端口,所以LB102的SSH端口就不能是22;可以自动分配,也可以手工固定,我们这里使用2201
c)创建负载均衡集
1.点击虚拟机LB101/端点/添加
2.将端点添加到虚拟机
3.选择需要进行负载均衡的端口/选中创建负载均衡集
4.配置负载均衡集:输入负载均衡名称(只要名字不同即可),负载均衡的协议、端口,每秒探测后端服务器时间,以及探测几次。
6.将LB102加入负载均衡集LB101-2
同样点击端点/添加
7.加入以后的负载均衡集LB101-2
8.指定端口信息
9.就这样负载均衡集就创建完成了
d)测试
虚拟机LB101,LB102启动apache,分别写入不同的内容。
测试地址就是云服务的地址: