0

当我使用 Docker 在本地运行容器时,我已经为 ASP.net MVC 应用程序创建了一个映像,4.7.2-windowsservercore-ltsc2016一切正常。我在 Azure 中设置了一个 5 节点 Fabric 集群,当我最初尝试部署时,我得到:

Error event: SourceId='System.FM', Property='State'.
Partition is below target replica or instance count.
fabric:/xx/yy -1 1 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  (Showing 0 out of 0 replicas. Total available replicas: 0)

For more information see: http://aka.ms/sfhealth

当我查看各个节点时,我看到:

Error event: SourceId='System.Hosting', Property='Download:1.0:1.0'.
There was an error during download

一段时间后,节点中的 Health 事件发生变化并显示:

The ServicePackage was activated successfully.

然后

System.Hosting | CodePackageActivation:Code:EntryPoint

There was an error during CodePackage activation.Container failed to start for image:myrepo.azurecr.io/repo:1.0.0. failed to create endpoint sf-0-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx on network nat: HNS failed with error : The object already exists.

接着

There was an error during CodePackage activation.The service host terminated with exit code:7148

接着

The ServiceType was unregistered on the node since the Runtime or ApplicationHost closed.

我的服务清单具有存储在 Azure CR 中的完整映像名称:

<ImageName>myrepo.azurecr.io/repo:1.0.0</ImageName>

同样在我的应用程序清单中,我有存储库凭据:

<RepositoryCredentials AccountName="myrepo" Password="xxxxxxxxxxxxxxxxxxxxxxxx" PasswordEncrypted="false"/>

我很高兴提供更多详细信息/日志,请让我知道从哪里获取它们。

编辑:

服务清单:

<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="mymvcPkg"
                 Version="1.0.0"
                 xmlns="http://schemas.microsoft.com/2011/01/fabric"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ServiceTypes>
    <StatelessServiceType ServiceTypeName="mymvcType" UseImplicitHost="true" />
  </ServiceTypes>
  <CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <ContainerHost>
        <ImageName>myrepo.azurecr.io/repo:1.0.0</ImageName>
      </ContainerHost>
    </EntryPoint>    
  </CodePackage>
  <ConfigPackage Name="Config" Version="1.0.0" />
  <Resources>
    <Endpoints>
      <Endpoint Name="mymvcTypeEndpoint" UriScheme="http" Port="80" Protocol="http" />
    </Endpoints>
  </Resources>
</ServiceManifest>

应用清单:

<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest ApplicationTypeName="MvcType"
                     ApplicationTypeVersion="1.0.0"
                     xmlns="http://schemas.microsoft.com/2011/01/fabric"
                     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Parameters>
    <Parameter Name="mymvc_InstanceCount" DefaultValue="-1" />
  </Parameters>  
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="mymvcPkg" ServiceManifestVersion="1.0.0" />
    <ConfigOverrides />
    <Policies>
      <ContainerHostPolicies CodePackageRef="Code">
        <RepositoryCredentials AccountName="myrepo" Password="xxxxxxxxxxxxx" PasswordEncrypted="false"/>
        <PortBinding ContainerPort="80" EndpointRef="mymvcTypeEndpoint"/>
      </ContainerHostPolicies>
    </Policies>
  </ServiceManifestImport>
  <DefaultServices>    
    <Service Name="mymvc" ServicePackageActivationMode="ExclusiveProcess">
      <StatelessService ServiceTypeName="mymvcType" InstanceCount="[mymvc_InstanceCount]">
        <SingletonPartition />
      </StatelessService>
    </Service>
  </DefaultServices>
</ApplicationManifest>
4

1 回答 1

0

我遇到的问题是我用于集群中的虚拟机(节点)的实例类型。Azure 支持在他们的一些日志中发现错误:

System.ComponentModel.Win32Exception (0x80004005): Not enough storage is available to process this command

切换到更强大的实例解决了这个问题。微软表示:

支持的最低使用 VM SKU 是标准 D1 或标准 D1_V2 或同等设备,至少有 14 GB 的本地 SSD

尽管我一直在尝试配置 20GB 的虚拟机,但它们并没有工作。目前我正在 SKU A2 上运行测试,到目前为止似乎工作正常。微软还表示:

• 生产工作负载不支持标准 A0 等部分核心 VM SKU

• 出于性能原因,生产工作负载不支持标准 A1 SKU。

考虑到上述情况,D1_V2(3.5GB RAM,50GB SSD)可能是最便宜的可行选择。

于 2018-05-08T14:53:09.153 回答