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),如果你使用的是由世纪 ...
随机推荐
- Linux学习笔记(10)-信号
所谓信号(singal),在我的理解来说,其实和单片机开发中的中断差不多,但是它并非是由系统硬件所提供的,而是软件操作系统的支持的一种提醒机制. 收到信号之后的处理方法,一般由三种: (1)第一种是类 ...
- [NHibernate]利用LINQPad查看NHibernate生成SQL语句
上篇文章中我们提到可以通过重写NHibernate的 EmptyInterceptor 拦截器来监控NHibernate发送给数据库的SQL脚本,今天看到有朋友用LINQPad工具来进行NHibern ...
- XE2 IntraWeb尝试
新建--选择--确定 简单放几个控件在TIWForm1上面,运行,生成一个项目服务器: 复制 URL http://127.0.0.1:8888/$/start 打开网页.
- OSG消息机制之消息分析
OSG消息接收在头文件有各种事件的相关参数
- ajax返回json数据,对其中日期的解析
JS 对其格式化 方法如下 function ChangeDateFormat(d){ //将时间戳转为int类型,构造Date类型 var date = new Date(parseInt(d.ti ...
- Codeforces663E Binary Table(FWT)
题目 Source http://codeforces.com/contest/663/problem/E Description You are given a table consisting o ...
- ASP.NET中获取Repeater模板列中LinkButton按钮事件中获取ID等
前台页面中: <asp:Repeater ID="repComment" runat="server"> <ItemTe ...
- mas_makeConstraints && mas_remakeConstraints && mas_updateConstraints 用法与注意事项
mas_makeConstraints && mas_remakeConstraints && mas_updateConstraints 用法与注意事项 字数400 ...
- 国内外三个不同领域巨头分享的Redis实战经验及使用场景
Redis不是比较成熟的memcache或者Mysql的替代品,是对于大型互联网类应用在架构上很好的补充.现在有越来越多的应用也在纷纷基于Redis做架构的改造.首先简单公布一下Redis平台实际情况 ...
- Master-Slave通用基础框架
一.设计目的 设计出一个通用的Master-Slave基础框架,然后可以基于这个框架来实现特定的业务需求,比如实现多节点并行计算.分布式处理等. 二.设计理念 基于经典的命令模式,Master和Sla ...