Azure PowerShell (6) 设置单个Virtual Machine Endpoint
《Windows Azure Platform 系列文章目录》
请注意:
- Azure不支持增加Endpoint Range
- 最多可以增加Endpoint数量为150
http://azure.microsoft.com/zh-cn/documentation/articles/azure-subscription-service-limits/
我们可以通过Windows Azure Management Portal,打开Virtual Machine的Endpoint,借用我之前博文的图片:

但是如果我们需要打开非常多的Endpoint, 就需要手动一个一个地设置,非常的繁琐。
其实我们可以通过Windows Azure Powershell,来批量设置Virtual Machine的Endpoint。
假设我们已经创建了2台虚拟机,DNS为LeiAzure.cloudapp.net,虚拟机为LeiAzure001和LeiAzure002。
如下图:

假设我需要在LeiAzureVM001这台虚拟机上设置TCP Endpoint
- Endpoint Name为TCP80
- Public Port为80
- Public Port为80
1.我们以管理员身份运行Azure PowerShell,输入以下命令:
Get-AzureVM –ServiceName ‘LeiAzure’ –Name ‘LeiAzureVM001’ | add-AzureEndpoint –Name ‘TCP80’ –Protocol ‘TCP’ –Publicport –LocalPort | Update-AzureVM
执行结果如下:

2.在Azure Management Portal可以查看到执行结果:

上图红色部分就是我在步骤一执行PowerShell的结果。
思考:如果我想在LeiAzureVM001和LeiAzureVM002,这2台VM上执行Endpoint的Load Balance,应该怎么办?
示意图如下:

1.因为在上面的步骤中,80端口已经被占用了。
如果我们需要重新设置对80端口的负载均衡,首先删除在上面创建的Endpoint Name,为TCP80,执行以下PowerShell命令:
Get-AzureVM –ServiceName ‘LeiAzure’ –Name ‘LeiAzureVM001’ | Remove-AzureEndpoint –Name ‘TCP80’ | Update-AzureVM
2.执行以下PowerShell脚本,
- 设置LeiAzureVM001虚拟机的Endpoint
- Public Port为80
- Private Port为80
- Endpoint Name为VM001_80_LB
- 同时设置负载均衡集名称,为LBSet
Get-AzureVM -ServiceName "LeiAzure" -Name "LeiAzureVM001" | Add-AzureEndpoint -Name "VM001_80_LB" -Protocol "TCP" -PublicPort -LocalPort -LBSetName "LBSet" -ProbePort -ProbeProtocol "http" -ProbePath '/' | Update-AzureVM
执行结果

3.继续执行以下PowerShell
- 设置LeiAzureVM002虚拟机的Endpoint
- Public Port为80
- Private Port为80
- Endpoint Name为VM002_80_LB
- 同时设置负载均衡集名称,为LBSet
Get-AzureVM -ServiceName "LeiAzure" -Name "LeiAzureVM002" | Add-AzureEndpoint -Name "VM002_80_LB" -Protocol "TCP" -PublicPort -LocalPort -LBSetName "LBSet" -ProbePort -ProbeProtocol "http" -ProbePath '/' | Update-AzureVM
执行结果:

本博-三石Blog(下文简称本博),在本博客文章结尾处右下脚未注明转载、来源、出处的作品(内容)均为本博原创,本站对于原创作品内容对其保留版权, 请勿随意转载,如若真有需要的朋友可以发Mail联系我;转载本博原创作品(内容)也必须遵循“署名-非商业用途-保持一致”的创作共用协议,请务必以文 字链接的形式标明或保留文章原始出处和博客作者(Lei Zhang)的信息,关于本博摄影作品请务必注意保留(www.cnblog.com/threestone)等相关水印版权信息,否则视为侵犯原创版权 行为;本博谢绝商业网站转载。版权所有,禁止一切有违中华人民共和国著作权保护法及相关法律和本博(法律)声明的非法及恶意抄袭。
Azure PowerShell (6) 设置单个Virtual Machine Endpoint的更多相关文章
- Azure PowerShell (7) 使用CSV文件批量设置Virtual Machine Endpoint
<Windows Azure Platform 系列文章目录> 请注意: - Azure不支持增加Endpoint Range - 最多可以增加Endpoint数量为150 http:// ...
- [New Portal]Windows Azure Virtual Machine (22) 使用Azure PowerShell,设置Virtual Machine Endpoint
<Windows Azure Platform 系列文章目录> 我们可以通过Windows Azure Management Portal,打开Virtual Machine的Endpoi ...
- [SQL in Azure] Provisioning a SQL Server Virtual Machine on Azure
http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-provision-sql-server/ Provi ...
- [New Portal]Windows Azure Virtual Machine (19) 关闭Azure Virtual Machine与VIP Address,Internal IP Address的关系(1)
<Windows Azure Platform 系列文章目录> 默认情况下,通过Azure Management Portal创建的Public IP和Private IP都是随机分配的. ...
- [New Portal]Windows Azure Virtual Machine (20) 关闭Azure Virtual Machine与VIP Address,Internal IP Address的关系(2)
<Windows Azure Platform 系列文章目录> 默认情况下,通过Azure Management Portal创建的Public IP和Private IP都是随机分配的. ...
- How to run a (Tomcat)Java application server on a Azure virtual machine
http://www.windowsazure.com/en-us/documentation/articles/virtual-machines-java-run-tomcat-applicatio ...
- Azure China (8) 使用Azure PowerShell创建虚拟机,并设置固定Virtual IP Address和Private IP
<Windows Azure Platform 系列文章目录> 本文介绍的是由世纪互联运维的Windows Azure China. 相比于Global Azure (http://www ...
- Windows Azure Virtual Network (5) 设置Azure Virtual Machine固定Private IP
<Windows Azure Platform 系列文章目录> 注意:本文介绍的是Global Azure (http://www.windowsazure.com),如果你使用的是由世纪 ...
- Windows Azure Virtual Network (6) 设置Azure Virtual Machine固定公网IP (Virtual IP Address, VIP) (1)
<Windows Azure Platform 系列文章目录> 注意:本文介绍的是Global Azure (http://www.windowsazure.com),如果你使用的是由世纪 ...
随机推荐
- Element-ui,Mint-ui
style-loader css-loader style!css 饿了么团队开源一个基于vue 组件库 elementUI PC MintUI 移动端 官网: http://element.elem ...
- Drools API的使用学习
Drools API的使用学习在 Drools 当中,规则的编译与运行要通过 Drools 提供的各种 API 来实现,这些 API 总体来讲可以分为三类:规则编译.规则收集和规则的执行.完成这些工作 ...
- [leetcode] 题型整理之图论
图论的常见题目有两类,一类是求两点间最短距离,另一类是拓扑排序,两种写起来都很烦. 求最短路径: 127. Word Ladder Given two words (beginWord and end ...
- ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
有时候,当我们使用"mysql"."mysqladmin"."mysqldump"等命令管理数据库时,服务器抛出类似如下错误: 一.错误现场 ...
- css定位学习经验记录
之前了解到css的定位position属性,常用的三种: position:absolute 1.当父元素定位为relative时,以父元素为起始坐标定位. 2.当父元素没有定位时,以body为起始坐 ...
- Codeforces CF#628 Education 8 C. Bear and String Distance
C. Bear and String Distance time limit per test 1 second memory limit per test 256 megabytes input s ...
- 采用Lambda表达式快速实现实体模型对象转换到DTO
在项目中,采用code first时建立的模型对象不能直接用于数据传输,需要从新根据需求建立Dto对象 为什么需要建立Dto对象呢? DTO即数据传输对象.之前不明白有些框架中为什么要专门定义DTO来 ...
- 【转】apache 二级域名设置完整步骤
原文链接:http://blog.sina.com.cn/s/blog_5375d76b01014fnt.html 最近在折腾网站二级域名的事情,在网上查了很多零碎的文档,不完整,有些也没有自己验证, ...
- ACM: ICPC/CCPC Sudoku DFS - 数独
Sudoku Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/65535K (Java/Other) Total Submis ...
- Ajax跨域问题的两种解决方法
浏览器不允许Ajax跨站请求,所以存在Ajax跨域问题,目前主要有两种办法解决. 1.在请求页面上使用Access-Control-Allow-Origin标头. 使用如下标头可以接受全部网站请求: ...