Sun Cluster 3.0 U1 系統管理手冊

8.1.5 如何執行容體的線上備份 (VERITAS Volume Manager)

VERITAS 容體管理者將鏡像容體視為診測裝置。備份診測裝置時不必先卸載,也不必將整個容體設成離線。這是透過建立容體的快照副本以及備份這個暫時容體的方式來完成,不必關閉系統也不必拒絕使用者存取資料。

請先確定叢集執行時沒有任何錯誤,再執行備份程序。

  1. 登入叢集中任一個節點,同時在叢集上之磁碟群組的現行主要節點上成為超級使用者。

  2. 列出磁碟群組資訊。


    # vxprint -g diskgroup
    

  3. 執行 scstat(1M) 指令,以檢查哪一個節點擁有目前匯入的磁碟群組,表示它就是磁碟群組的主要節點。


    # scstat -D
    

    -D

    顯示所有磁碟裝置群組的狀態。

  4. 使用 vxassist(1M) 指令來建立容體的快照。


    # vxassist -g diskgroup snapstart volume
    


    註解 -

    視您容體大小而定,建立快照可能需要一段長時間。


  5. 確認已建立新的容體。


    # vxprint -g diskgroup
    

    當快照完成時,Snapdone 的狀態會顯示在選取之磁碟群組的 State 欄位中。

  6. 停止任何存取檔案系統的資料服務。


    # scswitch -z -g resource-group -h ""
    


    註解 -

    停止資料服務以確保資料檔案系統備份正常執行。如果沒有任何資料服務正在執行,則您不需要執行 步驟 6步驟 8


  7. 使用 vxassist 指令建立名為 bkup-vol 的備份容體,並將快照容體連到其中。


    # vxassist -g diskgroup snapshot volume bkup-vol
    

  8. 使用 scswitch 指令來重新啟動所有在 步驟 6 中停止的資料服務。


    # scswitch -z -g resource-group -h nodelist
    

  9. 使用 vxprint 指令驗證容體現在已經連到新的容體 bkup-vol


    # vxprint -g diskgroup
    

  10. 註冊磁碟群組的配置變更。


    # scconf -c -D name=diskgroup,sync
    

  11. 使用 fsck 指令來檢驗備份容體。


    # fsck -y /dev/vx/rdsk/diskgroup/bkup-vol
    

  12. 執行備份作業,將容體 bkup-vol 複製到磁帶或其他媒體。

    使用 ufsdump(1M) 指令或您通常會使用的備份公用程式。


    # ufsdump 0ucf dump-device /dev/vx/dsk/diskgroup/bkup-vol
    

  13. 使用 vxedit(1M) 來移除暫時容體。


    # vxedit -rf rm bkup-vol
    

  14. 使用 scconf 指令來註冊磁碟群組配置變更。


    # scconf -c -D name=diskgroup,sync
    

8.1.5.1 範例 - 執行容體的線上備份(VERITAS Volume Manager)

在下列範例中,叢集節點 phys-schost-2 為 metaset 磁碟群組 schost-1 的主要擁有者,因此備份的程序是從 phys-schost-2 開始執行。複製 /vo101 容體並與新容體 bkup-vol 關聯。


[Become superuser on the primary node.]
[Identify the current primary node for the disk group:]
# scstat -D
-- Device Group Servers --
                         Device Group     Primary           Secondary
                         ------------     -------           ---------
 Device group servers:   rmt/1            -                 -
 Device group servers:   schost-1         phys-schost-2     phys-schost-1

-- Device Group Status --
                             Device Group        Status              
                             ------------        ------              
 Device group status:        rmt/1               Offline
 Device group status:        schost-1            Online
[List the disk group information:]
# vxprint -g schost-1
TY NAME            ASSOC     KSTATE   LENGTH   PLOFFS STATE   TUTIL0  PUTIL0
dg schost-1       schost-1   -        -        -      -        -      -
  
dm schost-101     c1t1d0s2   -        17678493 -      -        -      -
dm schost-102     c1t2d0s2   -        17678493 -      -        -      -
dm schost-103     c2t1d0s2   -        8378640  -      -        -      -
dm schost-104     c2t2d0s2   -        17678493 -      -        -      -
dm schost-105     c1t3d0s2   -        17678493 -      -        -      -
dm schost-106     c2t3d0s2   -        17678493 -      -        -      -
 
v  vol01          gen        ENABLED  204800   -      ACTIVE   -      -
pl vol01-01       vol01      ENABLED  208331   -      ACTIVE   -      -
sd schost-101-01  vol01-01   ENABLED  104139   0      -        -      -
sd schost-102-01  vol01-01   ENABLED  104139   0      -        -      -
pl vol01-02       vol01      ENABLED  208331   -      ACTIVE   -      -
sd schost-103-01  vol01-02   ENABLED  103680   0      -        -      -
sd schost-104-01  vol01-02   ENABLED  104139   0      -        -      -
pl vol01-03       vol01      ENABLED  LOGONLY  -      ACTIVE   -      -
sd schost-103-02  vol01-03   ENABLED  5        LOG    -        -      -
[Start the snapshot operation:]
# vxassist -g schost-1 snapstart vol01
[Verify the new volume was created:]
# vxprint -g schost-1
TY NAME            ASSOC    KSTATE    LENGTH   PLOFFS STATE   TUTIL0  PUTIL0
dg schost-1       schost-1   -        -        -      -        -      -
  
dm schost-101     c1t1d0s2   -        17678493 -      -        -      -
dm schost-102     c1t2d0s2   -        17678493 -      -        -      -
dm schost-103     c2t1d0s2   -        8378640  -      -        -      -
dm schost-104     c2t2d0s2   -        17678493 -      -        -      -
dm schost-105     c1t3d0s2   -        17678493 -      -        -      -
dm schost-106     c2t3d0s2   -        17678493 -      -        -      -
  
v  vol01          gen        ENABLED  204800   -      ACTIVE   -      -
pl vol01-01       vol01      ENABLED  208331   -      ACTIVE   -      -
sd schost-101-01  vol01-01   ENABLED  104139   0      -        -      -
sd schost-102-01  vol01-01   ENABLED  104139   0      -        -      -
pl vol01-02       vol01      ENABLED  208331   -      ACTIVE   -      -
sd schost-103-01  vol01-02   ENABLED  103680   0      -        -      -
sd schost-104-01  vol01-02   ENABLED  104139   0      -        -      -
pl vol01-03       vol01      ENABLED  LOGONLY  -      ACTIVE   -      -
sd schost-103-02  vol01-03   ENABLED  5        LOG    -        -      -
pl vol01-04       vol01      ENABLED  208331   -      SNAPDONE -      -
sd schost-105-01  vol01-04   ENABLED  104139   0      -        -      -
sd schost-106-01  vol01-04   ENABLED  104139   0      -        -      -
[Stop data services, if necessary:]
# scswitch -z -g nfs-rg -h ""
[Create a copy of the volume:]
# vxassist -g schost-1 snapshot vol01 bkup-vol
[Restart data services, if necessary:]
# scswitch -z -g nfs-rg -h phys-schost-1
[Verify bkup-vol was created:]
# vxprint -g schost-1
TY NAME           ASSOC       KSTATE   LENGTH   PLOFFS STATE   TUTIL0  PUTIL0
dg schost-1       schost-1    -        -        -      -        -      -
 
dm schost-101     c1t1d0s2    -        17678493 -      -        -      -
...
 
v  bkup-vol       gen         ENABLED  204800   -      ACTIVE   -      -
pl bkup-vol-01    bkup-vol    ENABLED  208331   -      ACTIVE   -      -
sd schost-105-01  bkup-vol-01 ENABLED  104139   0      -        -      -
sd schost-106-01  bkup-vol-01 ENABLED  104139   0      -        -      -
 
v  vol01          gen         ENABLED  204800   -      ACTIVE   -      -
pl vol01-01       vol01       ENABLED  208331   -      ACTIVE   -      -
sd schost-101-01  vol01-01    ENABLED  104139   0      -        -      -
sd schost-102-01  vol01-01    ENABLED  104139   0      -        -      -
pl vol01-02       vol01       ENABLED  208331   -      ACTIVE   -      -
sd schost-103-01  vol01-02    ENABLED  103680   0      -        -      -
sd schost-104-01  vol01-02    ENABLED  104139   0      -        -      -
pl vol01-03       vol01       ENABLED  LOGONLY  -      ACTIVE   -      -
sd schost-103-02  vol01-03    ENABLED  5        LOG    -        -      -
[Synchronize the disk group with cluster framework:]
# scconf -c -D name=schost-1,sync
[Check the file systems:]
# fsck -y /dev/vx/rdsk/schost-1/bkup-vol
[Copy bkup-vol to the backup device:]
# ufsdump 0ucf /dev/rmt/0 /dev/vx/rdsk/schost-1/bkup-vol
  DUMP: Writing 63 Kilobyte records
  DUMP: Date of this level 0 dump: Tue Apr 25 16:15:51 2000
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/vx/dsk/schost-2/bkup-vol to /dev/rmt/0.
  ...
  DUMP: DUMP IS DONE
[Remove the bkup-volume:]
# vxedit -rf rm bkup-vol
[Synchronize the disk group:]
# scconf -c -D name=schost-1,sync