使用该过程镜像无法在正常系统使用期间卸装的文件 系统,如 /usr、/opt 或 swap。
成为群集的节点的超级用户。
使可卸装的文件系统驻留的片处于单片(单向)并置状态。
# metainit -f submirror1 1 1 disk-slice |
创建第二个并置。
# metainit -f submirror2 1 1 submirror-disk-slice |
创建包含一个子镜像的单向镜像。
镜像的元设备名称在群集中不必是唯一的。
# 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 /file-system ufs 2 no global |
从节点中抽出所有资源组或设备组。
# scswitch -S -h node |
抽出所有资源组和设备组
指定从中抽出资源组或设备组的节点的名称
重新引导节点。
# shutdown -g 0 -y -i 6 |
将第二个子镜像与每个镜像连接。
该连接启动子镜像的同步。
# metattach mirror submirror2 |
等待在步骤 9中启动的镜像同步的完成。
使用 metastat(1M) 命令查看镜像状态。
# metastat mirror |
如果用于镜像可卸装的文件系统的磁盘物理连接到多个节点(多端口连接),请启用 用于镜像可卸装的文件系统的磁盘的原始磁盘设备组的 localonly 特性。
如果引导设备与多个节点连接,则必须启用 localonly 特性以 防止无意中使节点与其引导设备隔离。
如有必要,可使用 scdidadm -L 命令显示原始 磁盘设备组的完整设备标识 (DID) 伪驱动程序名称。
在下面的示例中,原始磁盘设备组名称 dsk/d2 是输出的第三列的一部 分,这一列就是完整的 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) 手册页。
使用 scconf(1M) 命令启用 localonly 特性。
# scconf -c -D name=rawdisk_groupname,localonly=true |
指定原始磁盘设备组的名称
下面的示例显示在节点 phys-schost-1 上创建 镜像 d1 以镜像 /usr(驻留 在 c0t0d0s1 上)。镜像 d1 由 分区 c0t0d0s1 中的子镜像 d11 和分 区 c2t2d0s1 中的子镜像 d21 组成。/usr 的 /etc/vfstab 文件条目更新为使用镜像名称 d1。磁盘 c2t2d0 是一个多端口连接的磁盘,因而启用了 localonly 特性。
(Create the mirror:) # metainit -f d11 1 1 c0t0d0s1 d11: Concat/Stripe is setup # metainit -f d21 1 1 c2t2d0s1 d21: Concat/Stripe is setup # metainit d1 -m d11 d1: 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/d1 /dev/md/rdsk/d1 /usr ufs 2 no global (Reboot the node:) # scswitch -S -h phys-schost-1 # shutdown -g 0 -y -i 6 (Attach the second submirror:) # metattach d1 d21 d1: Submirror d21 is attached (View the sync status:) # metastat d1 d1: Mirror Submirror 0: d11 State: Okay Submirror 1: d21 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 (Enable the localonly property of the mirrored disk's raw disk device group:) # scconf -c -D name=dsk/d2,localonly=true |
要镜像用户定义的文件系统,请转到"如何镜像用户定义的文件系统"。或者,要创建磁盘集,请转到"如何创建磁盘集"。