你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

将节点数组添加到群集

使用节点数组定义群集在纵向扩展和缩减时如何创建和删除特定类型的节点。 每个节点数组都有一个名称、一组应用于数组中的每个节点的属性,以及描述数组缩放方式的可选属性,例如限制、放置组和规模集配置。

本文介绍如何使用模板文件将节点数组添加到现有群集。 详细了解节点数组。

编辑群集模板

若要添加节点数组,需要群集的 模板文件 。 编辑此文件,并在[cluster]节下添加新的[[nodearray]]节。 为节点数组提供群集中的唯一名称。

例如,以下模板包含一个使用 Standard_M64 VM 的名为 highmem 的节点数组,而不是节点默认值中指定的值 (Standard_D4_v2):

# hpc-template.txt

[cluster hpc]

    [[node defaults]]
    Credentials = $Credentials
    ImageName = cycle.image.centos7
    SubnetId = my-subnet
    Region = USEast2
    MachineType = Standard_D4_v2

    [[node scheduler]]

    [[nodearray highmem]]
    MachineType = Standard_M64


[parameters Cluster Parameters]

    [[parameter Credentials]]
    ParameterType = Cloud.Credentials
    Label = Credentials

    [[parameter Region]]
    ParameterType = Cloud.Region
    Label = Region
    DefaultValue = westus2

    [[[parameter SubnetId]]]
    ParameterType = Azure.Subnet
    Label = Subnet
    Required = true

重新导入修改后的群集模板

若要应用群集模板更改并创建新节点数组,请使用 CycleCloud CLI 导入模板。 必须指定要修改的群集的名称,并包含 --force 标志,以指示 CLI 覆盖现有群集中的值。

以下命令将更改应用于名为: 的 example-cluster群集:

cyclecloud import_cluster example-cluster -f hpc-template.txt -c hpc --force

若要测试新节点数组,请转到 Web UI 并选择“ 添加节点”。 选择 highmem 数组,然后选择“ 添加 ”以创建新节点。 若要进行进一步更改,请编辑模板文件,然后再次运行导入命令。

添加数组节点

延伸阅读