在 Azure 数据资源管理器中管理水平缩放(横向扩展)群集以适应不断变化的需求Manage cluster horizontal scaling (scale out) in Azure Data Explorer to accommodate changing demand

调整好群集的大小对于 Azure 数据资源管理器的性能至关重要。Sizing a cluster appropriately is critical to the performance of Azure Data Explorer. 静态群集大小可能导致利用不充分或利用过度,二者都不理想。A static cluster size can lead to under-utilization or over-utilization, neither of which is ideal. 由于无法绝对准确地预测群集的需求,更好的方法是对群集进行缩放,根据不断变化的需求添加或删除容量和 CPU 资源。Because demand on a cluster can’t be predicted with absolute accuracy, it's better to scale a cluster, adding and removing capacity and CPU resources with changing demand.

有两个工作流可用于缩放 Azure 数据资源管理器群集:There are two workflows for scaling an Azure Data Explorer cluster:

  • 水平缩放,也称为横向缩放。Horizontal scaling, also called scaling in and out.
  • 垂直缩放,也称为纵向缩放。Vertical scaling, also called scaling up and down. 本文介绍水平缩放工作流。This article explains the horizontal scaling workflow.

配置水平缩放Configure horizontal scaling

借助水平缩放,可以根据预定义的规则和计划自动缩放实例计数。By using horizontal scaling, you can scale the instance count automatically, based on predefined rules and schedules. 若要指定群集的自动缩放设置,请执行以下操作:To specify the autoscale settings for your cluster:

  1. 在 Azure 门户中,转到 Azure 数据资源管理器群集资源。In the Azure portal, go to your Azure Data Explorer cluster resource. 在“设置”下选择“横向扩展”。 Under Settings, select Scale out.

  2. 在“横向扩展”窗口中,选择想要的自动缩放方法:手动缩放、优化自动缩放或自定义自动缩放 。In the Scale out window, select the autoscale method that you want: Manual scale, Optimized autoscale, or Custom autoscale.

手动缩放Manual scale

手动缩放是群集创建过程中的默认设置。Manual scale is the default setting during cluster creation. 群集有一个不会自动更改的静态容量。The cluster has a static capacity that doesn't change automatically. 可以使用“实例计数”栏选择静态容量。You select the static capacity by using the Instance count bar. 群集的缩放保持在该设置,除非你再次进行更改。The cluster's scaling remains at that setting until you make another change.

手动缩放方法

自定义自动缩放Custom autoscale

使用自定义自动缩放,可以根据指定的指标动态地缩放群集。By using custom autoscale, you can scale your cluster dynamically based on metrics that you specify. 下图显示配置自定义自动缩放的流程和步骤。The following graphic shows the flow and steps to configure custom autoscale. 图后面提供了更多详细信息。More details follow the graphic.

  1. 在“自动缩放设置名称”框中输入一个名称,例如“横向扩展: 缓存使用率”。In the Autoscale setting name box, enter a name, such as Scale-out: cache utilization.

    缩放规则

  2. 至于“缩放模式”,请选择“基于指标缩放”。For Scale mode, select Scale based on a metric. 此模式提供动态缩放。This mode provides dynamic scaling. 也可选择“缩放为具体实例数”。You can also select Scale to a specific instance count.

  3. 选择“+ 添加规则”。Select + Add a rule.

  4. 在右侧的“缩放规则”部分,输入每项设置的值。In the Scale rule section on the right, enter values for each setting.

    条件Criteria

    设置Setting 说明和值Description and value
    时间聚合Time aggregation 选择聚合条件,例如“平均”。Select an aggregation criteria, such as Average.
    指标名称Metric name 选择要求缩放操作依赖的指标,例如“缓存使用率”。Select the metric you want the scale operation to be based on, such as Cache Utilization.
    时间粒度统计信息Time grain statistic AverageMinimumMaximumSum 之间选择。Choose between Average, Minimum, Maximum, and Sum.
    运算符Operator 选择适当的选项,例如“大于或等于”。Choose the appropriate option, such as Greater than or equal to.
    阈值Threshold 选择适当的值。Choose an appropriate value. 例如,对于缓存使用率,一开始可以选择 80%。For example, for cache utilization, 80 percent is a good starting point.
    持续时间(分钟)Duration (in minutes) 选择适当的时间值,以便系统在计算指标时进行回溯。Choose an appropriate amount of time for the system to look back when calculating metrics. 一开始可将默认值设置为 10 分钟。Start with the default of 10 minutes.

    操作Action

    设置Setting 说明和值Description and value
    操作Operation 选择进行横向缩减或横向扩展的适当选项。Choose the appropriate option to scale in or scale out.
    实例计数Instance count 选择在符合指标条件的情况下,需要添加或删除的节点或实例的数目。Choose the number of nodes or instances you want to add or remove when a metric condition is met.
    冷却(分钟)Cool down (minutes) 选择需要在两项缩放操作之间等待的适当时间间隔。Choose an appropriate time interval to wait between scale operations. 一开始可将默认值设置为 5分钟。Start with the default of five minutes.
  5. 选择“添加” 。Select Add.

  6. 在左侧的“实例限制”部分,输入每项设置的值。In the Instance limits section on the left, enter values for each setting.

    设置Setting 说明和值Description and value
    最低Minimum 群集在缩放时不管使用率如何都不得低于的实例数。The number of instances that your cluster won't scale below, regardless of utilization.
    最高Maximum 群集在缩放时不管使用率如何都不得高于的实例数。The number of instances that your cluster won't scale above, regardless of utilization.
    默认Default 默认实例数。The default number of instances. 在出现资源指标读取问题时使用此设置。This setting is used if there are problems with reading the resource metrics.
  7. 选择“保存” 。Select Save.

现在已为 Azure 数据资源管理器群集配置了水平缩放。You've now configured horizontal scaling for your Azure Data Explorer cluster. 添加另一个垂直缩放规则。Add another rule for vertical scaling. 如果在解决群集缩放问题时需要帮助,请在 Azure 门户中提交支持请求If you need assistance with cluster-scaling issues, open a support request in the Azure portal.

后续步骤Next steps