通过添加虚拟机规模集扩大 Service Fabric 群集Scale a Service Fabric cluster out by adding a virtual machine scale set

本文介绍如何通过将新的节点类型添加到现有群集来扩大 Azure Service Fabric 群集。This article describes how to scale an Azure Service Fabric cluster by adding a new node type to an existing cluster. Service Fabric 群集是通过网络连接在一起的一组虚拟机或物理机,可在其中部署和管理微服务。A Service Fabric cluster is a network-connected set of virtual or physical machines into which your microservices are deployed and managed. 属于群集一部分的计算机或 VM 称为节点。A machine or VM that's part of a cluster is called a node. 虚拟机规模集是一种 Azure 计算资源,用于将一组 VM 作为一个集进行部署和管理。Virtual machine scale sets are an Azure compute resource that you use to deploy and manage a collection of virtual machines as a set. Azure 群集中定义的每个节点类型设置为独立的规模集Every node type that is defined in an Azure cluster is set up as a separate scale set. 然后可以单独管理每个节点类型。Each node type can then be managed separately. 创建 Service Fabric 群集之后,可以通过将新的节点类型(虚拟机规模集)添加到现有群集来水平缩放群集。After creating a Service Fabric cluster, you can scale a cluster horizontally by adding a new node type (virtual machine scale set) to an existing cluster. 随时可以缩放群集,即使该群集上正在运行工作负荷。You can scale the cluster at any time, even when workloads are running on the cluster. 在缩放群集的同时,应用程序也会随之自动缩放。As the cluster scales, your applications automatically scale as well.

将其它规模集添加到现有群集Add an additional scale set to an existing cluster

将新的节点类型(由虚拟机规模集支持)添加到现有群集,该操作类似于升级主节点类型,但不会使用相同的 NodeTypeRef;很显然,这不会禁用任何活跃使用的虚拟机规模集,并且如果不更新主节点类型,将不会失去群集可用性。Adding a new node type (which is backed by a virtual machine scale set) to an existing cluster is similar to upgrading of the primary node type, except you won't use the same NodeTypeRef; obviously won't be disabling any actively used virtual machine scale sets, and you won't lose cluster availability if you do not update the primary node type.

NodeTypeRef 属性在虚拟机规模集 Service Fabric 扩展属性中声明:NodeTypeRef property is declared within the virtual machine scale set Service Fabric extension properties:

<snip>
"publisher": "Microsoft.Azure.ServiceFabric",
     "settings": {
     "clusterEndpoint": "[reference(parameters('clusterName')).clusterEndpoint]",
     "nodeTypeRef": "[parameters('vmNodeType2Name')]",
     "dataPath": "D:\\\\SvcFab",
     "durabilityLevel": "Silver",
<snip>

此外,需要将此新节点类型添加到 Service Fabric 群集资源:Additionally you will need to add this new node type to your Service Fabric cluster resource:

<snip>
"nodeTypes": [
      {
      "name": "[parameters('vmNodeType2Name')]",
      "applicationPorts": {
                "endPort": "[parameters('nt2applicationEndPort')]",
                "startPort": "[parameters('nt2applicationStartPort')]"
      },
      "clientConnectionEndpointPort": "[parameters('nt2fabricTcpGatewayPort')]",
      "durabilityLevel": "Silver",
       "ephemeralPorts": {
                "endPort": "[parameters('nt2ephemeralEndPort')]",
                "startPort": "[parameters('nt2ephemeralStartPort')]"
      },
      "httpGatewayEndpointPort": "[parameters('nt2fabricHttpGatewayPort')]",
      "isPrimary": false,
      "vmInstanceCount": "[parameters('nt2InstanceCount')]"
},
<snip>

后续步骤Next steps