Rhel

起搏器集群中的資源組是否存在隱含約束?

  • October 26, 2017

根據redhat的官方文件,資源組中的所有資源都隱含地具有託管和順序約束。但是從我在實驗室設置中進行的測試來看,我看不到同一資源組中的任何約束和資源是在不同節點上啟動的。

[root@node1 conf]# pcs status
Cluster name: mycluster
Last updated: Thu Oct 26 03:49:50 2017      Last change: Wed Oct 25 11:01:51 2017 by root via crm_resource on node1
Stack: corosync
Current DC: node1 (version 1.1.13-10.el7-44eb2dd) - partition with quorum
3 nodes and 6 resources configured

Online: [ node1 node2 node3 ]

Full list of resources:

fencer_node3   (stonith:fence_xvm):    Started node1
fencer_node1   (stonith:fence_xvm):    Started node2
fencer_node2   (stonith:fence_xvm):    Started node3
Resource Group: myweb
    webip  (ocf::heartbeat:IPaddr2):   Started node1
    mywebserver    (ocf::heartbeat:apache):    Started node1
webfs  (ocf::heartbeat:Filesystem):    Started node2

PCSD Status:
 node1: Online
 node3: Online
 node2: Online

Daemon Status:
 corosync: active/enabled
 pacemaker: active/enabled
 pcsd: active/enabled

從資源縮進來看,資源 webfs 實際上並不是 myweb 組的成員。您可以使用pcs status groups. 您可以使用將 webfs 資源添加到 myweb 資源組pcs resource group add myweb webfs

PS:這明明是一個web伺服器資源組,所以要注意資源加入這個資源組的順序,正確的順序其實應該是:

  1. 網路文件系統
  2. 我的網路伺服器
  3. 網路IP

引用自:https://unix.stackexchange.com/questions/400524