Azure PowerShell (8) Set up Azure load balancer rules with PowerShell

Source: Internet
Author: User
Tags azure load balancer

Windows Azure Platform Family of articles Catalog

Note: If Azure is facing a customer that is only an enterprise customer, an enterprise customer accessing the Internet with a NAT device, because multiple clients use the same source IP address, can cause a single server to be under a lot of stress.

This feature has been out for some time, the author here to do a little note.

  Readers familiar with the Azure platform know that the rules for Azure load Balancer (load balancer) are made up of five elements of the source IP, source port, destination IP, destination port, protocol T Ype

Reference: http://azure.microsoft.com/blog/2014/04/08/microsoft-azure-load-balancing-services/

This way, the azure load balancer can guarantee absolute load balancing, such as:

  

However, such a load balancer will be defective, and when an enterprise user's application needs to retain the session, it will have to modify the application code to save the session to SQL Server or In-role cache.

The latest azure Load balancer can modify the rules to change to 2 features (source ip,destination IP) or 3 features (source IP, Destination IP, Protocol). This is the same client-initiated request that points to the same Azure destination server. In this way, you can keep the session. As shown in the following:

  

  

Preparation: Please refer to [New portal]windows Azure Virtual Machine (9) Virtual machine high availability and automatic load balancing (below), create the following in Azure:

-Create 2 Windows Server VMs, named Leizhangvmone and leizhangvmtwo

- Create DNS name for LEIZHANGVM

-Load Balancer Settings public port is 80 port, Private port is 80 port, load balancer is lb_80

 1. View the default endpoint rules for port 80

  We execute the following code:

' LEIZHANGVM ' ' Leizhangvmone ' | Get-azureendpoint

You can find out.

  

, we see that the Loadbalancerdistribution property is empty. Use the default rule for five features: source IP, source port, destination IP, destination port, protocol type

2. Reset the azure Load balancer rule to Sourceip

Then we execute the following code:

' LEIZHANGVM ' ' lb_80 '  the  the ' SourceIP '

View execution results, such as:

  

 3. Review the updated Load Balancer rules

We re-execute the following PS code:

' LEIZHANGVM ' ' Leizhangvmone ' | Get-azureendpoint

View the differences with figure 1, such as the red Section

  

As you can see, compared to Figure 1, the Loadbalancerdistribution property is Sourceip, which completes configuring the 2 features of the load balancer (Source ip,destination IP)

  

Reference: http://azure.microsoft.com/blog/2014/10/30/azure-load-balancer-new-distribution-mode/

Azure PowerShell (8) Set up Azure load balancer rules with PowerShell

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.