Load Balancing Virtual Machines

All virtual machines that you create in Windows Azure can automatically communicate using a private network channel with other virtual machines in the same cloud service or virtual network. However, you need to add an endpoint to a virtual machine for other resources on the Internet or other virtual networks to communicate with it.

Endpoints can be used for different purposes, such as to balance the load of network traffic among them, to maintain high availability, or for direct virtual machine connectivity through protocols such as RDP or SSH. You define endpoints that are associated to specific ports and are assigned a specific communication protocol.

An endpoint can be assigned a protocol of TCP or UDP (the TCP protocol includes HTTP and HTTPS traffic). Each endpoint defined for a virtual machine is assigned a public and private port for communication. The private port is defined for setting up communication rules on the virtual machine and the public port is used by Windows Azure to communicate with the virtual machine from external resources.

Note: If you want learn about connecting to virtual machines directly by hostname or set up cross-premises connections, see Windows Azure Virtual Network Overview.

If you configure load balancing, Windows Azure provides round-robin load balancing of network traffic to publicly defined ports of a cloud service. A load-balanced endpoint is a specific TCP or UDP endpoint used by all members of a cloud service.

For a cloud service that contains instances of web roles or worker roles, you can define a public endpoint in the service definition. For a cloud service that contains virtual machines, you group the new virtual machines in the same cloud service when you create them. You can add an endpoint to a virtual machine when you create it, or you can add it later.

The following image shows a load-balanced endpoint that is shared among three virtual machines and uses a public and private port of 80.

This task includes the following steps:

Step 1: Create the first virtual machine

You can create the first virtual machine by using either the From Gallery or the Quick Create method.

  • From Gallery - The From Gallery method allows you to create an endpoint when you create the virtual machine, and it allows you to specify a name for the cloud service that is created when you create the virtual machine. For instructions, see Create a Virtual Machine Running Linux or Create a Virtual Machine Running Windows Server.

  • Quick Create - Create a virtual machine by choosing an image from the Image Gallery and providing basic information. When you use this method, you will need to add the endpoint after you create the virtual machine. This method also creates a cloud service using a default name. For more information, see How to quickly create a virtual machine.

Note: After the virtual machine is created, the Cloud Services page of the Management Portal lists the name of the cloud service as well as other information about the service.

Step 2: Create additional virtual machines in the same cloud service

To add virtual machines to a cloud service so you can load balance them, add the virtual machines to the same cloud service when you create them. For more information about connecting virtual machines, see How to connect virtual machines in a cloud service.

Step 3: Set up load balancing of the virtual machines

After you create an endpoint on the first virtual machine and add the other virtual machines to the same cloud service, assign the endpoint to the new virtual machines for load balancing.

To set up a load-balanced endpoint

  1. If you have not already done so, sign in to the Windows Azure Management Portal.

  2. Click Virtual Machines, and then select one of the virtual machines in the same cloud service.

  3. Click Endpoints.

  4. Click Add Endpoint or select the endpoint and Edit Endpoint, depending on whether you added the endpoint when you created the virtual machine. Then do one of the following:

    • If you're adding an endpoint, click Add Standalone endpoint and then click the arrow.

      • In Name, type a name for the endpoint.
      • In Protocol, select the protocol required by the type of endpoint, either TCP or UDP.
      • In Public Port and Private Port, type the port number that you want the virtual machine to use. You can use the private port and firewall rules on the virtual machine to redirect traffic in a way that is appropriate for your application. The public port is the same as the public port defined for the endpoint on the first virtual machine. The private port can be the same as the public port. For example, for an HTTP endpoint, you will likely want to assign port 80 to the public port and the private port for all virtual machines.
      • Click Create a load-balanced set.
    • If you're editing an endpoint, click Create a load-balanced set.

  5. On the Configure the load-balanced set page, specify a name for the load-balanced set and then assign the values for the load-balancing probe.

  6. Click the check mark to create the load-balanced endpoint. You will see Yes in the Load-balanced set name column of the Endpoints page for both virtual machines.

Step 4: Add virtual machines to the load-balanced set

After you create the load-balanced set, add the other virtual machines to the set.

  1. Select one of the virtual machines in the same cloud service.

  2. Click Endpoints.

  3. Click Add Endpoint.

  4. Click Add endpoint to an existing load-balanced set and then click the arrow.

  5. Specify the name and protocol for the endpoint, and then click the check mark.

  6. Repeat the process for the rest of the virtual machines in the cloud service.

[Windows Azure] Load Balancing Virtual Machines的更多相关文章

  1. [Windows Azure] Create a Virtual Network for Site-to-Site Cross-Premises Connectivity

    Create a Virtual Network for Site-to-Site Cross-Premises Connectivity This tutorial walks you throug ...

  2. [Windows Azure] Create a Virtual Network in Windows Azure

    Create a Virtual Network in Windows Azure This tutorial walks you through the steps to create a basi ...

  3. [Windows Azure] Load Testing in Windows Azure

    The primary goal of a load test is to simulate many users accessing a web application at the same ti ...

  4. [Windows Azure] Manage the Availability of Virtual Machines

    Manage the Availability of Virtual Machines You can ensure the availability of your application by u ...

  5. [Windows Azure] Windows Azure Virtual Network Overview

    Windows Azure Virtual Network Overview 18 out of 33 rated this helpful - Rate this topic Updated: Ap ...

  6. Windows Azure 名词定义(Glossary)

    Glossary(名词) Definition(定义) Availability Set 可用性组 refers to two or more Virtual Machines deployed ac ...

  7. [SQL in Azure] Getting Started with SQL Server in Azure Virtual Machines

    This topic provides guidelines on how to sign up for SQL Server on a Azure virtual machine and how t ...

  8. Network Load Balancing Technical Overview--reference

    http://technet.microsoft.com/en-us/library/bb742455.aspx Abstract Network Load Balancing, a clusteri ...

  9. [Windows Azure] Walkthrough to Configure System Center Management Pack for Windows Azure Fabric Preview for SCOM 2012 SP1 (with a MetricsHub Bonus)

    The wait is finally over. This is a huge update to the Azure Management Pack over the one that was r ...

随机推荐

  1. weblogic静默安装指导

    Linux图形化很少,再生产上.静默安装基本上是家常便饭... 心得: Oracle的官方文档很全,值得后续学习指导文件 weblogic10.3.6官方文档 https://docs.oracle. ...

  2. DLL中不能调用CoInitialize和CoInitializeEx

    在项目中为了用API访问Wmi Object来实现命令wmic的功能,所以得使用COM库,使用COM库之前得初始化一些东西. m_hr = CoInitializeEx(, COINIT_APARTM ...

  3. 自己动手做——邮件客户端FrankMail

    一.预备知识 二.需求分析 三.编码 四.交付 软件界面: 发送结果: --EOF--

  4. 在发送信息时应用PendingIntent.FLAG_UPDATE_CURRENT

    1. 连续发送两条信息时,出现bug.以下是bug现象描述. 发送第一条信息,sentReceiver弹出toast告知发送成功,同时在listview中的发送状态立即同步更新为发送成功. 继续发送第 ...

  5. 自由是有代价的:聊聊这几年尝试的道路 要想生活好,别看哲学书和思想书。简单看看可以,看多了问题就大了。还是要去研究研究些具体的问题。别jb坐在屋子里,嘴里念着海子的诗,脑袋里想康德想的事情,兜里屁都没有,幻想自己是大国总理,去想影帝是怎么炼成的。

    自由是有代价的:聊聊这几年尝试的道路 现在不愿意写过多的技术文章了,一点是现在做的技术比较偏,写出来看的人也不多,二来是家庭事务比较繁多,没以前那么有时间写了.最近,园子里多了一些写经历的文章,我也将 ...

  6. HDU 1258 Sum It Up (DFS)

    Sum It Up Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total S ...

  7. C 简单1

    #include <stdio.h> #define Height 10 int main(){ int width; int clong; int result; printf(&quo ...

  8. 【C语言】字符串与整型数值之间的转换

    一.将字符串转化为对应的数值 /*============================================================================= # # F ...

  9. MySQL USING 和 HAVING 用法

    USING 用于表连接时给定连接条件(可以理解为简写形式),如 SELECT * FROM table1 JOIN table2 ON table1.id = table2.id   使用 USING ...

  10. Activity的onPause()、onStop()和onDestroy()里要做的事情

    onPause(): 当系统调用你的activity中的onPause(),从技术上讲,那意味着你的activity仍然处于部分可见的状态,当时大多数时候,那意味着用户正在离开这个activity并马 ...