Sun Cluster 系統管理指南(適用於 Solaris 作業系統)

ProcedureSPARC: 如何執行磁碟區的線上備份 (VERITAS Volume Manager)

VERITAS Volume Manager 將鏡像磁碟區識別為診測裝置。診測裝置可以在沒有卸載且沒有使整個磁碟區離線的情況下備份。結果是透過建立磁碟區的快照副本以及備份這個暫時磁碟區的方式來完成,不必關閉系統也不必拒絕使用者存取資料。

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

此程序提供長形式的 Sun Cluster 指令。大多數指令還有簡短的形式。除了指令名稱有長形式和短形式之分外,指令本身是相同的。如需指令及其短形式的清單,請參閱附錄 ASun Cluster 以物件為導向的指令

  1. 登入叢集中的任何節點,然後成為超級使用者,或在叢集上的磁碟群組的目前主要節點上成為提供 solaris.cluster.admin RBAC 授權的角色。

  2. 列出磁碟群組資訊。


    # vxprint -g diskgroup
    
  3. 判定哪一個節點擁有目前匯入的磁碟群組,表示它就是磁碟群組的主要節點。


    # cldevicegroup status
    
  4. 建立磁碟區快照。


    # vxassist -g diskgroup snapstart volume
    

    備註 –

    視您磁碟區大小而定,建立快照可能需花上很長的時間。


  5. 驗證是否已建立新的磁碟區。


    # vxprint -g diskgroup
    

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

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


    # clresourcegroup offline resource-group
    

    備註 –

    停止資料服務,以確保資料檔案系統備份正常執行。如果未執行任何資料服務,則無需執行步驟 6步驟 8


  7. 建立名為 bkup-vol 的備份磁碟區,並將快照磁碟區附加至其中。


    # vxassist -g diskgroup snapshot volume bkup-vol
    
  8. 使用 clresourcegroup 指令重新啟動任何在步驟 6 受中止的資料服務。


    # clresourcegroup online - zone -n node resourcegroup
    
    node

    節點名稱。

    zone

    可以控制資源群組的節點上的非全域區域名稱。唯有在您建立資源群組時已指定非全域區域時,才指定區域

  9. 驗證磁碟區現在是否已連結至新的磁碟區 bkup-vol


    # vxprint -g diskgroup
    
  10. 註冊裝置群組的配置變更。


    # cldevicegroup sync diskgroup
    
  11. 檢查備份磁碟區。


    # 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 -rf rm bkup-vol
    
  14. 註冊磁碟群組的配置變更。


    # cldevicegroup sync diskgroup
    

範例 11–5 SPARC: 執行磁碟區的線上備份 (VERITAS Volume Manager)

在下範例中,叢集節點 phys-schost-2 為裝置群組 schost-1 的主要所有者。因此,備份程序是從 phys-schost-2 執行。先複製磁碟區 /vo101,然後將其與新磁碟區 bkup-vol 關聯。


[Become superuser or assume a role that provides solaris.cluster.admin RBAC authorization on 
the primary node.]
[Identify the current primary node for the device group:]
# cldevicegroup status
-- 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 device 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:]
# clresourcegroup offline nfs-rg
[Create a copy of the volume:]
# vxassist -g schost-1 snapshot vol01 bkup-vol
[Restart data services, if necessary:]
# clresourcegroup online -n phys-schost-1 nfs-rg
[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:]
# cldevicegroup sync schost-1
[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:]
# cldevicegroup sync schost-1