Sun Cluster 3.0 系統管理手冊

3.4 管理叢集檔案系統

表 3-2 作業指引:管理叢集檔案系統

作業 

相關資訊,請進到 ... 

在最初的 Sun Cluster 安裝之後新增叢集檔案系統 

- 使用 newfsmakedir

"3.4.1 如何新增額外的叢集檔案系統"

移除叢集檔案系統 

- 使用 fuserumount

"3.4.2 如何移除叢集檔案系統"

檢查叢集中整體裝載點跨節點的一致性 

- 使用 sccheck

"3.4.3 如何檢查叢集中的整體裝載"

3.4.1 如何新增額外的叢集檔案系統

請對 Sun Cluster 起始安裝後建立的每一個叢集檔案系統執行這個程序。


小心 - 小心 -

請務必要指定正確的磁碟裝置名稱。建立叢集檔案系統會銷毀磁碟中的資料。如果您指定錯誤的裝置名稱,您可能會消除不想刪除的資料。


新增其他叢集檔案系統的必備條件如下:

  1. 成為叢集中任何節點的超級使用者(superuser)。


    提示 -

    如果快速建立檔案系統,請在您要建立檔案系統之整體裝置的現行主要節點上成為超級使用者(superuser)。


  2. 使用 newfs(1M) 指令建立檔案系統。


    # newfs raw-disk-device
    

    表 3-3顯示 raw-disk-device 引數的名稱的範例。請注意,每一個容體管理者的命名慣例都不一樣。

    表 3-3 原始磁碟裝置名稱範例

    如何您的容體管理者是 ... 

    磁碟裝置名稱可能是 ... 

    說明 

    Solstice DiskSuite 

    /dev/md/oracle/rdsk/d1

    oracle 中繼組內的原始磁碟裝置 d1

    VERITAS 容體管理者 

    /dev/vx/rdsk/oradg/vol01

    oradg 磁碟群組內的原始磁碟裝置 vol01

    無 

    /dev/global/rdsk/d1s3

    區域片段 d1s3 的原始磁碟裝置。

  3. 在叢集的每一個節點上,建立叢集檔案系統的裝載點目錄。

    每一個節點上都需要裝載點,即使該節點上的叢集檔案系統不會被存取。


    # mkdir -p /global/device-group/mount-point
    
    device-group

    和含有裝置之裝置群組的名稱對應的目錄的名稱。

    mount-point

    要裝載叢集檔案系統的目錄。


    提示 -

    為了方便管理,請在 /global/device-group 目錄建立裝載點。這樣可協助您區分可從本端檔案系統使用之整體可用的叢集檔案系統。


  4. 在叢集的每一個節點,在 /etc/vfstab 檔加入裝載點的登錄。

    1. 要自動裝載叢集檔案系統,請將 mount at boot(啟動時裝載) 欄位設成 yes(是)

    2. 使用下列必要的裝載選項:

      • 此項 global 裝設選項對所有的叢集檔案系統而言為必要的項目。此選項可將檔案系統識別為叢集檔案系統。

      • 檔案系統登入對所有的叢集檔案系統而言為必要的。可透過使用 Solstice DiskSuite metatrans 裝置,或是直接透過 Solaris UFS 裝設選項,來完成 UFS 登入。但是,這兩種方法不可以合併使用。如果直接使用 Solaris UFS 登入時,便需使用 logging 裝設選項。否則,如果使用 metatrans 檔案系統登入時,便不需要其它的裝設選項。

    3. 請注意,在每一個叢集檔案系統,其 /etc/vfstab 登錄中的資訊和具有該登錄之每一個節點上的相同。

    4. 請注意檔案系統的開機次序相依關係。

      通常,您不應該套疊叢集檔案系統的裝載點。例如,假設phys-schost-1 將磁碟裝置 d0 裝載至 /global/oraclephys-schost-2 將磁碟裝置 d1 裝載至 /global/oracle/logs。在這個配置,phys-schost-2 可啟動並裝載 /global/oracle/logs,但要在 phys-schost-1 啟動並裝載 /global/oracle 之後。

    5. 確認每一個節點的 /etc/vfstab 檔中的登錄以相同的次序列出共同裝置。

      例如,如果 phys-schost-1phys-schost-2 和裝置 d0d1d2 之間有實體連線,則在各自 /etc/vfstab 檔中列出的登錄應該是 d0d1d2

    請參閱 vfstab(4) 線上援助頁來取得詳細資訊。

  5. 在叢集的任一個節點上,驗證裝載點存在而且 /etc/vfstab 檔案登錄在叢集的所有節點上都正確。


    # sccheck
    

    如果沒有錯誤,則沒有執行動作。

  6. 從叢集的任一個節點裝載叢集檔案系統。


    # mount /global/device-group/mount-point
    
  7. 在叢集的每一個節點上,驗證叢集檔案系統已經裝載。

    您可以使用 df(1M) 或 mount(1M) 指令來列出已裝載的檔案系統。

3.4.1.1 範例-新增叢集檔案系統

以下範例在 Solstice DiskSuite 中繼裝置 /dev/md/oracle/rdsk/d1 建立一個 UFS 叢集檔案系統。


# newfs /dev/md/oracle/rdsk/d1
...
 
[on each node:]
# mkdir -p /global/oracle/d1
 
# vi /etc/vfstab
#device           device       mount   FS      fsck    mount   mount
#to mount        to fsck       point   type    pass    at boot options
#                       
/dev/md/oracle/dsk/d1 /dev/md/oracle/rdsk/d1 /global/oracle/d1 ufs 2 yes global,logging
[save and exit]
 
[on one node:]
# sccheck
 
# mount /global/oracle/d1
# mount
...
/global/oracle/d1 on /dev/md/oracle/dsk/d1 read/write/setuid/global/logging/
largefiles on Sun Oct 3 08:56:16 1999

3.4.2 如何移除叢集檔案系統

您只要執行卸載,便可以 `移除' 叢集檔案系統。如果您還要移除或刪除資料,請從系統移除基礎裝置(或中繼裝置或容體)。


註解 -

當您執行 scshutdown(1M) 來停止整體叢集時,叢集檔案系統會自動卸載,當作系統關機程序的一部份。您執行 shutdown 來停止單一節點時,並不會卸載叢集檔案系統。不過,如果開始關機的節點是唯一連到磁碟的節點,則存取該磁碟上的叢集檔案系統會導致錯誤。


卸載叢集檔案系統的必備條件如下:

  1. 成為叢集中某個節點的超級使用者(superuser)。

  2. 判斷叢集檔案系統是否已經裝載。


    # mount -v
    
  3. 在每一個節點上,列示使用叢集檔案系統的所有處理,來查知您要停止的處理。


    # fuser -c [ -u ] mount-point
    
    -c

    產生檔案系統之裝載點以及所裝載之檔案系統內之檔案的報告。

    -u

    (選用性)顯示每一個處理 ID 的使用者登入名稱。

    mount-point

    指定您要停止處理之叢集檔案系統的名稱。

  4. 在每一個節點上,停止叢集檔案系統的所有處理。

    請使用慣用的方法停止處理。如果必要,請使用以下指令來強迫結束與叢集檔案系統關聯的處理。


    # fuser -c -k mount-point
    

    將會傳送 SIGKILL 給每一個使用叢集檔案系統的處理。

  5. 在每一個節點上,確認沒有任何處理使用檔案系統。


    # fuser -c mount-point
    
  6. 從一個節點卸載檔案系統。


    # umount mount-point
    
    mount-point

    指定您要卸載之叢集檔案系統的名稱。可以是裝載叢集檔案系統的目錄名稱,也可以是檔案系統的裝置名稱路徑。

  7. (選用)編輯 /etc/vfstab 檔,刪除要移除之叢集檔案系統的登錄。

    請對每一個在其 /etc/vfstab 檔中含有這個叢集檔案系統登錄的叢集節點執行這個步驟。

  8. (選用)移除 disk device group/metadevice/plex。

    請參閱容體管理者文件來取得詳細資訊。

3.4.2.1 範例-移除叢集檔案系統

以下範例移除裝載於 Solstice DiskSuite 中繼裝置 /dev/md/oracle/rdsk/d1 的 UFS 叢集檔案系統。


# mount -v
...
/global/oracle/d1 on /dev/md/oracle/dsk/d1 read/write/setuid/global/logging/largefiles on Sun Oct  3 08:56:16 1999
# fuser -c /global/oracle/d1
/global/oracle/d1: 4006c
# fuser -c -k /global/oracle/d1
/global/oracle/d1: 4006c
# fuser -c /global/oracle/d1
/global/oracle/d1:
# umount /global/oracle/d1
 
(on each node, remove the highlighted entry:)
# vi /etc/vfstab
#device           device        mount   FS      fsck    mount   mount
#to mount         to fsck       point   type    pass    at boot options
#                       
/dev/md/oracle/dsk/d1 /dev/md/oracle/rdsk/d1 /global/oracle/d1 ufs 2 yes global,logging
[Save and exit.]

註解 -

要移除叢集檔案系統上的資料,請移除其基礎裝置。請參閱容體管理者文件來取得詳細資訊。


3.4.3 如何檢查叢集中的整體裝載

sccheck(1M) 公用程式可檢查 /etc/vfstab 檔中叢集檔案系統的登錄的語法。如果沒有錯誤,則沒有執行動作。


註解 -

請在進行如移除叢集檔案系統等,會影響裝置或容體管理元件的叢集配置變更後執行 sccheck


  1. 成為叢集中某個節點的超級使用者(superuser)。

  2. 檢查叢集整體裝載。


    # sccheck
    

3.4.4 如何從磁碟裝置群組(Solstice DiskSuite)移除節點

請使用這個程序從執行 Solstice DiskSuite 的磁碟裝置群組(磁碟組)移除叢集節點。

  1. 判斷要移除其節點的磁碟裝置群組是否為成員。


    # scstat -D
    
  2. 在目前擁有您要從其移除節點的磁碟裝置群組的節點成為超級使用者(superuser)。

  3. 從磁碟裝置群組中刪除已移除節點的主機名稱。

    對於各項已移除節點的磁碟裝置群組,請重覆此步驟。


    # metaset -s setname -d -f -h node
    
    -s setname

    指定磁碟裝置群組(磁碟組)名稱

    -f

    強迫

    -d

    從磁碟裝置群組刪除

    -h nodelist

    從可控管磁碟裝置群組之節點的列表移除該節點


    註解 -

    更新可能需要數分鐘才能夠完成。


  4. 確認從磁碟裝置群組移除該節點。

    磁碟裝置群組名稱將和 metaset 指令指定的磁碟組名稱名稱一致。


    # scstat -D
    

3.4.4.1 範例-從磁碟裝置群組移除節點(SDS)

以下範例顯顯示如何從磁碟裝置群組(中繼組)移除主機名稱以及驗證節點是否已經從磁碟裝置群組移除。儘管範例中顯示已從單一磁碟裝置群組中移除節點,不過,節點也可同時屬於一個以上的磁碟裝置群組。對於各個您想從其中移除節點 的磁碟裝置群組,請重覆此項 metaset 指令。


[Determine the disk device group(s) for the node:]
# scstat -D
  -- Device Group Servers --
                      Device Group  Primary       Secondary
                      ------------  -------       ---------
  Device group servers: dg-schost-1  phys-schost-1  phys-schost-2
[Become superuser.]
[Remove the hostname from all disk device groups:]
# metaset -s dg-schost-1 -d -f -h phys-schost-2
[Verify removal of the node:]
# scstat -D
  -- Device Group Servers --
                       Device Group  Primary       Secondary
                       ------------  -------       ---------
  Device group servers: dg-schost-1  phys-schost-1  -

3.4.5 如何從磁碟裝置群組移除節點(VERITAS 容體管理者)

請使用這個程序從執行 VERITAS 容體管理者(VxVM)之現有磁碟裝置群組(磁碟群組)移除叢集節點。

  1. 判斷其要移除之節點是其成員的磁碟裝置群組。


    # scstat -D
    
  2. 成為現行叢集成員節點的超級使用者(superuser)。

  3. 執行 scsetup 公用程式。


    # scsetup
    

    出現「主功能表」。

  4. 輸入 3(裝置群組與容體)來重新配置磁碟裝置群組。

  5. 輸入 5(從 VxVM 裝置群組移除節點)來從 VxVM 磁碟裝置群組移除節點。

    依提示從磁碟裝置群組移除叢集節點。將會詢問您以下項目的相關資訊:

    VxVM 裝置群組

    節點名稱

  6. 確認節點已從 VxVM 磁碟裝置群組移除:


    # scstat -D	
      ...
      Device group name: devicegroupname
      Device group type: VxVM
      Device group failback enabled: no
      Device group node list: nodename
      Diskgroup name: diskgroupname
      ...

3.4.5.1 範例-從磁碟裝置群組(VxVM)移除節點

這個範例顯示從 dg1 VxVM 磁碟裝置群組移除名為 phys-schost-4 的節點。


[Determine the disk device group for the node:]
# scstat -D
  -- Device Group Servers --
                       Device Group  Primary        Secondary
                       ------------  -------        ---------
  Device group servers: dg-schost-1  phys-schost-1  phys-schost-2
[Become superuser and execute the scsetup utility:]
# scsetup
[Select option 3:]
*** Main Menu ***
    Please select from one of the following options:
      ...
      3) Device groups and volumes
      ...
    Option: 3
[Select option 5:]
*** Device Groups Menu ***
    Please select from one of the following options:
      ...
      5) Remove a node from a VxVM device group
      ...
    Option:  5
[Answer the questions to remove the node:]
>>> Remove a Node from a VxVM Device Group <<<
    ...
    Is it okay to continue (yes/no) [yes]? yes
    ...
    Name of the VxVM device group from which you want to remove a node?  dg1
    Name of the node to remove from this group?  phys-schost-4
    Is it okay to proceed with the update (yes/no) [yes]? yes
 
scconf -r -D name=dg1,nodelist=phys-schost-4
 
    Command completed successfully.
    Hit ENTER to continue: 

[Quit the scsetup Device Groups Menu and Main Menu:]
    ...
    Option:  q
[Verify that the node was removed:]
# scstat -D
  ...
  Device group name: 		dg1
  Device group type: 	VxVM
  Device group failback enabled: 	no
  Device group node list: 	phys-schost-3
  Diskgroup name: 	dg1
  ...