Service Fabric 准则Service Fabric guardrails

部署 Service Fabric 群集时,需遵循相应准则,使用有效的群集配置通过 Azure 资源管理器进行部署,否则就会失败。When deploying a Service Fabric cluster, guardrails are put in place, which will fail an Azure Resource Manager deployment in the case of an invalid cluster configuration. 以下部分概述了常见的群集配置问题,以及解决这些问题所需的步骤。The following sections provide an overview of common cluster configuration issues and the steps required to mitigate these issues.

持久性不匹配Durability mismatch

概述Overview

Service Fabric 节点类型的持久性值在 Azure 资源管理器模板的两个不同部分定义。The durability value for a Service Fabric node type is defined in two different sections of an Azure Resource Manager template. 这两个部分是虚拟机规模集资源的虚拟机规模集扩展部分,以及 Service Fabric 群集资源的节点类型部分。The Virtual Machine Scale Set extension section of the Virtual Machine Scale Set resource, and the Node Type section of the Service Fabric cluster resource. 这两个部分中的持久性值必须匹配,否则部署会失败。It is a requirement that the durability value in these sections match, otherwise the resource deployment will fail.

以下部分包含一个示例,该示例展示了虚拟机规模集扩展持久性设置和 Service Fabric 节点类型持久性设置之间存在的持久性不匹配情况:The following section contains an example of a durability mismatch between the Virtual Machine Scale Set extension durability setting and the Service Fabric Node Type durability setting:

虚拟机规模集持久性设置Virtual Machine Scale Set durability setting

{
  "extensions": [
    {
      "name": "[concat('ServiceFabricNodeVmExt','_vmNodeType0Name')]",
      "properties": {
        "type": "ServiceFabricNode",
        "publisher": "Microsoft.Azure.ServiceFabric",
        "settings": {
          "durabilityLevel": "Silver",
        }
      }
    }
  ]
}

Service Fabric 节点类型持久性设置Service Fabric node type durability setting

{
  "nodeTypes": [
    {
      "name": "[variables('vmNodeType0Name')]",
      "durabilityLevel": "Bronze",
      "isPrimary": true,
      "vmInstanceCount": "[parameters('nt0InstanceCount')]"
    }
  ]
}

错误消息Error messages

  • 虚拟机规模集持久性与当前的 Service Fabric 节点类型持久性级别不匹配Virtual Machine Scale Set durability mismatch does not match the current Service Fabric Node Type durability level
  • 虚拟机规模集持久性与目标 Service Fabric 节点类型持久性级别不匹配Virtual Machine Scale Set durability does not match the target Service Fabric Node Type durability level
  • 虚拟机规模集持久性与当前的 Service Fabric 持久性级别或目标 Service Fabric 节点类型持久性级别不匹配Virtual Machine Scale Set durability does match the current Service Fabric durability level or the target Service Fabric Node Type durability level

缓解措施Mitigation

若要修复上述任何错误消息所指示的持久性不匹配问题,请执行以下操作:To fix a durability mismatch, which is indicated by any of the above error messages:

  1. 更新 Azure 资源管理器模板的虚拟机规模集扩展或 Service Fabric 节点类型部分中的持久性级别,确保这些值匹配。Update the durability level in either the Virtual Machine Scale Set extension or Service Fabric Node Type section of the Azure Resource Manager template to ensure that the values match.
  2. 使用更新的值重新部署 Azure 资源管理器模板。Redeploy the Azure Resource Manager template with the updated values.

删除种子节点Seed node deletion

概述Overview

Service Fabric 群集提供一个可靠性层属性,用于确定主节点类型的群集上运行的系统服务副本数。A Service Fabric cluster has a reliability tier property which is used to determine the number of replicas of system services that run on the primary node type of the cluster. 所需副本数将确定必须在主节点类型的群集中维护的最小节点数。The number of required replicas will determine the minimum number of nodes that must be maintained in the primary node type of the cluster. 如果主节点类型中的节点数小于可靠性层所需的最小数目,则群集将变得不稳定。If the number of nodes in the primary node type goes below the required minimum for the reliability tier, the cluster will become unstable.

错误消息Error messages

已检测到种子节点删除操作,将拒绝该操作。Seed node removal operation has been detected, and will be rejected.

  • 此操作会导致只有 {0} 个潜在种子节点保留在群集中,而所需的最小数目是 {1}。This operation would result in only {0} potential seed nodes to remain in the cluster, while {1} are needed as a minimum.
  • 从 {1} 中删除 {0} 种子节点会导致群集因种子节点仲裁丢失而关闭。Removing {0} seed nodes out of {1} would result in the cluster going down due to loss of seed node quorum. 每次最多可以删除的种子节点数为 {2} 个。Maximum number of seed nodes that can be removed at a time is {2}.

缓解措施Mitigation

确保主节点类型具有足够的虚拟机,以实现群集中指定的可靠性。Ensure that your primary node type has enough Virtual Machines for the reliability specified on your cluster. 如果删除某个虚拟机会导致虚拟机规模集的节点数小于给定可靠性层的最小节点数,将无法执行此删除操作。You will not be able to remove a Virtual Machine if it will bring the Virtual Machine Scale Set below the minimum number of nodes for the given reliability tier.

  • 如果正确指定了可靠性层,请确保在主节点类型中提供可靠性层所需的足够节点。If the reliability tier is correctly specified, make sure that you have enough nodes in the primary node type as needed for the reliability tier.
  • 如果可靠性层不正确,请在 Service Fabric 资源中发起更改以便先降低可靠性级别,然后启动任何虚拟机规模集操作并等待操作完成。If the reliability tier is incorrect, initiate a change on the Service Fabric resource to lower the reliability level first before initiating any Virtual Machine Scale Set operations, and wait for it to complete.
  • 如果可靠性层为“铜级”,请按照这些步骤适度横向缩减群集。If the reliability tier is Bronze, please follow these steps to scale in your cluster gracefully.

后续步骤Next steps