您的位置:首页 > 大数据 > 人工智能

raid超级块组织,外部元数据与内部元数据

2014-03-19 17:16 465 查看
在mdadm中是通过superswitch来实现对超级块的操作,例如写入,载入到内存,更新等,但是除了我们理解的superblock有0.9及1.0版本之外,我们以为应该对应的应该只有两套superwitch操作,但是,源码中给出是这样的:

struct superswitch *superlist[] =

{

&super0, &super1,

&super_ddf, &super_imsm,

&mbr, &gpt,

NULL };

一直在苦苦摸索这究竟为什么有这么多?依旧不是很清楚,愿知者告知~

但据目前从wiki上https://raid.wiki.kernel.org/index.php/RAID_superblock_formats 关于raid超级块格式的介绍中,其中是这么所的


mdadm v3.0 -- Adding the Concept of User-Space Managed External Metadata Formats

In the development packages for mdadm v3.0, a new concept is added to the traditional version-0.90 and version-1 superblocks.
Currently two such metadata formats are supported:
    - DDF  - The SNIA standard format
    - Intel Matrix - The metadata used by recent Intel ICH controlers.
  
  Externally managed metadata introduces the concept of a 'container'.
  A container is a collection of (normally) physical devices which have
  a common set of metadata.  A container is assembled as an md array, but
  is left 'inactive'.

A container can contain one or more data arrays.  These are composed from
  slices (partitions?) of various devices in the container.

For example, a 5 devices DDF set can container a RAID1 using the first
  half of two devices, a RAID0 using the first half of the remain 3 devices,
  and a RAID5 over thte second half of all 5 devices.

也就是说从mdadmV3.0后引入了用户空间管理外部元数据格式,目前支持的有两种元数据格式,DDF(SNIA 标准格式)及Intel 矩阵。而外部管理元数据引入了“容器”的概念,也就是可以先把几个设备组成一个容器,他们共享元数据,而在创建阵列时候你可以直接使用容器名,这样会从中extract出需要的设备(好处就仅仅是共享元数据?那还要对容器进行额外处理呢,划得来吗?)。

所以我的理解是,super-ddf,super_imsm这些与我们所说的1.0 及0.9版本不是矛盾的东西,而是相互搭配的。1.0 0.9版本上的是对阵列能够加入的最大设备数,每个设备最大空间,是否支持迁移等等一些要求进行规范,而super_ddf,super_imsm这些是对元数据怎样组织(以阵列的形式还是什么的)的规范。版本规范与组织规范是相互搭配的,也就是1.0的版本可能是以矩阵的形式组织存储,或者以其他的形式(例如对象之类?)进行存储。

而另外涉及到关于external metadata 貌似资料也不多,只是在http://www.drbd.org/users-guide/ch-internals.html这个上面关于对DRBD的介绍中见到,如下:

DRBD meta data

DRBD stores various pieces of information about the data it keeps in a dedicated area. This metadata includes:

the size of the DRBD device,
the Generation Identifier ( GI, described in detail in Section 17.2, “Generation
Identifiers”),
the Activity Log ( AL, described in detail in Section 17.3, “The Activity Log”).
the quick-sync bitmap (described in detail in Section 17.4, “The quick-sync
bitmap”),

This metadata may be stored internally and externally. Which method is used is configurable on a per-resource basis.

17.1.1. Internal meta data

Configuring a resource to use internal meta data means that DRBD stores its meta data on the same physical lower-level device as the actual production data. It does so by setting aside an area at
the end of the device for the specific purpose of storing metadata.

Advantage. Since the meta data are inextricably linked with the actual data, no special action is required from the administrator in case of a hard disk failure. The meta data are lost together with the actual data and are also restored
together.

Disadvantage. In case of the lower-level device being a single physical hard disk (as opposed to a RAID set), internal meta data may negatively affect write throughput. The performance of write requests by the application may trigger an
update of the meta data in DRBD. If the meta data are stored on the same magnetic disk of a hard disk, the write operation may result in two additional movements of the write/read head of the hard disk.

17.1.2. External meta data

External meta data is simply stored on a separate, dedicated block device distinct from that which holds your production data.
Advantage. For some write operations, using external meta data produces a somewhat improved latency behavior.
Disadvantage. Meta data are not inextricably linked with the actual production data. This means that manual intervention is required in the case of a hardware failure destroying just the production
data (but not DRBD meta data), to effect a full data sync from the surviving node onto the subsequently replaced disk.
Use of external meta data is also the only viable option if all of the following apply:

You are using DRBD to duplicate an existing device that already contains data you wish to preserve, and
that existing device does not support enlargement, and
the existing file system on the device does not support shrinking.

DRBD将数据的各种信息块保存在一个专用的区域里,这些metadata包括了

a,DRBD设备的大小

b,产生的标识

c,活动日志

d,快速同步的位图

metadata的存储方式有内部和外部两种方式

内部metadata存放在与数据同一块硬盘或分区的最后的位置上

优点:metadata和数据是紧密联系在一起的,如果硬盘损坏,metadata同样就没有了,同样在恢复的时候,metadata也会一起被恢复回来

缺点:metadata和数据在同一块硬盘上,对于写操作的吞吐量会带来负面的影响,因为应用程序的写请求会触发metadata的更新,这样写操作就会造成两次额外的磁头读写移动。

外部的metadata存放在和数据磁盘分开的独立的块设备上

优点:对于一些写操作可以改进延迟

缺点:metadata和数据不在一起的,所以如果数据盘出现故障,在更换新盘的时候就需要人为干预来进行现有node对新硬盘的同步

所以从这里知道,内部,外部元数据的区别也就是究竟元数据(metadata)是否与数据放在同一个盘
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: