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),如果你使用的是由世纪 ...
随机推荐
- ASP.Net Core 里是如何把一个普通的 Action 返回类型转换为某种 IActionResult 的
秘密在于这个类型: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker 在它的 CreateActionResult 方法里会将相关类型 ...
- 外接Hdmi没有声音怎么设置
参考 http://www.3lian.com/edu/2013/07-16/81152.html 在小喇叭图标上右键->播放设备->禁用HDMI
- Android传递数据5种方法
Android开发中,在不同模块(如Activity)间经常会有各种各样的数据需要相互传递,我把常用的几种 方法都收集到了一起.它们各有利弊,有各自的应用场景. 我现在把它们集中到一个例子中展示 ...
- java网络编程1
Socket的构造方法包括: 1.Socket(),无参构造方法: 2.Socket(InetAddress address,int port) throws UnknownHostException ...
- BZOJ 1047 二维单调队列
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1047 题意:见中文题面 思路:该题是求二维的子矩阵的最大值与最小值的差值尽量小.所以可以考 ...
- Linux usual cmd
日常工作时常需要用到,在此备份一下: <1> top命令 第一行:当前系统时间为23:31:59,系统已经运行了127天又19小时47分钟,当前系统只要一个用户即root,load ave ...
- Unity中的Matrix4x4类
物体平移旋转一般变换底层都是用矩阵来表示的,一般不会用到这个类.有时候需要一些世界坐标与局部坐标转换的时候,可能就要用到了. //创建平移 旋转 缩放矩阵 可以理解为一个坐标系(不知道对不对..) M ...
- WPF上传文件到服务器
利用WebClient 上传文件到服务器 创建一个空网站,创建一个UploadFile.aspx项, 服务器报500错误:检查文件保存路径是否存在,检查文件大小限制 protected void Pa ...
- C,C++
C与C++的Struct有何区别,Java有Struct吗,C++里Struct与Class区别: C++虚析构函数作用: static静态变量初始化: 深复制与浅复制区别: const * int ...
- 《一个操作系统的实现》学习笔记(一) bochs源码安装及配置
前言:本机环境ubuntu 14.04 bochs 2.4.5 一.下载 官网 http://bochs.sourceforge.net/ 二.安装 1.将下载好的压缩包解压并进入该目录 .tar.g ...