Show Table of Contents
第 9 章 Pacemaker 规则
可使用规则让您的配置更动态。常用示例是设定一个工作时间内使用的
resource-stickiness 值,防止将资源移回其最喜欢的位置,同时设定另一个用于周末(没有人会注意到中断)的值。
规则的另一个用途是将机器根据时间分配给不同的进程组(使用节点属性),然后在创建位置限制时使用那个属性。
每个规则可包含大量表达式、日期表达式、甚至其他规则。根据规则
boolean-op 字段合并表达式结果,以决定该规则最终评估结果是 true 还是 false。接下来会出现的结果要看使用该规则的上下文。
表 9.1. 规则属性
9.1. 节点属性表达式
节点属性表达式是用来控制根据一个节点或多个节点所定义属性的资源。
表 9.2. 表达式属性
| 项 | 描述 |
|---|---|
value
| |
attribute
| |
type
| |
operation
|
要执行的比较。允许值为:
*
lt - 如果节点属性值小于 value 则为 true。
*
gt - 如果节点属性值大于 value 则为 true。
*
lte - 如果节点属性值小于等于 value 则为 ture。
*
gte - 如果节点属性值大于等于 value 则为 ture。
*
eq - 如果节点属性值等于 value 则为 true。
*
ne - 如果节点属性值等于 value 则为 true。
*
defined - 如果该节点有命名的属性则为 true。
|

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.