当我使用 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>