升级独立群集的配置Upgrade the configuration of a standalone cluster

对于任何新式系统而言,升级能力是实现产品长期成功的关键所在。For any modern system, the ability to upgrade is key to the long-term success of your product. Azure Service Fabric 群集是你拥有的资源。An Azure Service Fabric cluster is a resource that you own. 本文介绍如何升级独立 Service Fabric 群集的配置设置。This article describes how to upgrade the configuration settings of your standalone Service Fabric cluster.

在 ClusterConfig.json 文件中自定义群集设置Customize cluster settings in the ClusterConfig.json file

通过“ClusterConfig.json”文件配置独立群集 。Standalone clusters are configured through the ClusterConfig.json file. 若要了解不同设置的详细信息,请参阅独立 Windows 群集的配置设置To learn more about the different settings, see Configuration settings for a standalone Windows cluster.

可以在“ClusterConfig.json”中群集属性部分下的 fabricSettings 部分中添加、更新或删除设置 。You can add, update, or remove settings in the fabricSettings section under the Cluster properties section in ClusterConfig.json.

例如,以下 JSON 将向 fabricSettings 下的“诊断”部分添加新设置“MaxDiskQuotaInMB” :For example, the following JSON adds a new setting MaxDiskQuotaInMB to the Diagnostics section under fabricSettings:

      {
        "name": "Diagnostics",
        "parameters": [
          {
            "name": "MaxDiskQuotaInMB",
            "value": "65536"
          }
        ]
      }

修改 ClusterConfig.json 文件中的设置后,测试群集配置,再升级群集配置,将设置应用到群集。After you've modified the settings in your ClusterConfig.json file, test the cluster configuration and then upgrade the cluster configuration to apply the settings to your cluster.

测试群集配置Test the cluster configuration

启动配置升级前,可通过运行独立程序包中的以下 PowerShell 脚本来测试新群集配置 JSON:Before you initiate the configuration upgrade, you can test your new cluster configuration JSON by running the following PowerShell script in the standalone package:

TestConfiguration.ps1 -ClusterConfigFilePath <Path to the new Configuration File> -OldClusterConfigFilePath <Path to the old Configuration File>

或使用此脚本:Or use this script:

TestConfiguration.ps1 -ClusterConfigFilePath <Path to the new Configuration File> -OldClusterConfigFilePath <Path to the old Configuration File> -FabricRuntimePackagePath <Path to the .cab file which you want to test the configuration against>

某些配置不能升级(如终结点、群集名称、节点 IP 等)。将会针对旧配置测试新的群集配置 JSON ,并在出现问题时在 PowerShell 窗口中引发错误。Some configurations can't be upgraded, such as endpoints, cluster name, node IP, etc. The new cluster configuration JSON is tested against the old one and throws errors in the PowerShell window if there's an issue.

升级群集配置Upgrade the cluster configuration

若要升级群集配置,请运行 Start-ServiceFabricClusterConfigurationUpgradeTo upgrade the cluster configuration upgrade, run Start-ServiceFabricClusterConfigurationUpgrade. 按升级域逐个处理配置升级。The configuration upgrade is processed upgrade domain by upgrade domain.

Start-ServiceFabricClusterConfigurationUpgrade -ClusterConfigPath <Path to Configuration File>

升级群集证书配置Upgrade cluster certificate configuration

群集证书用于群集节点之间的身份验证。A cluster certificate is used for authentication between cluster nodes. 执行证书滚动更新时格外小心,因为发生失败会导致群集节点之间无法通信。The certificate rollover should be performed with extra caution because failure blocks the communication among cluster nodes.

支持四个选项:Four options are supported:

  • 单证书升级:升级路径为“证书 A(主证书)-> 证书 B(主证书)-> 证书 C(主证书)->....”Single certificate upgrade: The upgrade path is Certificate A (Primary) -> Certificate B (Primary) -> Certificate C (Primary) ->....

  • 双证书升级:升级路径为“证书 A(主证书)-> 证书 A(主证书)和证书 B(辅助证书)-> 证书 B(主证书)-> 证书 B(主证书)和证书 C(辅助证书)-> 证书 C(主证书)-> ...”Double certificate upgrade: The upgrade path is Certificate A (Primary) -> Certificate A (Primary) and B (Secondary) -> Certificate B (Primary) -> Certificate B (Primary) and C (Secondary) -> Certificate C (Primary) ->....

  • 证书类型升级:基于指纹的证书配置 <-> 基于 CommonName 的证书配置。Certificate type upgrade: Thumbprint-based certificate configuration <-> CommonName-based certificate configuration. 例如,“证书指纹 A(主证书)和指纹 B(辅助证书)-> 证书 CommonName C”。For example, Certificate Thumbprint A (Primary) and Thumbprint B (Secondary) -> Certificate CommonName C.

  • 证书颁发者指纹升级:升级路径为“Certificate CN=A,IssuerThumbprint=IT1 (Primary) -> Certificate CN=A,IssuerThumbprint=IT1,IT2 (Primary) -> Certificate CN=A,IssuerThumbprint=IT2 (Primary)”。Certificate issuer thumbprint upgrade: The upgrade path is Certificate CN=A,IssuerThumbprint=IT1 (Primary) -> Certificate CN=A,IssuerThumbprint=IT1,IT2 (Primary) -> Certificate CN=A,IssuerThumbprint=IT2 (Primary).

后续步骤Next steps