用Azure命令行配load balancer

Standard

https://azure.microsoft.com/en-us/documentation/articles/load-balancer-get-started-internet-arm-cli/
https://azure.microsoft.com/en-us/documentation/articles/load-balancer-get-started-ilb-arm-cli/
只是参照上面两篇敲一遍练练手.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
azure login
azure config mode arm
azure account set <Subscription ID>
 
azure group create ResourceGroupsName eastus2
 
azure network vnet create ResourceGroupsName ResourceGroupsName-Vnet eastus2 -a 10.0.0.0/16
azure network vnet subnet create ResourceGroupsName ResourceGroupsName-Vnet ResourceGroupsName-VnetSubnet -a 10.0.0.0/24
azure network public-ip create -g ResourceGroupsName -n ResourceGroupsName-PublicIP -l eastus2 -d rgn-esg -a static -i 4
azure network lb create ResourceGroupsName ResourceGroupsName-LB eastus2
azure network lb frontend-ip create ResourceGroupsName ResourceGroupsName-LB ResourceGroupsName-FrontendPool -i ResourceGroupsName-PublicIP
azure network lb address-pool create ResourceGroupsName ResourceGroupsName-LB ResourceGroupsName-BackendPool
 
azure network lb inbound-nat-rule create -g ResourceGroupsName -l ResourceGroupsName-LB -n ssh1 -p tcp -f 62201 -b 22
azure network lb inbound-nat-rule create -g ResourceGroupsName -l ResourceGroupsName-LB -n ssh2 -p tcp -f 62202 -b 22
 
azure network lb inbound-nat-rule create -g ResourceGroupsName -l ResourceGroupsName-LB -n ssh3 -p tcp -f 62203 -b 22
 
azure network lb rule create ResourceGroupsName ResourceGroupsName-LB lbrule -p tcp -f 9200 -b 9200 -t ResourceGroupsName-FrontendPool -o ResourceGroupsName-BackendPool
azure network lb probe create -g ResourceGroupsName -l ResourceGroupsName-LB -n healthprobe -p "http" -o 9200 -f / -i 15 -c 4
 
azure network lb show ResourceGroupsName ResourceGroupsName-LB
 
azure network nic create -g ResourceGroupsName -n lb-nic1-be --subnet-name ResourceGroupsName-VnetSubnet --subnet-vnet-name ResourceGroupsName-Vnet -d "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroupsName/providers/Microsoft.Network/loadBalancers/ResourceGroupsName-LB/backendAddressPools/ResourceGroupsName-BackendPool" -e "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroupsName/providers/Microsoft.Network/loadBalancers/ResourceGroupsName-LB/inboundNatRules/ssh1" eastus2
azure network nic create -g ResourceGroupsName -n lb-nic2-be --subnet-name ResourceGroupsName-VnetSubnet --subnet-vnet-name ResourceGroupsName-Vnet -d "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroupsName/providers/Microsoft.Network/loadBalancers/ResourceGroupsName-LB/backendAddressPools/ResourceGroupsName-BackendPool" -e "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ResourceGroupsName/providers/Microsoft.Network/loadBalancers/ResourceGroupsName-LB/inboundNatRules/ssh2" eastus2
 
azure vm create --resource-group ResourceGroupsName --name es1 --location eastus2 --vnet-name ResourceGroupsName-Vnet --vnet-subnet-name ResourceGroupsName-VnetSubnet --nic-name lb-nic1-be --availset-name ResourceGroupsName-AvSet --storage-account-name rgnesgdata -z Standard_D3_V2 --os-type Linux --image-urn Canonical:UbuntuServer:14.04.3-LTS:14.04.201512032
azure vm create --resource-group ResourceGroupsName --name es2 --location eastus2 --vnet-name ResourceGroupsName-Vnet --vnet-subnet-name ResourceGroupsName-VnetSubnet --nic-name lb-nic2-be --availset-name ResourceGroupsName-AvSet --storage-account-name rgnesgdata -z Standard_D3_V2 --os-type Linux --image-urn Canonical:UbuntuServer:14.04.3-LTS:14.04.201512032

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.