使用此程序可以鏡像使用者定義的檔案系統。 在此程序中,節點不需要重新啟動。
成為叢集上某個節點的超級使用者。
將使用者定義的檔案系統所在的片段放置於單一片段 (單向) 串接。
請使用磁碟片段的實體磁碟名稱 (cNtXdYsZ)。
# metainit -f submirror1 1 1 diskslice |
建立第二個串接。
# metainit -f submirror2 1 1 submirror-diskslice |
建立只含一個子鏡像的單向鏡像。
# metainit mirror -m submirror1 |
鏡像的複合裝置名稱在叢集中不需要是唯一的。
在每一個節點上,編輯您鏡像的所有使用者定義檔案系統的 /etc/vfstab 檔案。
將 device to mount 和 device to fsck 兩欄中的名稱置換成鏡像名稱。
# vi /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # /dev/md/dsk/mirror /dev/md/rdsk/mirror /filesystem ufs 2 no global |
將第二個子鏡像連接至鏡像。
這個連接動作會啟動子鏡像的同步作業。
# metattach mirror submirror2 |
等待步驟 7 開始的鏡像同步作業完成。
使用 metastat(1M) 指令檢視鏡像狀態。
# metastat mirror |
If the disk used to mirror the user-defined file system is physically connected to more than one node (multiported), enable the localonly property of the raw disk device group for the disk used to mirror the user-defined file system.
您必須啟用 localonly 屬性,在啟動裝置連接多個節點時,可以避免在無意中將節點與其啟動裝置隔離。
必要時,請使用 scdidadm -L 指令顯示原始磁碟裝置群組的完整裝置 ID (DID) 虛擬驅動程式名稱。
在下列範例中,原始磁碟裝置群組名稱 dsk/d4 是輸出第三欄 (完整 DID 虛擬驅動式名稱) 的一部份。
# scdidadm -L ... 1 phys-schost-3:/dev/rdsk/c1t1d0 /dev/did/rdsk/d2 # scconf -c -D name=dsk/d2,localonly=true |
有關 localonly 屬性的其它資訊,請參閱 scconf_dg_rawdisk(1M) 線上援助頁。
檢視原始磁碟裝置群組的節點清單。
輸出內容與下例類似,其中 N 是 DID 號碼。
# scconf -pvv | grep dsk/dN Device group name: dsk/dN ... (dsk/dN) Device group node list: phys-schost-1, phys-schost-3 ... |
節點清單中是否包含一個以上的節點名稱?
除了您對其根磁碟進行鏡像的節點之外,將此原始磁碟裝置群組節點清單中的其它節點全部移除。
唯有已經進行根磁碟鏡像的節點才可以留在節點清單內。
# scconf -r -D name=dsk/dN,nodelist=node |
指定原始磁碟裝置群組的叢集唯一名稱
指定要從節點清單內移除的節點名稱
使用 scconf(1M) 指令啟用 localonly 屬性。
當localonly 屬性啟用後,原始磁碟裝置群組便只專門給節點清單內的節點使用。如果啟動裝置連接多個節點時,這可避免在無意中將節點與其啟動裝置隔離。
# scconf -c -D name=rawdisk-groupname,localonly=true |
指定原始磁碟裝置群組的名稱
建立磁碟組。
請至 "如何建立磁碟組"。
下列範例顯示 d4 的建立,以鏡像 /home,這是位於 c0t0d0s4。d4 鏡像是由分割區 c0t0d0s4 上的子鏡像 d14 和分割區 c2t2d0s4 上的子鏡像 d24 所組成。/home 的 /etc/vfstab 檔案項目會更新為使用鏡像名稱 d4。磁碟 c2t2d0 是多埠連接的磁碟,所以啟用 localonly 屬性。
(Create the mirror) # metainit -f d14 1 1 c0t0d0s4 d14: Concat/Stripe is setup # metainit -f d24 1 1 c2t2d0s4 d24: Concat/Stripe is setup # metainit d4 -m d14 d4: Mirror is setup (Edit the /etc/vfstab file) # vi /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # /dev/md/dsk/d4 /dev/md/rdsk/d4 /home ufs 2 no global (Attach the second submirror) # metattach d4 d24 d4: Submirror d24 is attached (View the sync status) # metastat d4 d4: Mirror Submirror 0: d14 State: Okay Submirror 1: d24 State: Resyncing Resync in progress: 15 % done ... (Identify the DID name of the mirrored disk's raw disk device group) # scdidadm -L ... 1 phys-schost-3:/dev/rdsk/c2t2d0 /dev/did/rdsk/d2 (Display the node list of the mirror disk's raw disk device group) # scconf -pvv | grep dsk/d2 Device group name: dsk/d2 ... (dsk/d2) Device group node list: phys-schost-1, phys-schost-3 ... (Remove phys-schost-3 from the node list for the raw disk device group) # scconf -r -D name=dsk/d2,nodelist=phys-schost-3 (Enable the localonly property of the mirrored disk's raw disk device group) # scconf -c -D name=dsk/d2,localonly=true |