Azure Service Fabric 节点类型与虚拟机规模集Azure Service Fabric node types and virtual machine scale sets

虚拟机规模集是一种 Azure 计算资源。Virtual machine scale sets are an Azure compute resource. 可使用规模集以集的形式部署和管理虚拟机集合。You can use scale sets to deploy and manage a collection of virtual machines as a set. 在 Azure Service Fabric 群集中定义的每个节点类型都只设置了一个规模集:多个节点类型不能由同一规模集提供支持,而一个节点类型不应由多个规模集提供支持。Each node type that you define in an Azure Service Fabric cluster sets up exactly one scale set: multiple node types cannot be backed by the same scale set and one node type should not be backed by multiple scale sets.

规模集中每个虚拟机上均通过 Microsoft.Azure.ServiceFabric 虚拟机扩展安装了 Service Fabric 运行时。The Service Fabric runtime is installed on each virtual machine in the scale set by the Microsoft.Azure.ServiceFabric Virtual Machine extension. 可独立增加或减少每个节点类型、更改每个群集节点上运行的 OS SKU、打开不同的端口集,并使用不同的容量指标。You can independently scale each node type up or down, change the OS SKU running on each cluster node, have different sets of ports open, and use different capacity metrics.

下图显示了一个具有两个节点类型(分别名为“FrontEnd”和“BackEnd”)的群集。The following figure shows a cluster that has two node types, named FrontEnd and BackEnd. 每个节点类型具有五个节点。Each node type has five nodes.


将虚拟机规模集实例映射到节点Map virtual machine scale set instances to nodes

如上图中所示,缩放集实例以实例 0 开始,然后以基数 1 递增。As shown in the preceding figure, scale set instances start at instance 0, and then increase by 1. 编号反映在节点名称中。The numbering is reflected in the node names. 例如,节点 BackEnd_0 是 BackEnd 规模集的实例 0。For example, node BackEnd_0 is instance 0 of the BackEnd scale set. 此特定规模集具有五个实例,名称分别为 BackEnd_0、BackEnd_1、BackEnd_2、BackEnd_3、BackEnd_4。This particular scale set has five instances, named BackEnd_0, BackEnd_1, BackEnd_2, BackEnd_3, and BackEnd_4.

横向扩展规模集时,将创建新的实例。When you scale out a scale set, a new instance is created. 新的规模集实例名称通常是规模集名称加上下一个实例编号。The new scale set instance name typically is the scale set name plus the next instance number. 在本示例中,即 BackEnd_5。In our example, it is BackEnd_5.

将规模集负载均衡器映射到节点类型和规模集Map scale set load balancers to node types and scale sets

如果已在 Azure 门户部署群集,或使用了示例 Azure 资源管理器模板,将列出资源组下所有的资源。If you deployed your cluster in the Azure portal or used the sample Azure Resource Manager template, all resources under a resource group are listed. 可看到每个规模集或节点类型的负载均衡器。You can see the load balancers for each scale set or node type. 负载均衡器名称使用以下格式:LB-<节点类型名称>。The load balancer name uses the following format: LB-<node type name>. 例如,下图中显示的 LB-sfcluster4doc-0:An example is LB-sfcluster4doc-0, as shown in the following figure:


Service Fabric 虚拟机扩展Service Fabric Virtual Machine Extension

Service Fabric 虚拟机扩展用于将 Service Fabric 启动到 Azure 虚拟机以及配置节点安全性。Service Fabric Virtual Machine Extension is used to bootstrap Service Fabric to Azure Virtual Machines, and configure the Node Security.

下面是 Service Fabric 虚拟机扩展的代码片段:The following is a snippet of Service Fabric Virtual Machine extension:

"extensions": [
    "name": "[concat('ServiceFabricNodeVmExt','_vmNodeType0Name')]",
    "properties": {
      "type": "ServiceFabricLinuxNode",
      "autoUpgradeMinorVersion": true,
      "protectedSettings": {
        "StorageAccountKey1": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('supportLogStorageAccountName')),'2015-05-01-preview').key1]",
       "publisher": "Microsoft.Azure.ServiceFabric",
       "settings": {
         "clusterEndpoint": "[reference(parameters('clusterName')).clusterEndpoint]",
         "nodeTypeRef": "[variables('vmNodeType0Name')]",
         "durabilityLevel": "Silver",
         "enableParallelJobs": true,
         "nicPrefixOverride": "[variables('subnet0Prefix')]",
         "dataPath": "D:\\\\SvcFab",
         "certificate": {
           "commonNames": [
           "x509StoreName": "[parameters('certificateStoreValue')]"
       "typeHandlerVersion": "1.1"

下面是属性说明:The following are the property descriptions:

名称Name 允许的值Allowed Values 指导或简短说明Guidance or Short Description
namename stringstring 扩展的唯一名称Unique name for extension
typetype “ServiceFabricLinuxNode”或“ServiceFabricWindowsNode”"ServiceFabricLinuxNode" or "ServiceFabricWindowsNode" 确定 OS Service Fabric 正启动到Identifies OS Service Fabric is bootstrapping to
autoUpgradeMinorVersionautoUpgradeMinorVersion true 或 falsetrue or false 启用自动升级 SF 运行时次要版本的功能Enable Auto Upgrade of SF Runtime Minor Versions
publisherpublisher Microsoft.Azure.ServiceFabricMicrosoft.Azure.ServiceFabric Service Fabric 扩展发布者的名称Name of the Service Fabric extension publisher
clusterEndpontclusterEndpont stringstring 管理终结点的 URI:PORTURI:PORT to Management endpoint
nodeTypeRefnodeTypeRef stringstring nodeType 的名称Name of nodeType
durabilityLeveldurabilityLevel 青铜、白银、黄金、白金bronze, silver, gold, platinum 允许用于暂停不可变 Azure 基础结构的时间Time allowed to pause immutable Azure Infrastructure
enableParallelJobsenableParallelJobs true 或 falsetrue or false 启用计算 ParallelJobs,例如在同一规模集中以并行方式删除 VM 和重启 VMEnable Compute ParallelJobs like remove VM and reboot VM in the same scale set in parallel
nicPrefixOverridenicPrefixOverride stringstring 子网前缀,例如“”Subnet Prefix like ""
commonNamescommonNames string[]string[] 已安装群集证书的公用名Common Names of installed cluster certificates
x509StoreNamex509StoreName stringstring 已安装群集证书所在的存储的名称Name of Store where installed cluster certificate is located
typeHandlerVersiontypeHandlerVersion 1.11.1 扩展版本。Version of Extension. 建议使用 1.0 经典版扩展来升级到 1.11.0 classic version of extension are recommended to upgrade to 1.1
dataPathdataPath stringstring 用于保存 Service Fabric 系统服务状态和应用程序数据的驱动器路径。Path to the drive used to save state for Service Fabric system services and application data.

后续步骤Next steps