首页 > 解决方案 > 为什么服务结构不能在 Azure 门户中使用自动缩放功能进行缩放?

问题描述

我对服务结构集群进行了以下设置:

  1. 5 个节点(耐久性等级:青铜和可靠性等级:银)
  2. 相关 VM 规模集 (VMSS) 上的当前平均 CPU 利用率百分比平均约为 14%。
  3. 每个服务都正确部署,实例计数为 -1。
  4. 我们使用上述服务的应用程序运行良好。

使用 azure 门户,我尝试为上述 VMSS 设置自动缩放选项(在缩放选项中):

  1. 使用 CPU 利用率百分比阈值为 10 的横向扩展(从上面看,当前值为 14)。
  2. 将其配置为在扩展之前等待 5 分钟。
  3. 其余详细信息显示在下面的 json 中。

{ "location": "eastus", "tags": { "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" }, "properties": { "name": "My Testing", "enabled": true, "targetResourceUri": "/subscriptions/MySubScriptionID/resourceGroups/My-RG-Name/providers/Microsoft.Compute/virtualMachineScaleSets/nt1vm", "profiles": [ { "name": "Auto created scale condition 1", "capacity": { "minimum": "5", "maximum": "10", "default": "5" }, "rules": [ { "scaleAction": { "direction": "Decrease", "type": "ChangeCount", "value": "1", "cooldown": "PT5M" }, "metricTrigger": { "metricName": "Percentage CPU", "metricNamespace": "", "metricResourceUri": "/subscriptions//MySubScriptionID//resourceGroups/My-RG-Name/providers/Microsoft.Compute/virtualMachineScaleSets/nt1vm", "operator": "LessThan", "statistic": "Average", "threshold": 5, "timeAggregation": "Average", "timeGrain": "PT1M", "timeWindow": "PT5M" } } ], "fixedDate": { "timeZone": "Mountain Standard Time", "start": "2018-09-18T00:00:00.000Z", "end": "2018-09-21T23:59:00.000Z" } }, { "name": "Auto created scale condition", "capacity": { "minimum": "5", "maximum": "10", "default": "5" }, "rules": [ { "scaleAction": { "direction": "Increase", "type": "ChangeCount", "value": "1", "cooldown": "PT15M" }, "metricTrigger": { "metricName": "Percentage CPU", "metricNamespace": "", "metricResourceUri": "/subscriptions/MySubScriptionID/resourceGroups/My-RG-Name/providers/Microsoft.Compute/virtualMachineScaleSets/nt1vm", "operator": "GreaterThanOrEqual", "statistic": "Average", "threshold": 10, "timeAggregation": "Average", "timeGrain": "PT1M", "timeWindow": "PT5M" } } ] } ], "notifications": [ { "operation": "Scale", "email": { "sendToSubscriptionAdministrator": false, "sendToSubscriptionCoAdministrators": false, "customEmails": [ "" ] }, "webhooks": [] } ], "targetResourceLocation": "eastus" }, "id": "/subscriptions/MySubScriptionID/resourceGroups/My-RG-Name/providers/microsoft.insights/autoscalesettings/My Testing", "name": "My Testing", "type": "Microsoft.Insights/autoscaleSettings" }

观察:

  1. 我等了超过 5 分钟(这是扩展选项的 timeWindow 值)。不会创建新节点。
  2. 等待 10 分钟、20 分钟和 30 分钟后没有创建新节点。
  3. 当我在上述 VMSS(在 Scaling 选项中)的 azure 门户中手动将节点数配置为 6(从 5 个)时,会创建节点并且一切都按预期工作。

问题:

  1. 在上述自动缩放选项的配置中我做错了什么?

标签: azure-service-fabricautoscaling

解决方案


看来我的规则规模与扩大规则相冲突。一旦我删除了规则中的比例,一切都开始工作了。


推荐阅读