Chinaunix首页 | 论坛 | 博客
  • 博客访问: 11491127
  • 博文数量: 8065
  • 博客积分: 10002
  • 博客等级: 中将
  • 技术积分: 96708
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-16 17:06
文章分类

全部博文(8065)

文章存档

2008年(8065)

分类: 服务器与存储

2008-07-17 10:54:32

volume snapshot

Traditional:1. 建一个Diskgroup至少3块盘(每mirror plex不能在同一块盘上)
2. 在这个Diskgroup创建一个layout=mirror的Volume nmirror=2
vxassist -g datadg make datavol 100m layout=mirror,nolog nmirror=2 alloc=datadg01 datadg02
2. vxvol set fastresync=on datavol 打开fastresync
3. vxassist -g datadg snapstart datavol(为snapshot做准备,即加入一个Plex形成3个Plex的Volume
新加的Plex是在datadg中的另一块subdisk上建立的,并且与前2个Plex进行同步
4. vxassist -g datadg snapshot datavol snapvol 新加入的Plex与datavol detach并生成snapshot volume
5. vxassist -g datadg snapback snapvol snapshot还原到原来的Volume中,和snapstart时一样
6. Clear the association to create an independent volume.
vxassist -g datadg snapclear snapvol
7.Destroy PITC
vxassist -g datadg remove volume snapvol

FastResync must be enabled for a volume in order to use this command. Snapshot objects (ss) and detached plexes (dp) are used by FastResync to track associations between a volume and its snapshot volumes


Instants: 1. vxassist -g datadg make datavol 100m datadg02建立datavol卷
2. vxsnap -g datadg prepare datavol (Enable FastResync)
此时自动建立datavol_dcl卷(100MB的datavol,datavol_dcl只有227KB,datavol有几个Plex datavol_dcl就建立几个
DCO log Plex用来记录做snapshot后datavol上数据的改变,以便通过snapshot可以快速恢复
3. vxsnap -g datadg addmir datavol 为datavol添加mirror plex(同Traditonal的第3步)
4. 建立一个空Volume作为snapshot volume用 (如果建空Volume转到5,也可以不建转到6)
LEN=`vxprint -g datadg -F%len datavol`
DCONAME=`vxprint -g datadg -F%dco_name datavol`
RSZ=`vxprint -g datadg -F%regionsz $DCONAME`
vxassist -g datadg make snapvol $LEN init=active
vxsnap -g datadg prepare snapvol regionsize=$RSZ
5. vxsnap -g datadg make source=datavol/snapvol=snapvol
把datavol中的一个Plex移动到snapvol作为snapshot volume
并不把datavol里原来新加的Mirror Plex转为snapvol volume里作为Plex
而是在datadg里的另一快磁盘建立subdisk并作为snapvol的Plex
6. vxsnap -g datadg make source=datavol/newvol=snapvol/plex=datavol-01(用哪个Plex去建新的Volume)
7. 刷新snapvol与datavol同步
vxsnap -g datadg refresh snapvol source=datavol
8. 重新加入回datavol变为一个Mirror Plex
vxsnap -g datadg reattach snapvol source=datavol
9. 解除snapvol与datavol的关系,snapvol变为独立的Volume
vxsnap -g datadg dis snapvol
10.删除snapvol
vxedit -g datadg -rf rm snapvol
OHP(Off-Host Processing ):
1. Enable FastResync on the volume:
# vxsnap -g datadg prepare datavol
2. Create an empty volume for use as the snapshot volume.
3. Suspend updates to the volume and unmount the file system:
# umount /mnt1
4. Create a full-sized instant snapshot for the volume:
# vxsnap -g datadg make source=datavol/snapvol=snapvol
5. If you temporarily suspended updates to the volume by a database, release the tables from hot-backup mode.
6. Split the snapshot volume into a separate disk group:
# vxdg split datadg offhostdg snapvol
7. Deport the disk group:
# vxdg deport offhostdg
8. On the off-host processing host, import the disk group:
# vxdg import offhostdg
9. To perform off-host processing, check and mount the snapshot volume:
# fsck -F vxfs /dev/vx/rdsk/offhostdg/snapvol
# mount -F vxfs /dev/vx/dsk/offhostdg/snapvol /mnt1
10. When processing is complete, unmount the snapshot:
# umount /mnt1
11. Deport the disk group:
# vxdg deport offhostdg
12. On the primary host, reimport the disk group:
# vxdg import offhostdg
13. Rejoin the disk group with the original disk group:
# vxdg join offhostdg datadg
14. Restart the snapshot volume using one of the following:
# vxrecover -g datadg -m snapvol
# vxvol -g datadg startall
15. Refresh the snapshot volume with the original volume:
# vxsnap -g datadg refresh snapvol datavol


File System:文件系统上的snapshot,只能恢复逻辑上的错误
Traditional和Instant snapshot自己一步步做过记下的
OHP没来得及做,照着文档整理了一下
阅读(820) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~