17.2. 규칙을 사용하여 Pacemaker 위치 제약 조건 구성
다음 명령을 사용하여 규칙을 사용하는 Pacemaker 제약 조건을 구성합니다. score 가 생략된 경우 기본값은 INFINITY입니다. resource-discovery 를 생략하면 기본값은 always 입니다.
resource-discovery 옵션에 대한 자세한 내용은 노드의 하위 집합으로 리소스 검색 제한을 참조하십시오.
기본 위치 제약 조건과 마찬가지로 이러한 제약 조건이 있는 리소스에도 정규식을 사용할 수 있습니다.
규칙을 사용하여 위치 제약 조건을 구성할 때 점수 값은 양수 또는 음수일 수 있으며, "prefers"를 나타내는 양수 값과 "avoids"를 나타내는 음수 값을 사용할 수 있습니다.
pcs constraint location rsc rule [resource-discovery=option] [role=promoted|unpromoted] [score=score | score-attribute=attribute] expression
표현식 옵션은 date 사양의 "날짜 사양의 속성"에 설명된 대로 duration_options 및 date_spec_options: hour, monthdays, yeardays, months, weeks, years, weekyears, 달 중 하나일 수 있습니다. https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/configuring_and_managing_high_availability_clusters/assembly_determining-resource-location-with-rules-configuring-and-managing-high-availability-clusters#date_specifications
-
defined|not_defined attribute -
attribute lt|gt|lte|gte|eq|ne [string|integer|number|version] value -
날짜 gt|lt date -
date in_range date to date -
date in_range date to duration_options … -
date-spec date_spec_options -
expression 및|or 표현식 -
(expression)
기간은 계산을 통해 in_range 작업의 끝을 지정하는 대체 방법입니다. 예를 들어 기간을 19개월로 지정할 수 있습니다.
다음 위치 제한 조건은 지금이 2018 년 중 임의의 시간인 경우 true를 설정하는 식을 구성합니다.
# pcs constraint location Webserver rule score=INFINITY date-spec years=2018
다음 명령은 월요일부터 금요일까지 오전 9시부터 오후 5시까지 실제 표현식을 구성합니다. 시간 16의 시간 값은 최대 16:59:59와 일치합니다. 숫자 값(시간)은 계속 일치합니다.
# pcs constraint location Webserver rule score=INFINITY date-spec hours="9-16" weekdays="1-5"
다음 명령은 금요일에 달이 있을 때 true인 표현식을 구성합니다.
# pcs constraint location Webserver rule date-spec weekdays=5 monthdays=13 moon=4
규칙을 제거하려면 다음 명령을 사용합니다. 제거하는 규칙이 제약 조건의 마지막 규칙이면 제약 조건이 제거됩니다.
pcs constraint rule remove rule_id