我的Azure Service Fabric群集中正在运行无状态ASP.NET Core(RC1)服务。它具有以下 list :
<ServiceManifest Name="MyServicePkg" Version="1.0.2" ...>
<ServiceTypes>
<StatelessServiceType ServiceTypeName="MyServiceType" />
</ServiceTypes>
...
</ServiceManifest>
我的集群配置了展示位置属性。我有5个服务器的“nodeType =后端”和3个服务器的“nodeType =前端”。
我想升级我的服务,并指定它只能放在“后端”节点上。这是我更新的 list :
<ServiceManifest Name="MyServicePkg" Version="1.0.3" ...>
<ServiceTypes>
<StatelessServiceType ServiceTypeName="MyServiceType">
<PlacementConstraints>(nodeType==Backend)</PlacementConstraints>
</StatelessServiceType>
</ServiceTypes>
...
</ServiceManifest>
但是,如果现在执行升级,则会出现以下错误:
Start-ServiceFabricApplicationUpgrade : Default service descriptions must not be modified as part of upgrade. Modified default service: fabric:/MyApp/MyService
为什么不能通过升级来更改约束?
我需要删除并重新创建服务吗?对我来说,这似乎极具问题,因为这将导致状态服务的停机时间和数据丢失。
最佳答案
实际上,有一种相当简单的方法,而无需编写一堆代码即可在结构集群上手动定义应用程序。
虽然可以在服务 list 中声明放置约束,但也可以在应用程序 list 中声明它们。应用程序 list 中声明的所有内容都将覆盖服务 list 中的内容。通过应用程序 list 中的设置,然后可以使用参数基于要针对特定部署的参数文件来更改值。
我刚刚写了a blog post that discusses this approach in greater detail。希望对你有帮助。 :)
关于azure-service-fabric - 为什么在升级中无法更改放置限制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35756573/