【问题标题】:Service Fabric .Net Framework 4.5.1 and 4.6Service Fabric .Net Framework 4.5.1 和 4.6
【发布时间】:2016-02-24 07:25:50
【问题描述】:

将目标框架从 4.5.1 更改为 4.6 后 Auzure Fail 中的服务,本地部署正在运行。

我需要添加 .Net 4.6 支持吗? - 我无法找到可以在 Azure 集群中看到可用框架的位置。

谢谢

应用程序名称: 结构:/Lending20.Service.IdentityManagement AggregatedHealthState
: 错误 UnhealthyEvaluations : 不健康的服务:100% (1/1), ServiceType='IdentityManagementServiceType', MaxPercentUnhealthyServices=0%。

不健康的服务: ServiceName='fabric:/Lending20.Service.IdentityManagement/Identity ManagementService', AggregatedHealthState='错误'。

不健康的分区:100% (1/1), MaxPercentUnhealthyPartitionsPerService=0%。

不健康的分区: PartitionId='7c68b397-fda3-491d-9e17-921cd24217ca', AggregatedHealthState='错误'。

错误事件:SourceId='System.FM',Property='State'。

服务健康状态: 服务名称 : 结构:/Lending20.Service.IdentityManagement/IdentityManagementService AggregatedHealthState:错误

已部署应用程序健康状态: 应用程序名称:结构:/Lending20.Service.IdentityManagement 节点名称:_lending1 AggregatedHealthState:好的

健康事件: SourceId:系统.CM 属性:状态 健康状态:好的 序列号:3464 发送时间:2015 年 11 月 21 日下午 12:38:08 收到时间:11/21/2015 12:38:08 PM TTL:无限 描述:应用程序已创建。 RemoveWhenExpired : 假 已过期:假 转换:警告->确定 = 11/21/2015 12:38:08 PM,LastError = 1/1/0001 中午 12:00:00

【问题讨论】:

    标签: azure-service-fabric


    【解决方案1】:

    .NET 4.6 在 Azure 中使用的默认 Windows Server 2012 映像中尚不可用。此时,您唯一的选择是登录每个 VM 并安装它。

    【讨论】:

      【解决方案2】:

      另一个选项是使用包含 DSC 扩展的 azure 资源组模板来配置您的 VM 以安装 .net 46。 这是我的dsc powershell中的sn-p来处理.net 461的安装 codegist 获取更完整的脚本

      【讨论】:

      • 这实际上相当困难,因为 .NET 4.6.1 不是一个单独的产品,而是一个 Windows 更新。 Windows Server 2012 R2 中的默认 powershell 版本是 4.0,4.0 中的 DSC 不支持处理 windows 更新。因此,为了将 DSC 与 Windows 更新结合使用,应首先安装 powershell 5.0,然后使用 Install-Module cmdlet 获取 xWindowsUpdate DSC 自定义资源,然后再应用 .NET 4.6.1 Windows 更新。与 Eli 提供的 Powershell 自定义脚本扩展相比,相当困难。
      【解决方案3】:

      您可以使用以下 ARM 模板安装 .NET 4.6.1。请注意,它依赖于 script(由 Service Profiler 使用)。您也可以将其替换为任何其他 PowerShell 脚本。

      参数是节点的基本名称。因此,如果集群中有 VM0、.. VM5,则应设置 vmName = 'VM'。 vmExtensionLoop 设置为 5 个节点;当然你也可以改变它。

      如果您使用 ARM 模板来部署集群,则可以将其作为其中的一部分。请注意,它可能会减慢规模集的部署,因为它需要重新启动。

      {
        "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
        "contentVersion": "1.0.0.0",
        "parameters": {
          "vmName": {
            "type": "string",
            "metadata": {
              "description": "Virtual machine name."
            },
          }
        },
        "resources": [
          {
            "apiVersion": "2015-05-01-preview",
            "type": "Microsoft.Compute/virtualMachines/extensions",
            "name": "[concat(parameters('vmName'),copyIndex(0), '/CustomScriptExtensionInstallNet461')]",
            "location": "[variables('location')]",
            "tags": {
              "displayName": "CustomScriptExtensionInstallNet461"
            },
            "properties": {
              "publisher": "Microsoft.Compute",
              "type": "CustomScriptExtension",
              "typeHandlerVersion": "1.4",
              "autoUpgradeMinorVersion": true,
              "settings": {
                "fileUris": [ "https://gist.githubusercontent.com/aelij/7ea90dda4a187a482584/raw/a3e0f946d4a22b0af803edb503d0a30a263fba2c/InstallNetFx461.ps1" ],
                "commandToExecute": "powershell.exe -ExecutionPolicy Unrestricted -File InstallNetFx461.ps1"
              }
            },
            "copy": {
              "name": "vmExtensionLoop",
              "count": 5
            }
          }
        ]
      }
      

      【讨论】:

        【解决方案4】:

        在 Azure 原生支持 4.6 之前,我会使用预安装了 .NET 4.6 的自定义 VM 映像。有关如何创建和使用的详细信息,请参阅this article

        【讨论】:

          【解决方案5】:

          使用 windows Server 2016 镜像获取 .net 4.6.1。预装。配置集群时的 vmImageSku:"2016-Datacenter"。

          【讨论】:

          【解决方案6】:

          现在 .NET 4.6 及更高版本在 SDK 2.5.216 和 Runtime 5.5.216 版本中可用

          更多详情请见:https://azure.microsoft.com/en-us/blog/announcing-azure-service-fabric-5-5-and-sdk-2-5/

          【讨论】:

          • 这是否记录在任何地方? (我在链接中没有看到对它的引用。)
          猜你喜欢
          • 2017-09-06
          • 1970-01-01
          • 2018-02-22
          • 1970-01-01
          • 1970-01-01
          • 2017-05-12
          • 2019-04-07
          • 2016-09-18
          • 1970-01-01
          相关资源
          最近更新 更多