15장. 리소스 제약 조건을 pcs 명령으로 내보내기


pcs constraint 명령의 --output-format=cmd 옵션을 사용하여 다른 시스템에서 구성된 리소스 제약 조건을 다시 생성하는 데 사용할 수 있는 pcs 명령을 표시할 수 있습니다.

다음 예제에서는 두 개의 리소스를 생성하고, 세 개의 리소스 제약 조건을 구성하고, 다른 시스템에서 제약 조건을 다시 만드는 데 사용할 수 있는 xi의pcs 명령을 표시합니다.

절차

  1. VirtualIP 라는 IPaddr2 리소스를 생성합니다.

    # pcs resource create VirtualIP IPaddr2 ip=198.51.100.3 cidr_netmask=24
    Assumed agent name 'ocf:heartbeat:IPaddr2' (deduced from 'IPaddr2')
  2. website 라는 apache 리소스를 생성합니다.

    # pcs resource create Website apache configfile="/etc/httpd/conf/httpd.conf" statusurl="http://127.0.0.1/server-status"
    Assumed agent name 'ocf:heartbeat:apache' (deduced from 'apache')
  3. website 리소스에 대한 위치 제한 조건 구성합니다.

    # pcs constraint location Website avoids node1
  4. websiteVirtualIP 리소스에 대한 공동 배치 제약 조건을 구성합니다.

    # pcs constraint colocation add Website with VirtualIP
  5. websiteVirtualIP 리소스에 대한 주문 제한 조건을 구성합니다.

    # pcs constraint order VirtualIP then Website
    Adding VirtualIP Website (kind: Mandatory) (Options: first-action=start then-action=start)
  6. 다른 시스템에서 제약 조건을 다시 생성하는 데 사용할 수 있는 pcs 명령을 표시합니다.

    # pcs constraint --output-format=cmd
    pcs -- constraint location add location-Website-node1--INFINITY resource%Website node1 -INFINITY;
    pcs -- constraint colocation add Website with VirtualIP INFINITY \
      id=colocation-Website-VirtualIP-INFINITY;
    pcs -- constraint order start VirtualIP then start Website \
      id=order-VirtualIP-Website-mandatory
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동