Show Table of Contents
3.6. 測試資源配置
您可透過下列程序來驗證您的系統配置。您應該能以 NFSv3 或 NFSv4 掛載已匯出的檔案系統。
- 請在一個叢集之外、位於與建置相同網路中的節點上驗證 NFS share 能藉由掛載 NFS share 來被看見。在此範例中,我們將使用 192.168.122.0/24 網路。
#
showmount -e 192.168.122.200Export list for 192.168.122.200: /nfsshare/exports/export1 192.168.122.0/255.255.255.0 /nfsshare/exports 192.168.122.0/255.255.255.0 /nfsshare/exports/export2 192.168.122.0/255.255.255.0 - 若要驗證您是否能以 NFSv4 掛載 NFS share,請將 NFS share 掛載至客戶端節點上的一個目錄中。在進行掛載後,請驗證您是否能看見匯出目錄中的內容。請在測試結束後卸載此 share。
#
mkdir nfsshare#mount -o "vers=4" 192.168.122.200:export1 nfsshare#ls nfsshareclientdatafile1 #umount nfsshare - 請驗證您是否能以 NFSv3 掛載 NFS share。在掛載後,請驗證您是否能看見
clientdatafile1這個測試檔案。NFSv3 與 NFSv4 不同,它不使用虛擬檔案系統,您必須掛載特定的 export。請在測試完成後卸載 share。#
mkdir nfsshare#mount -o "vers=3" 192.168.122.200:/nfsshare/exports/export2 nfsshare#ls nfsshareclientdatafile2 #umount nfsshare - 若要測試備援,請執行下列步驟。
- 請在叢集外的一個節點上掛載 nfs share 並驗證是否能存取我們在〈節 3.3, “NFS Share 設定”〉中所建立的
clientdatafile1。#
mkdir nfsshare#mount -o "vers=4" 192.168.122.200:export1 nfsshare#ls nfsshareclientdatafile1 - 從叢集中的某個節點,決定叢集中的哪個節點要執行
nfsgroup。在這範例中,nfsgroup是在z1.example.com上執行的。[root@z1 ~]#
pcs status... Full list of resources: myapc (stonith:fence_apc_snmp): Started z1.example.com Resource Group: nfsgroup my_lvm (ocf::heartbeat:LVM): Started z1.example.com nfsshare (ocf::heartbeat:Filesystem): Started z1.example.com nfs-daemon (ocf::heartbeat:nfsserver): Started z1.example.com nfs-root (ocf::heartbeat:exportfs): Started z1.example.com nfs-export1 (ocf::heartbeat:exportfs): Started z1.example.com nfs-export2 (ocf::heartbeat:exportfs): Started z1.example.com nfs_ip (ocf::heartbeat:IPaddr2): Started z1.example.com nfs-notify (ocf::heartbeat:nfsnotify): Started z1.example.com ... - 從叢集中的某個節點,將執行
nfsgroup的節點改成待命模式。[root@z1 ~]#
pcs cluster standby z1.example.com - 驗證
nfsgroup是否已成功啟用於其它叢集節點上。[root@z1 ~]#
pcs status... Full list of resources: Resource Group: nfsgroup my_lvm (ocf::heartbeat:LVM): Started z2.example.com nfsshare (ocf::heartbeat:Filesystem): Started z2.example.com nfs-daemon (ocf::heartbeat:nfsserver): Started z2.example.com nfs-root (ocf::heartbeat:exportfs): Started z2.example.com nfs-export1 (ocf::heartbeat:exportfs): Started z2.example.com nfs-export2 (ocf::heartbeat:exportfs): Started z2.example.com nfs_ip (ocf::heartbeat:IPaddr2): Started z2.example.com nfs-notify (ocf::heartbeat:nfsnotify): Started z2.example.com ... - 從叢集外部、掛載 NFS 共享目錄的節點,驗證這個外部節點仍然擁有存取 NFS 掛載點的測試檔案之權限。
#
ls nfsshareclientdatafile1在備援時,用戶端的服務會被短暫中斷,但應該會在不需要使用者干預的情況下回復。預設上,使用 NFSv4 的用戶端可能需要至多 90 秒才能回復掛載點;這 90 秒是 NFSv4 的檔案租賃寬限期,是由伺服器在啟動時所觀察的寬限期。NFSv3 的用戶端應該可以在幾秒內就回復對這掛載點的存取功能。 - 從叢集中的某個節點,移除從待命模式開始執行
nfsgroup的節點。這不會自己移動叢集資源至此節點上。[root@z1 ~]#
pcs cluster unstandby z1.example.com

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.