HA集群-资源约束

来源:互联网 发布:网络兼职申请表 编辑:程序博客网 时间:2024/06/08 12:21

笔者最近一直苦逼于研究pacemaker哲学所在,无奈国内讲的实在太少于是不得不翻译一些国外官档来寻求真相。

•Scores
Scores are calculated on a per-resource basis and any node with a negative score for a resource can’t run that resource. After calculating the scores for a resource, the cluster then chooses the node with the highest one.
分数是按照资源计算的,任何一个节点如果对某个资源有负数值的分数,那么该资源不会在该节点启动。在计算一个资源所具有的分数之后,集群会选举一个节点具有最高分数的。

•Deciding Which Nodes a Resource Can Run On
决定哪个节点能够运行资源

There are two alternative strategies for specifying which nodes a resources can run on. One way is to say that by default they can run anywhere and then create location constraints for nodes that are not allowed. The other option is to have nodes “opt-in”… to start with nothing able to run anywhere and selectively enable allowed nodes.
集群提供两种可供选择的策略用来裁决哪个节点可以运行资源。第一种方法说的是在默认情况下资源可以运行在任意的节点上,然后在该节点上创建位置约束,约束哪些节点不能运行该资源。另外一种办法就是让节点选择在哪个节点启动,一般首先通过禁用所有节点然后让节点选择性的在可被允许启动的节点上启动。
•Specifying the Order Resources Should Start/Stop In
选定资源应该能在哪些特定的节点上启动

•Placing Resources Relative to other Resources
将资源与其他资源做关联

When the location of one resource depends on the location of another one, we call this colocation.
当一个资源的启动位置需要关联到其他资源的启用位置时,我们把这种关系叫做colocation。

•Ordering Sets of Resources
指定资源在节点上的启动顺序

A common situation is for an administrator to create a chain of ordered resources
一种常见的情况就是系统管理员创建一条顺序链来为资源启动定义顺序。

资源约束则用以指定在哪些群集节点上运行资源,以何种顺序装载资源,以及特定资源依赖于哪些其它资源。pacemaker共给我们提供了三种资源约束方法:
Resource Location(资源位置):定义资源可以、不可以或尽可能在哪些节点上运行;
Resource Collocation(资源排列):排列约束用以定义集群资源可以或不可以在某个节点上同时运行;
Resource Order(资源顺序):顺序约束定义集群资源在节点上启动的顺序;
定义约束时,还需要指定分数。各种分数是集群工作方式的重要组成部分。其实,从迁移资源到决定在已降级集群中停止哪些资源的整个过程是通过以某种方式修改分数来实现的。分数按每个资源来计算,资源分数为负的任何节点都无法运行该资源。在计算出资源分数后,集群选择分数最高的节点。INFINITY(无穷大)目前定义为 1,000,000。加减无穷大遵循以下3个基本规则:
任何值 + 无穷大 = 无穷大
任何值 - 无穷大 = -无穷大
无穷大 - 无穷大 = -无穷大
定义资源约束时,也可以指定每个约束的分数。分数表示指派给此资源约束的值。分数较高的约束先应用,分数较低的约束后应用。通过使用不同的分数为既定资源创建更多位置约束,可以指定资源要故障转移至的目标节点的顺序

原创粉丝点击