你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
ServicePlacementPreferPrimaryDomainPolicyDescription 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示一个 , ServicePlacementPolicyDescription 它指示服务的主要副本应以最佳方式放置在特定域中。
public sealed class ServicePlacementPreferPrimaryDomainPolicyDescription : System.Fabric.Description.ServicePlacementPolicyDescription
type ServicePlacementPreferPrimaryDomainPolicyDescription = class
inherit ServicePlacementPolicyDescription
Public NotInheritable Class ServicePlacementPreferPrimaryDomainPolicyDescription
Inherits ServicePlacementPolicyDescription
- 继承
示例
//create the service placement policy
ServicePlacementPreferPrimaryDomainPolicyDescription placementPolicy = new ServicePlacementPreferPrimaryDomainPolicyDescription();
placementPolicy.DomainName = @"fd:\Datacenter1";
//add it to the Stateful Service Description
StatefulServiceDescription ssd = new StatefulServiceDescription();
ssd.PlacementPolicies.Add(placementPolicy);
注解
在 Service Fabric 群集按地理位置分布的方案中,此约束通常用于容错域,以指示服务的主副本 (replica) 应位于特定的容错域中,在异地分布式方案中,该容错域通常与区域或数据中心边界保持一致。 请注意,由于这是一项优化,因此由于故障、容量限制或其他约束,主副本 (replica) 最终可能不会位于此域中。
构造函数
ServicePlacementPreferPrimaryDomainPolicyDescription() |
初始化 类的新实例 ServicePlacementPreferPrimaryDomainPolicyDescription 。 |
属性
DomainName |
获取或设置主副本 (replica) 应优先位于的域的字符串名称。 |
Type |
获取服务放置策略类型。 (继承自 ServicePlacementPolicyDescription) |
方法
ToString() |
以“PreferPrimaryDomain, DomainName”的形式返回 PreferPrimaryDomain 服务放置策略的字符串表示形式 |