免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3704 | 回复: 4
打印 上一主题 下一主题

Mirror disk on striping and distribution(zt) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-05-25 20:33 |只看该作者 |倒序浏览
看到一篇不错的文档,帖上来分享

Mirror disk on striping and distribution

HP 諮詢中心工程師 周柏村 文

HP UNIX 10.20 版和之後更新的版本就巳經開始支援LVM分散式配置原則(LVM distributed allocation policy)這個功能,而且使用前必須先在系統上安裝HP MirrorDisk/UX software (product number B2491A)軟體工具,而如果是11。00版的作業系統,必須再安裝PHCO_27369, PHKL_28150和其具有相依性的修正程式。
下面是修正程式的簡介:


PHCO_27369 - s700_800 11.00 LVM commands cumulative patch
PHKL_28150 - s700_800 11.00 LVM Cumulative Patch w/Performance Upgrades


LVM 支援兩種型式的解裝(striping),
第一種是以 Kbyte 為單位的解裝(striping), 可以用 lvcreate -I  -i <# of stripes>  去做設定,然而在 LVM 鏡射(mirroring)using MirrorDisk/UX 裏並不支援 Kbyte based striping。

第二種型式是extent based striping. LVM 鏡射(mirroring) 支援extent based striping,同時這也是系統管理者較常使用的設定方式。Extent base striping 是以logical volume的觀念去做設定,但要特別注意的是,每個將被增加的logical extent 必須罝於同一個volume group,而且是分別屬於不同的磁碟(physical volume),要特別注意的是最小的實體 extent size為1Mbyte。

然而之前提過 分散式配置原則(Distributed allocation policy),乃是使用 extent based striping 方式是設定一個 logical volume,而 lvextend 這個命令就是用來對logical volume 中的每一個extent 做好配置的動作。譬如:一個logical volume 總共是100MB的空間, 而如果實體 extent 大小是1MB,那麼這將會令lvextend命令對每一個extent做配置的動作,因此會花費較多的建置時間,因為lvextend 命令被執行了100次。PHCO_27369和PHKL_28150增加了對分散式配置原則(Distributed allocation policy)的新功能,這將因此降低在配置鏡射(mirrored) logical volumes的extent base striped的時間;下列的步驟告訴各位如何使用分散式配置原則(distributed allocation policy)。

步驟1:首先建立一個新的 volume group.

      例子: mkdir /dev/vgDist

          mknod /dev/vgDist/group c 64 0x030000            
           註解:確認系統的volume group minor number 0x0#0000是唯一的。
                  
           vgcreate -s 1 /dev/vgDist /dev/dsk/c0t0d0 /dev/dsk/c0t1d0 /dev/dsk/c1t2d0 /dev/dsk/c1t3d0
            
            註解:上面命令中的 -s 1 指定一個 PE 的大小的為 1 Mbyte。系統預設最小的 extent size 是1Mbyte.而系統預設的 PE Size 是 4 MBytes。
            
步驟2:定義physical volume groups.
   
    我們可以使用SAM這個工具或者手動去編輯檔案 /etc/lvmpvg 來建立Physical volume groups。 Man page 有對lvmpvg(4)檔案格式和語法作一個更詳盡的說明。

    Physical volume groups實際上是用PVG-strict 的配置觀念。而PVG-strict配置可以確保主要的磁碟和要被mirror的磁碟中的extent不會被放在相同的實體volume group。一般來說,每一個實體volume group 是由很多的磁碟組合而成,而磁碟可能一個控制卡或一組控制卡連結。

        如果PVG-strict allocation被使用是在一個不同的控制卡的磁碟上,這樣可確保資料是分散儲存在不同的控制卡的磁碟上, 萬一控制卡出了問題或損毀,磁碟mirror 仍然可以繼續複制到其它控制卡上的磁碟,類似像這樣的配置可避免單一控制卡壞掉所帶來的嚴重損失。
   
        這是一個 /etc/lvmpvg file的例子

             VG /dev/vgDist
             PVG PVG1
             /dev/dsk/c0t0d0
             /dev/dsk/c0t1d0
             PVG PVG2
             /dev/dsk/c1t2d0
             /dev/dsk/c1t3d0
 
             註解:/dev/dsk/c0t0d0 和 /dev/dsk/c0t1d0 屬於實體volume group PVG1且在c0 控制卡上。 /dev/dsk/c1t2d0 和 /dev/dsk/c1t3d0 屬於實體volume group PVG2且在c1控制卡上。 Distributed logical volumes會確保有一份mirror stripped在c0控制卡的磁碟上,和一份將被復製的mirror copy stripped在c1控制卡的磁碟上。

步驟3:建立一個distributed logical volume.

        例子: lvcreate -D y -s g -m 1 -L 1000 -n dist1 /dev/vgDist

        上述命令的參數說明如下:
             -D y      指定分散式配置原則 (Distributed allocation policy)
             -s g       指定 PVG-strict 配置原則
             -m 1      指定 mirror copy 數量
             -L 1000    指定大小, 單位 MBytes
             -n dist1  logical volume的名稱

lvdisplay -v /dev/vgDist/dist1

--- Logical volumes ---
LV Name                     /dev/vgDist/dist1
VG Name                     /dev/vgDist
LV Permission                 read/write
LV Status                     available/syncd
Mirror copies               1
Consistency Recovery           MWC
Schedule                     parallel
LV Size (Mbytes)              1000
Current LE                   1000
Allocated PE                  2000
Stripes                       0
Stripe Size (Kbytes)             0
Bad block                    on
Allocation                    PVG-strict/distributed
IO Timeout (Seconds)           default

   ---Distribution of logical volume ---
   PV Name            LE on PV  PE on PV
   /dev/dsk/c0t0d0       500       500
   /dev/dsk/c0t1d0       500       500
   /dev/dsk/c1t2d0       500       500
   /dev/dsk/c1t2d0       500       500

   --- Logical extents ---
   LE   PV1                PE1  Status 1 PV2                PE2  Status 2
   0000 /dev/dsk/c0t0d0    0000 current  /dev/dsk/c1t2d0    0000 current
   0001 /dev/dsk/c0t1d0    0000 current  /dev/dsk/c1t3d0    0000 current
   0002 /dev/dsk/c0t0d0    0001 current  /dev/dsk/c1t2d0    0001 current
   0003 /dev/dsk/c0t1d0    0001 current  /dev/dsk/c1t3d0    0001 current
   0004 /dev/dsk/c0t0d0    0002 current  /dev/dsk/c1t2d0    0002 current
.......
truncated LE 0005-0996
.......
   0995 /dev/dsk/c0t1d0    0497 current  /dev/dsk/c1t3d0    0497 current
   0996 /dev/dsk/c0t0d0    0498 current  /dev/dsk/c1t2d0    0498 current
   0997 /dev/dsk/c0t1d0    0498 current  /dev/dsk/c1t3d0    0498 current
   0998 /dev/dsk/c0t0d0    0499 current  /dev/dsk/c1t2d0    0499 current
   0999 /dev/dsk/c0t1d0    0499 current  /dev/dsk/c1t3d0    0499 current


Notice how PV1 alternates physical extents between the disk devices in PVG1 and PV2 alternates between the disk devices in PVG2.  This is extent based striping

论坛徽章:
0
2 [报告]
发表于 2006-05-27 22:13 |只看该作者
小样,以后你发的贴我都看一遍

论坛徽章:
0
3 [报告]
发表于 2006-05-27 23:33 |只看该作者
最初由 ocp8i 发布
[B]小样,以后你发的贴我都看一遍 [/B]


为什么呀

论坛徽章:
0
4 [报告]
发表于 2006-05-28 00:02 |只看该作者
最初由 vongates 发布
[B]

为什么呀 [/B]


   肯定是有价值呀。:right:

论坛徽章:
0
5 [报告]
发表于 2006-05-28 06:42 |只看该作者
最初由 iPod 发布
[B]

   肯定是有价值呀。:right: [/B]


哈哈 这个我到没有想到,我还以为他要超过我呢:rose:
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP