我想基於蔚藍隊列的長度自動調整我的azure輔助角色。根據所有documentation我已經看到這應該是非常簡單的,使用queueLength操作數。基於隊列長度的Azure自動調整
我已經實現了autoscaler,將其上傳到我的服務中,並向我的隊列中添加了一堆元素,但實例的數量沒有增加。
故障排除的最佳方式是什麼?我已遠程桌面化到角色,事件日誌中沒有任何內容。是否有可以檢查的自動縮放事件/錯誤日誌?
編輯: 當我在我的開發環境中運行應用程序時,我看到autscaler已成功加載ServiceInfo.xml。有一個隊列條目和一個角色條目。但是,規則似乎沒有從rules.xml文件中加載。
更多編輯: 當我從rules.xml文件中刪除了reactiverules和operands節點時,約束規則成功加載。所以問題出現在其中一個節點上。
我serviceinfo XML文件:
<?xml version="1.0" encoding="utf-8"?>
<serviceModel xmlns="http://schemas.microsoft.com/practices/2011/entlib/autoscaling/serviceModel">
<subscriptions>
<subscription name="MySubscription" subscriptionId="blah" certificateThumbprint="blah" certificateStoreName="My" certificateStoreLocation="CurrentUser">
<storageAccounts>
<storageAccount alias="targetstorage" connectionString="DefaultEndpointsProtocol=https;AccountName=blah; AccountKey="blah">
<queues>
<queue alias="auditqueue" queueName="auditqueue"/>
</queues>
</storageAccount>
</storageAccounts>
<services>
<service dnsPrefix="blah" slot="Production" scalingMode="Scale">
<roles>
<role alias="ScalingWebRole" roleName="ScalingWebRole" wadStorageAccountName="targetstorage" />
</roles>
</service>
</services>
</subscription>
</subscriptions>
</serviceModel>
我的規則XML文件:
<constraintRules>
<rule name="Default" enabled="true" rank="1">
<actions>
<range target="ScalingWebRole" min="1" max="10" />
</actions>
</rule>
</constraintRules>
<reactiveRules>
<rule name="Scale up when queue is long" enabled="true">
<actions>
<scale target="ScalingWebRole" by="1" />
</actions>
<when>
<greaterOrEqual operand="QueueLength_Avg" than="5" />
</when>
</rule>
<rule name="Scale down when queue is short" enabled="true">
<actions>
<scale target="ScalingWebRole" by="-1" />
</actions>
<when>
<less operand="QueueLength_Avg" than="5" />
</when>
</rule>
</reactiveRules>
<operands>
<queueLength alias="QueueLength_Avg" aggregate="Average" queue="auditqueue" timespan="00:01:00" />
</operands>
</rules>
感謝您的建議。我已經添加到我的配置,但它仍然不會編寫診斷(據我所知,無論如何)。任何其他想法? – Mac