Azure CLI creates arm VMS and public-facing load balancing
The new portal management interface and ARM capabilities (i.e. IaaS v2). This article will create VMS and load balancing in arm mode via the Azure CLI command line.
In ASM mode, we often use the endpoint and load balancing SLB capabilities. Also in arm mode, SLB is a very important feature. But the most important difference between arm and ASM is that LoadBalancer is no longer associated with a property on a VM. That is, VMS can have no public IP and can provide services without load balancing.
This deployment model is more consistent with the deployment model for enterprise applications. In the enterprise application, only the front-end presentation layer will have the connection with the external network, and the other application layer, database layer and so on are not allowed to communicate with the outside world.
This feature is the case with VMS deployed through arm.
As shown in:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/84/2F/wKiom1eHyymD5svqAABUhx7LcNk309.png "/>
Load Balancing distributes Web requests to VMs that are added to the load balancer.
Https://github.com/Azure/azure-xplat-cli
Azure login-u [email protected] remind you not to spam ads! -E Azurechinacloud
The following step-by-step creation of each component and VM that is load balanced.
1. Create Resource Group:
Azure Group Create WRFLB Chinaeast
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/84/2F/wKiom1eHyynwTEL6AAC4JHX_2yY327.png "/>
2. Create a storage account in the resource group
Azure Storage Account create-g wrflb-l chinaeast wrfchinaeast
Select a replication type
1) LRS Local redundant Storage
2) ZRS Zone redundant Storage
3) GRS Geo rudundant Storage
4) Ragrs read-access geographically redundant Storage
5) Plrs
Choose a storage type
1) Storage
2) Blobstorage
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/84/2E/wKioL1eHyymCAiviAACaApU2Y8o479.png "/>
3. Create a vnet in the resource group
Azure Network vnet Create WRFLB wrflbvnet chinaeast-a 10.0. 0.0/ +
4. Create a subnet in your vnet
Azure Network vnet Subnet Create WRFLB wrflbvnet wrflbsubnet-1 -a 10.0. 0.0/
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/84/2F/wKiom1eHyyqwhbpAAAD0s3tk-vA756.png "/>
5. Create Public-ip
Azure Network Public-ip create-g wrflb-n wrflbpip-l chinaeast-d wrflbpip-a static-i 4
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/84/2E/wKioL1eHyyrwsFV7AAFdO2h1KC8907.png "/>
6. Create LoadBalancer
Azure Network lb Create wrflb wrflb chinaeast
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/84/2E/wKioL1eHyyrj8VeoAADNEU2H19c829.png "/>
7. Define the front-end IP of the loadbalancer and the PUBLIC-IP bindings just defined
Azure Network lb FRONTEND-IP create wrflb wrflb wrflbfndip-i Wrflbpip
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/84/2F/wKiom1eHyyvDEPuGAADvxoiDB7I454.png "/>
8. Create back-end IP address pool (no VMS joined at this time)
Azure Network lb Address-pool create wrflb wrflb Wrflbbndip
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/84/2E/wKioL1eHyyvBqdWbAAB_GjpiAx0529.png "/>
9. Define the NAT rule for this LoadBalancer
Azure network lb inbound-nat-rule create-g wrflb-l wrflb-n ssh1-p tcp-f 22122 -B 22
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/84/2F/wKiom1eHyyuR35HzAAFVxT2tf0I748.png "/>
Azure network lb inbound-nat-rule create-g wrflb-l wrflb-n ssh2-p tcp-f 22322 - b
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/84/2E/wKioL1eHyyvA0Sm-AAFQ2AFWjFQ519.png "/>
10. Create a load balancing rule for LoadBalancer
Azure network lb rule create wrflb wrflb lbrule-p tcp-f -B -T Wrflbfndip-o Wrflbbndip
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/84/2F/wKiom1eHyyzQGCPGAAGS3TkIDFU412.png "/>
11. Create a loadbalancer health check rule
Azure Network lb probe create-g wrflb-l wrflb-n healthprobe-p "tcp" - o- i-c 4
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/84/2F/wKiom1eHyyyzxayKAACv1zXcM9g479.png "/>
12. Check the created load balancer
Azure Network lb show wrflb wrflb
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/84/2E/wKioL1eHyy6TmDuaAAJ60pOXUio282.png "/>
At this point, load balancing has been created. The VMs are created below.
13. Create two NICs and apply NAT rules to two network cards
create a good subnet in the management portal à wrflbsubnet01
azure network Nic create-g wrflb-n wrflbnic1-be--subnet-name wrflbsubnet0< Span style= "color: #800080;" >1 --subnet-vnet-name wrflbvnet-d "/subscriptions/ 48985d9f-798c-4d2c-ac2b-adf252bc9464/resourcegroups/wrflb/providers/microsoft.network/loadbalancers/wrflb/ Backendaddresspools/wrflbbndip "-e "/subscriptions/ 48985d9f-798c-4d2c-ac2b-adf252bc9464/resourcegroups/wrflb/providers/microsoft.network/loadbalancers/wrflb/ Inboundnatrules/ssh1 " chinaeast
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/84/2F/wKiom1eHyy-B4oLwAAMouqFxwEo100.png "/>
Azure Network Nic create-g wrflb-n wrflbnic2-be--subnet-name wrflbsubnet01 --subnet-vnet-name wrflbvnet- D "/subscriptions/48985d9f-798c-4d2c-ac2b-adf252bc9464/resource
Azure CLI creates arm VMS and public-facing load balancing