跳过导航链接 | |
退出打印视图 | |
![]() |
Oracle Solaris Cluster 系统管理指南 Oracle Solaris Cluster 3.3 3/13 (简体中文) |
1. Oracle Solaris Cluster 管理介绍
2. Oracle Solaris Cluster 和 RBAC
11. 修补 Oracle Solaris Cluster 软件和固件
如何以交互方式恢复单个文件 (Solaris Volume Manager)
如何恢复根 (/) 文件系统 (Solaris Volume Manager)
如何恢复 Solaris Volume Manager 卷中的根 (/) 文件系统
表 12-1 任务列表:备份群集文件
|
不必成为超级用户或承担等效角色即可运行此命令。
# more /etc/vfstab
在备份文件系统时请使用此名称。
# more /etc/vfstab
示例 12-1 查找要备份的文件系统名称
下例显示了 /etc/vfstab 文件中列出的可用文件系统的名称。
# more /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # #/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes - f - /dev/fd fd - no - /proc - /proc proc - no - /dev/dsk/c1t6d0s1 - - swap - no - /dev/dsk/c1t6d0s0 /dev/rdsk/c1t6d0s0 / ufs 1 no - /dev/dsk/c1t6d0s3 /dev/rdsk/c1t6d0s3 /cache ufs 2 yes - swap - /tmp tmpfs - yes -
# ufsdump S filesystem
显示估计的执行备份所需的字节数。
指定要备份的文件系统的名称。
示例 12-2 确定所需磁带数量
在下例中,一个 4 G 的磁带可以轻松容纳大小为 905,881,620 字节的文件系统 (905,881,620 ÷ 4,000,000,000)。
# ufsdump S /global/phys-schost-1 905881620
使用此过程可备份群集节点的根 (/) 文件系统。执行备份过程之前,请确保群集正在无故障运行。
phys-schost# 提示符表示全局群集提示符。此操作过程适用于全局群集。
此过程提供了 Oracle Solaris Cluster 命令的长格式。此外,大多数命令还有短形式。这些命令除了名称长短的不同以外,其功能都是相同的。
# clnode evacuate node
指定从中切换资源组和设备组的节点。
# shutdown -g0 -y -i0
在基于 SPARC 的系统上,运行以下命令。
ok boot -xs
在基于 x86 的系统上,运行以下命令。
phys-schost# shutdown -g -y -i0 Press any key to continue
GRUB 菜单的显示类似于以下内容:
GNU GRUB version 0.95 (631K lower / 2095488K upper memory) +-------------------------------------------------------------------------+ | Solaris 10 /sol_10_x86 | | Solaris failsafe | | | +-------------------------------------------------------------------------+ Use the ^ and v keys to select which entry is highlighted. Press enter to boot the selected OS, 'e' to edit the commands before booting, or 'c' for a command-line.
有关基于 GRUB 的引导的更多信息,请参见《Oracle Solaris 管理:基本管理》中的"使用 GRUB 引导基于 x86 的系统(任务列表)"。
GRUB 引导参数屏幕的显示类似于以下内容:
GNU GRUB version 0.95 (615K lower / 2095552K upper memory) +----------------------------------------------------------------------+ | root (hd0,0,a) | | kernel /platform/i86pc/multiboot | | module /platform/i86pc/boot_archive | +----------------------------------------------------------------------+ Use the ^ and v keys to select which entry is highlighted. Press 'b' to boot, 'e' to edit the selected command in the boot sequence, 'c' for a command-line, 'o' to open a new line after ('O' for before) the selected line, 'd' to remove the selected line, or escape to go back to the main menu.
[ Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename. ESC at any time exits. ] grub edit> kernel /platform/i86pc/multiboot -x
屏幕将显示编辑后的命令。
GNU GRUB version 0.95 (615K lower / 2095552K upper memory) +----------------------------------------------------------------------+ | root (hd0,0,a) | | kernel /platform/i86pc/multiboot -x | | module /platform/i86pc/boot_archive | +----------------------------------------------------------------------+ Use the ^ and v keys to select which entry is highlighted. Press 'b' to boot, 'e' to edit the selected command in the boot sequence, 'c' for a command-line, 'o' to open a new line after ('O' for before) the selected line, 'd' to remove the selected line, or escape to go back to the main menu.-
注 - 对内核引导参数命令所做的这一更改在系统引导后将失效。下次重新引导节点时,系统将引导至群集模式。如果希望引导至非群集模式,请重新执行上述步骤,并将 -x 选项添加到内核引导参数命令中。
# df -k
# ls /backing-store-file
# fssnap -F ufs -o bs=/backing-store-file /file-system
# /usr/lib/fs/ufs/fssnap -i /file-system
# ufsdump 0ucf /dev/rmt/0 snapshot-name
例如:
# ufsdump 0ucf /dev/rmt/0 /dev/rfssnap/1
# ufsrestore ta /dev/rmt/0
# init 6
示例 12-3 备份根 (/) 文件系统
在下例中,根 (/) 文件系统的快照将保存至 /usr 目录的 /scratch/usr.back.file 中。
# fssnap -F ufs -o bs=/scratch/usr.back.file /usr /dev/fssnap/1
无需卸载镜像的 Solaris Volume Manager 卷或使整个镜像脱机即可备份该卷。您必须暂时使其中一个子镜像脱机(因而失去镜像),但备份完成后可立即使之联机并重新同步,这样就不必停止系统,也不用拒绝用户访问数据。通过使用镜像来执行联机备份,可创建活动文件系统的“快照”备份。
如果在某个程序将数据写入卷后又立即运行了 lockfs 命令,则可能会出现问题。要避免此故障,请暂时停止在此节点上运行的所有服务。另外,在执行此备份过程之前,请确保群集正在无故障运行。
phys-schost# 提示符表示全局群集提示符。此操作过程适用于全局群集。
此过程提供了 Oracle Solaris Cluster 命令的长格式。此外,大多数命令还有短形式。这些命令除了名称长短的不同以外,其功能都是相同的。
# metaset -s setname
指定磁盘集名称。
# lockfs -w mountpoint
注 - 仅当 UFS 文件系统驻留在镜像上时,才必须锁定文件系统。例如,如果 Solaris Volume Manager 卷设置为数据库管理软件或某些其他特定应用程序的原始设备,则不必使用 lockfs 命令。但是,您可以运行与供应商相关的适当实用程序来刷新缓存器和锁定存取。
# metastat -s setname -p
以类似于 md.tab 文件的格式显示状态。
# metadetach -s setname mirror submirror
注 - 将继续从其他子镜像进行读取。但是,对镜像进行第一次写操作后,脱机子镜像将立即不再同步。脱机子镜像重新联机后,这种不一致现象就会得到纠正。您无需运行 fsck 命令。
# lockfs -u mountpoint
# fsck /dev/md/diskset/rdsk/submirror
使用 ufsdump(1M) 命令或经常使用的备份实用程序。
# ufsdump 0ucf dump-device submirror
注 - 对子镜像使用原始设备 (/rdsk) 名称,而不使用块设备 (/dsk) 名称。
# metattach -s setname mirror submirror
当元设备或卷处于联机状态后,将会自动与镜像重新同步。
# metastat -s setname mirror
示例 12-4 为镜像执行联机备份 (Solaris Volume Manager)
在下例中,群集节点 phys-schost-1 是元集 schost-1 的所有者,因此从 phys-schost-1 执行备份过程。镜像 /dev/md/schost-1/dsk/d0 由子镜像 d10、d20 和 d30 组成。
[Determine the owner of the metaset:] # metaset -s schost-1 Set name = schost-1, Set number = 1 Host Owner phys-schost-1 Yes ... [Lock the file system from writes:] # lockfs -w /global/schost-1 [List the submirrors:] # metastat -s schost-1 -p schost-1/d0 -m schost-1/d10 schost-1/d20 schost-1/d30 1 schost-1/d10 1 1 d4s0 schost-1/d20 1 1 d6s0 schost-1/d30 1 1 d8s0 [Take a submirror offline:] # metadetach -s schost-1 d0 d30 [Unlock the file system:] # lockfs -u / [Check the file system:] # fsck /dev/md/schost-1/rdsk/d30 [Copy the submirror to the backup device:] # ufsdump 0ucf /dev/rmt/0 /dev/md/schost-1/rdsk/d30 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/md/schost-1/rdsk/d30 to /dev/rdsk/c1t9d0s0. ... DUMP: DUMP IS DONE [Bring the submirror back online:] # metattach -s schost-1 d0 d30 schost-1/d0: submirror schost-1/d30 is attached [Resynchronize the submirror:] # metastat -s schost-1 d0 schost-1/d0: Mirror Submirror 0: schost-0/d10 State: Okay Submirror 1: schost-0/d20 State: Okay Submirror 2: schost-0/d30 State: Resyncing Resync in progress: 42% done Pass: 1 Read option: roundrobin (default) ...
为确保群集配置已归档并可轻松恢复,请定期对群集配置加以备份。Oracle Solaris Cluster 可将群集配置导出到一个可扩展标记语言(eXtensible Markup Language, XML) 文件。
# /usr/cluster/bin/cluster export -o configfile
群集命令正在将群集配置信息导出到的 XML 配置文件的名称。有关 XML 配置文件的信息,请参见 clconfiguration(5CL)。
# vi configfile