10.9. 現在設定されているリソースのデフォルトの表示


pcs resource defaults [config] コマンドは、指定したルールなど、現在設定されているリソースオプションのデフォルト値のリストを表示します。このコマンドの出力は、テキスト、JSON、コマンド形式で表示できます。

  • --output-format=text を指定すると、設定されているリソースのデフォルトがプレーンテキスト形式で表示されます。これはこのオプションのデフォルト値です。
  • --output-format=cmd を指定すると、現在のクラスターのデフォルト設定から作成された pcs resource defaults コマンドが表示されます。このコマンドを使用すると、別のシステムで設定されたリソースのデフォルトを再作成できます。
  • --output-format=json を指定すると、設定されているリソースのデフォルトが、マシン解析に適した JSON 形式で表示されます。

次の手順例では、リソースのデフォルト値をリセットした後に pcs resource defaults config コマンドを実行した場合の 3 種類の出力形式を示します。

手順

  1. 任意の ocf:pacemaker:pgsql リソースのデフォルト値をリセットします。

    # pcs resource defaults set create id=set-1 score=100 meta resource-stickiness=10 rule resource ocf:pacemaker:pgsql
  2. 設定されたリソースのデフォルト値をプレーンテキストで表示します。

    # pcs resource defaults config
    Meta Attrs: build-resource-defaults
      resource-stickiness=1
    Meta Attrs: set-1 score=100
      resource-stickiness=10
      Rule: boolean-op=and score=INFINITY
        Expression: resource ocf:pacemaker:pgsql
  3. 現在のクラスターのデフォルト設定から作成された pcs resource defaults コマンドを表示します。

    # pcs resource defaults config --output-format=cmd
    pcs -- resource defaults set create id=build-resource-defaults \
      meta resource-stickiness=1;
    pcs -- resource defaults set create id=set-1 score=100 \
      meta resource-stickiness=10 \
      rule 'resource ocf:pacemaker:pgsql'
  4. 設定されたリソースのデフォルト値を JSON 形式で表示します。

    # pcs resource defaults config --output-format=json
    {"instance_attributes": [], "meta_attributes": [{"id": "build-resource-defaults", "options": {}, "rule": null, "nvpairs": [{"id": "build-resource-stickiness", "name": "resource-stickiness", "value": "1"}]}, {"id": "set-1", "options": {"score": "100"}, "rule": {"id": "set-1-rule", "type": "RULE", "in_effect": "UNKNOWN", "options": {"boolean-op": "and", "score": "INFINITY"}, "date_spec": null, "duration": null, "expressions": [{"id": "set-1-rule-rsc-ocf-pacemaker-pgsql", "type": "RSC_EXPRESSION", "in_effect": "UNKNOWN", "options": {"class": "ocf", "provider": "pacemaker", "type": "pgsql"}, "date_spec": null, "duration": null, "expressions": [], "as_string": "resource ocf:pacemaker:pgsql"}], "as_string": "resource ocf:pacemaker:pgsql"}, "nvpairs": [{"id": "set-1-resource-stickiness", "name": "resource-stickiness", "value": "10"}]}]}
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る