【问题标题】:ServiceFabric: failed to deploy new applicationsServiceFabric:未能部署新应用程序
【发布时间】:2019-06-19 10:31:15
【问题描述】:

我在微服务的前提下使用服务结构,并采用了使用动态端口的策略,但显然我认为我已经缩小了端口范围,因为我已经达到了 25 个应用程序的限制,大约 340 个steless 中的微服务。并且在尝试上传新应用程序时,几乎所有服务都会出错。例如,如果您删除旧的应用程序,则出现错误的应用程序会上升并保持稳定。我已经在参数中增加了clustermanifest中的端口范围:ApplicationEndpoints但是没有效果...

【问题讨论】:

    标签: azure-service-fabric service-fabric-on-premises


    【解决方案1】:

    <ClusterManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="PmenosProducao" Version="0" Description="This is a generated file. Do not modify." xmlns="http://schemas.microsoft.com/2011/01/fabric">
      <NodeTypes>
        <NodeType Name="NodeType0">
          <Endpoints>
            <ClientConnectionEndpoint Port="19000" />
            <LeaseDriverEndpoint Port="19002" />
            <ClusterConnectionEndpoint Port="19001" />
            <HttpGatewayEndpoint Port="19080" Protocol="http" />
            <HttpApplicationGatewayEndpoint Port="19081" Protocol="http" />
            <ServiceConnectionEndpoint Port="19003" />
            <ApplicationEndpoints StartPort="20001" EndPort="45031" />
          </Endpoints>
          <PlacementProperties>
            <Property Name="NodeTypeName" Value="NodeType0" />
          </PlacementProperties>
        </NodeType>
      </NodeTypes>
      <Infrastructure>
        <WindowsServer>
          <NodeList>
            <Node NodeName="name" IPAddressOrFQDN="0.0.0.0" IsSeedNode="true" NodeTypeRef="NodeType0" FaultDomain="fd:/dc2/r0" UpgradeDomain="UD1" />
            <Node NodeName="name" IPAddressOrFQDN="0.0.0.0" IsSeedNode="true" NodeTypeRef="NodeType0" FaultDomain="fd:/dc3/r0" UpgradeDomain="UD2" />
            <Node NodeName="name" IPAddressOrFQDN="0.0.0.0" IsSeedNode="true" NodeTypeRef="NodeType0" FaultDomain="fd:/dc1/r0" UpgradeDomain="UD0" />
          </NodeList>
        </WindowsServer>
      </Infrastructure>
      <FabricSettings>
        <Section Name="ApplicationGateway/Http">
          <Parameter Name="DefaultHttpRequestTimeout" Value="600" />
          <Parameter Name="IsEnabled" Value="true" />
        </Section>
        <Section Name="ClusterManager">
          <Parameter Name="EnableAutomaticBaseline" Value="True" />
          <Parameter Name="MinReplicaSetSize" Value="3" />
          <Parameter Name="PlacementConstraints" Value="NodeTypeName==NodeType0" />
          <Parameter Name="TargetReplicaSetSize" Value="3" />
        </Section>
        <Section Name="Common">
          <Parameter Name="EnableEndpointV2" Value="True" />
        </Section>
        <Section Name="Diagnostics">
          <Parameter Name="ClusterId" Value="bb99d580-50cc-4e1c-8a45-09f02f091f73" />
          <Parameter Name="ConsumerInstances" Value="FileShareWinFabEtw, FileShareWinFabCrashDump, FileShareWinFabPerfCtr" />
          <Parameter Name="EnableTelemetry" Value="False" />
          <Parameter Name="MaxDiskQuotaInMB" Value="5120" />
          <Parameter Name="ProducerInstances" Value="WinFabEtlFile, WinFabCrashDump, WinFabPerfCtrFolder" />
        </Section>
        <Section Name="FailoverManager">
          <Parameter Name="ExpectedClusterSize" Value="3" />
          <Parameter Name="IsSingletonReplicaMoveAllowedDuringUpgrade" Value="True" />
          <Parameter Name="MinReplicaSetSize" Value="3" />
          <Parameter Name="PlacementConstraints" Value="NodeTypeName==NodeType0" />
          <Parameter Name="TargetReplicaSetSize" Value="3" />
        </Section>
        <Section Name="FaultAnalysisService">
          <Parameter Name="MinReplicaSetSize" Value="3" />
          <Parameter Name="PlacementConstraints" Value="NodeTypeName==NodeType0" />
          <Parameter Name="TargetReplicaSetSize" Value="3" />
        </Section>
        <Section Name="Federation">
          <Parameter Name="NodeIdGeneratorVersion" Value="V4" />
        </Section>
        <Section Name="FileShareWinFabCrashDump">
          <Parameter Name="ConsumerType" Value="FileShareFolderUploader" />
          <Parameter Name="DataDeletionAgeInDays" Value="7" />
          <Parameter Name="IsEnabled" Value="true" />
          <Parameter Name="ProducerInstance" Value="WinFabCrashDump" />
          <Parameter Name="StoreConnectionString" Value="c:\ProgramData\SF\DiagnosticsStore\fabricdumps-bb99d580-50cc-4e1c-8a45-09f02f091f73" />
        </Section>
        <Section Name="FileShareWinFabEtw">
          <Parameter Name="ConsumerType" Value="FileShareEtwCsvUploader" />
          <Parameter Name="DataDeletionAgeInDays" Value="7" />
          <Parameter Name="IsEnabled" Value="true" />
          <Parameter Name="ProducerInstance" Value="WinFabEtlFile" />
          <Parameter Name="StoreConnectionString" Value="c:\ProgramData\SF\DiagnosticsStore\fabriclogs-bb99d580-50cc-4e1c-8a45-09f02f091f73" />
        </Section>
        <Section Name="FileShareWinFabPerfCtr">
          <Parameter Name="ConsumerType" Value="FileShareFolderUploader" />
          <Parameter Name="DataDeletionAgeInDays" Value="7" />
          <Parameter Name="IsEnabled" Value="true" />
          <Parameter Name="ProducerInstance" Value="WinFabPerfCtrFolder" />
          <Parameter Name="StoreConnectionString" Value="c:\ProgramData\SF\DiagnosticsStore\fabricperf-bb99d580-50cc-4e1c-8a45-09f02f091f73" />
        </Section>
        <Section Name="FileStoreService">
          <Parameter Name="AnonymousAccessEnabled" Value="false" />
          <Parameter Name="PrimaryAccountNTLMPasswordSecret" Value="8d9a2358-d8b7-4e55-8979-fbc3cde08551" />
          <Parameter Name="PrimaryAccountType" Value="LocalUser" />
          <Parameter Name="SecondaryAccountNTLMPasswordSecret" Value="bcac0708-43f8-4c86-875c-a26a939bdaa0" />
          <Parameter Name="SecondaryAccountType" Value="LocalUser" />
        </Section>
        <Section Name="Hosting">
          <Parameter Name="EndpointProviderEnabled" Value="true" />
          <Parameter Name="FirewallPolicyEnabled" Value="true" />
          <Parameter Name="RunAsPolicyEnabled" Value="true" />
        </Section>
        <Section Name="HttpGateway">
          <Parameter Name="IsEnabled" Value="true" />
        </Section>
        <Section Name="ImageStoreService">
          <Parameter Name="MinReplicaSetSize" Value="3" />
          <Parameter Name="PlacementConstraints" Value="NodeTypeName==NodeType0" />
          <Parameter Name="TargetReplicaSetSize" Value="3" />
        </Section>
        <Section Name="Management">
          <Parameter Name="ImageStoreConnectionString" Value="fabric:ImageStore" />
        </Section>
        <Section Name="NamingService">
          <Parameter Name="MinReplicaSetSize" Value="3" />
          <Parameter Name="PlacementConstraints" Value="NodeTypeName==NodeType0" />
          <Parameter Name="TargetReplicaSetSize" Value="3" />
        </Section>
        <Section Name="PlacementAndLoadBalancing">
          <Parameter Name="QuorumBasedReplicaDistributionPerFaultDomains" Value="true" />
          <Parameter Name="QuorumBasedReplicaDistributionPerUpgradeDomains" Value="true" />
        </Section>
        <Section Name="ReconfigurationAgent">
          <Parameter Name="IsDeactivationInfoEnabled" Value="true" />
        </Section>
        <Section Name="Security">
          <Parameter Name="AllowDefaultClient" Value="False" />
          <Parameter Name="ClientRoleEnabled" Value="true" />
          <Parameter Name="ClusterCredentialType" Value="None" />
          <Parameter Name="DisableFirewallRuleForDomainProfile" Value="false" />
          <Parameter Name="DisableFirewallRuleForPrivateProfile" Value="false" />
          <Parameter Name="DisableFirewallRuleForPublicProfile" Value="false" />
          <Parameter Name="ServerAuthCredentialType" Value="None" />
        </Section>
        <Section Name="Setup">
          <Parameter Name="FabricDataRoot" Value="C:\ProgramData\SF" />
          <Parameter Name="FabricLogRoot" Value="C:\ProgramData\SF\Log" />
        </Section>
        <Section Name="Trace/Etw">
          <Parameter Name="Level" Value="4" />
        </Section>
        <Section Name="UpgradeOrchestrationService">
          <Parameter Name="AutoupgradeEnabled" Value="False" />
          <Parameter Name="AutoupgradeInstallEnabled" Value="False" />
          <Parameter Name="ClusterId" Value="bb99d580-50cc-4e1c-8a45-09f02f091f73" />
          <Parameter Name="GoalStateExpirationReminderInDays" Value="30" />
          <Parameter Name="MinReplicaSetSize" Value="3" />
          <Parameter Name="PlacementConstraints" Value="NodeTypeName==NodeType0" />
          <Parameter Name="TargetReplicaSetSize" Value="3" />
        </Section>
        <Section Name="WinFabCrashDump">
          <Parameter Name="DataDeletionAgeInDays" Value="7" />
          <Parameter Name="FolderType" Value="WindowsFabricCrashDumps" />
          <Parameter Name="IsEnabled" Value="true" />
          <Parameter Name="ProducerType" Value="FolderProducer" />
        </Section>
        <Section Name="WinFabEtlFile">
          <Parameter Name="DataDeletionAgeInDays" Value="7" />
          <Parameter Name="IsEnabled" Value="true" />
          <Parameter Name="ProducerType" Value="EtlFileProducer" />
        </Section>
        <Section Name="WinFabPerfCtrFolder">
          <Parameter Name="DataDeletionAgeInDays" Value="7" />
          <Parameter Name="FolderType" Value="WindowsFabricPerformanceCounters" />
          <Parameter Name="IsEnabled" Value="true" />
          <Parameter Name="ProducerType" Value="FolderProducer" />
        </Section>
      </FabricSettings>
    </ClusterManifest>
    

    【讨论】:

      【解决方案2】:

      我不能 100% 确定您遇到的问题是否与可用端口有关,但如果是 - 您可以检查一下 documentation section 吗?

      来自文档:

      • ephemeralPorts 覆盖操作系统使用的动态端口。 Service Fabric 将这些端口的一部分用作应用程序端口,其余端口可用于操作系统。它还会将此范围映射到操作系统中存在的现有范围,因此出于所有目的,您可以使用示例 JSON 文件中给出的范围。确保起始端口和结束端口之间的差异至少为 255。如果此差异过小,您可能会遇到冲突,因为此范围是与操作系统共享的。要查看配置的动态端口范围,请运行 netsh int ipv4 show dynamicport tcp。

      • applicationPorts 是 Service Fabric 应用程序使用的端口。应用程序端口范围应该足够大,以覆盖应用程序的端点需求。此范围应与机器上的动态端口范围互斥,即配置中设置的 ephemeralPorts 范围。 Service Fabric 会在需要新端口时使用这些端口,并负责为这些端口打开防火墙。

      这些设置是为集群配置中的每个nodeType 配置的。


      ClusterManifest.xml(基于ClusterManifestType XML 架构)中,这些设置由NodeType 元素中的ApplicationEndpointsEphemeralEndpoints 元素表示。

      【讨论】:

      • 如果你观察我的范围端口:20001、45031。但即使增加也没有效果,应用程序继续上去报错。
      • 我在答案中添加了更多信息。能否尝试在NodeType中配置EphemeralEndpoints元素以及ApplicationEndpoints
      猜你喜欢
      • 1970-01-01
      • 2016-10-10
      • 2017-12-18
      • 2018-08-05
      • 2022-07-09
      • 2015-10-23
      • 1970-01-01
      • 2020-09-11
      • 1970-01-01
      相关资源
      最近更新 更多