简体   繁体   English

Azure:如何更改Resource Manager托管VM / IP的空闲超时

[英]Azure: How to change idle timeout for Resource Manager managed VMs/IPs

I was surprised to find out that Azure enforces a slient TCP connection timeout, which is by default set to 4 mintues. 我很惊讶地发现Azure强制执行一个简单的TCP连接超时,默认设置为4分钟。 I need to change this, as we're running long-running TCP connections and no communication should be sent to conserve power on embedded devices. 我需要对此进行更改,因为我们正在运行长时间运行的TCP连接,并且不应发送任何通信以节省嵌入式设备的电源。

There are a couple of guides online ( https://azure.microsoft.com/en-us/blog/new-configurable-idle-timeout-for-azure-load-balancer/ ), but they all cover cases where the VMs are provisioned using the Service manager (Classic). 网上有几个指南( https://azure.microsoft.com/en-us/blog/new-configurable-idle-timeout-for-azure-load-balancer/ ),但它们都涵盖了虚拟机的情况使用服务管理器(Classic)进行配置。 So changing this in Classic is not an issue, but we're already running the VMs provisioned via the Resource Manager. 因此,在Classic中更改此选项不是问题,但我们已经在运行通过资源管理器配置的VM。

After running: 运行后:

Switch-AzureMode AzureResourceManager
Get-AzureVM -Name "MyVM" -ResourceGroup "MyGroup" | Get-AzurePublicIpAddress 

I get the configuration printout for the IP, with IdleTimeoutInMinutes set at default 4 . 我得到IP的配置打印输出, IdleTimeoutInMinutes设置为默认值4

Changing this using: 改变这个使用:

Get-AzureVM -Name "MyVM" -ResourceGroup "MyGroup" | Get-AzurePublicIpAddress | Set-AzurePublicIpAddress -IdleTimeoutInMinutes 29

fails with: A parameter cannot be found that matches parameter name `IdleTimeoutInMinutes` . 失败: A parameter cannot be found that matches parameter name `IdleTimeoutInMinutes`

A guide or suggestion how to go forward will be appreciated. 如何前进的指南或建议将不胜感激。 Should I remove the IP and create a new one? 我应该删除IP并创建一个新IP吗? There surely is a better way. 肯定有更好的方法。

Try this for the 1.x cmdlets: 尝试使用1.x cmdlet:

$p = Get-AzureRmPublicIpAddress -Name MyIP -ResourceGroupName MyGroup
$p.IdleTimeoutInMinutes = 29
Set-AzureRmPublicIpAddress -PublicIpAddress $p

Or if you're on the older 0.9.x cmdlets: 或者,如果您使用的是较旧的0.9.x cmdlet:

Switch-AzureMode
$p = Get-AzurePublicIpAddress -Name MyIP -ResourceGroupName MyGroup
$p.IdleTimeoutInMinutes = 29
Set-AzurePublicIpAddress -PublicIpAddress $p

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM