⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vinum-examples.html

📁 FreeBSD安装说明概述 FreeBSD 提供了一个以文字为主
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Some Examples</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD 使用手册" href="index.html" /><link rel="UP" title="The Vinum Volume Manager" href="vinum-vinum.html" /><link rel="PREVIOUS" title="Vinum Objects" href="vinum-objects.html" /><link rel="NEXT" title="Object Naming" href="vinum-object-naming.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /><meta http-equiv="Content-Type" content="text/html; charset=GB2312" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD 使用手册</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="vinum-objects.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 13. The Vinum Volume Manager</td><td width="10%" align="right" valign="bottom"><a href="vinum-object-naming.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="VINUM-EXAMPLES" name="VINUM-EXAMPLES">13.6. SomeExamples</a></h1><p>Vinum maintains a <span class="emphasis"><i class="EMPHASIS">configurationdatabase</i></span> which describes the objects known to an individual system. Initially,the user creates the configuration database from one or more configuration files with theaid of the <span class="CITEREFENTRY"><span class="REFENTRYTITLE">vinum</span>(8)</span>utility program. Vinum stores a copy of its configuration database on each disk slice(which Vinum calls a <span class="emphasis"><i class="EMPHASIS">device</i></span>) underits control. This database is updated on each state change, so that a restart accuratelyrestores the state of each Vinum object.</p><div class="SECT2"><h2 class="SECT2"><a id="AEN18965" name="AEN18965">13.6.1. The ConfigurationFile</a></h2><p>The configuration file describes individual Vinum objects. The definition of a simplevolume might be:</p><pre class="PROGRAMLISTING">    drive a device /dev/da3h    volume myvol      plex org concat        sd length 512m drive a</pre><p>This file describes four Vinum objects:</p><ul><li><p>The <span class="emphasis"><i class="EMPHASIS">drive</i></span> line describes a diskpartition (<span class="emphasis"><i class="EMPHASIS">drive</i></span>) and its locationrelative to the underlying hardware. It is given the symbolic name <spanclass="emphasis"><i class="EMPHASIS">a</i></span>. This separation of the symbolic namesfrom the device names allows disks to be moved from one location to another withoutconfusion.</p></li><li><p>The <span class="emphasis"><i class="EMPHASIS">volume</i></span> line describes avolume. The only required attribute is the name, in this case <span class="emphasis"><iclass="EMPHASIS">myvol</i></span>.</p></li><li><p>The <span class="emphasis"><i class="EMPHASIS">plex</i></span> line defines a plex.The only required parameter is the organization, in this case <span class="emphasis"><iclass="EMPHASIS">concat</i></span>. No name is necessary: the system automaticallygenerates a name from the volume name by adding the suffix <span class="emphasis"><iclass="EMPHASIS">.p</i></span><span class="emphasis"><i class="EMPHASIS">x</i></span>,where <span class="emphasis"><i class="EMPHASIS">x</i></span> is the number of the plexin the volume. Thus this plex will be called <span class="emphasis"><iclass="EMPHASIS">myvol.p0</i></span>.</p></li><li><p>The <span class="emphasis"><i class="EMPHASIS">sd</i></span> line describes a subdisk.The minimum specifications are the name of a drive on which to store it, and the lengthof the subdisk. As with plexes, no name is necessary: the system automatically assignsnames derived from the plex name by adding the suffix <span class="emphasis"><iclass="EMPHASIS">.s</i></span><span class="emphasis"><i class="EMPHASIS">x</i></span>,where <span class="emphasis"><i class="EMPHASIS">x</i></span> is the number of thesubdisk in the plex. Thus Vinum gives this subdisk the name <span class="emphasis"><iclass="EMPHASIS">myvol.p0.s0</i></span>.</p></li></ul><p>After processing this file, <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">vinum</span>(8)</span> produces the following output:</p><pre class="PROGRAMLISTING">      <samp class="PROMPT">#</samp> vinum -&gt; <tt class="COMMAND">create config1</tt>      Configuration summary      Drives:         1 (4 configured)      Volumes:        1 (4 configured)      Plexes:         1 (8 configured)      Subdisks:       1 (16 configured)         D a                     State: up       Device /dev/da3h        Avail: 2061/2573 MB (80%)        V myvol                 State: up       Plexes:       1 Size:        512 MB        P myvol.p0            C State: up       Subdisks:     1 Size:        512 MB        S myvol.p0.s0           State: up       PO:        0  B Size:        512 MB</pre><p>This output shows the brief listing format of <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">vinum</span>(8)</span>. It is represented graphically in <ahref="vinum-examples.html#VINUM-SIMPLE-VOL">Figure 13-4</a>.</p><p></p><div class="FIGURE"><a id="VINUM-SIMPLE-VOL" name="VINUM-SIMPLE-VOL"></a><p><b>Figure 13-4. A Simple Vinum Volume</b></p><p><img src="vinum/vinum-simple-vol.png" /></p></div><br /><br /><p>This figure, and the ones which follow, represent a volume, which contains the plexes,which in turn contain the subdisks. In this trivial example, the volume contains oneplex, and the plex contains one subdisk.</p><p>This particular volume has no specific advantage over a conventional disk partition.It contains a single plex, so it is not redundant. The plex contains a single subdisk, sothere is no difference in storage allocation from a conventional disk partition. Thefollowing sections illustrate various more interesting configuration methods.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN19013" name="AEN19013">13.6.2. Increased Resilience:Mirroring</a></h2><p>The resilience of a volume can be increased by mirroring. When laying out a mirroredvolume, it is important to ensure that the subdisks of each plex are on different drives,so that a drive failure will not take down both plexes. The following configurationmirrors a volume:</p><pre class="PROGRAMLISTING">   drive b device /dev/da4h    volume mirror      plex org concat        sd length 512m drive a      plex org concat        sd length 512m drive b</pre><p>In this example, it was not necessary to specify a definition of drive <spanclass="emphasis"><i class="EMPHASIS">a</i></span> again, since Vinum keeps track of allobjects in its configuration database. After processing this definition, theconfiguration looks like:</p><pre class="PROGRAMLISTING">   Drives:         2 (4 configured)    Volumes:        2 (4 configured)    Plexes:         3 (8 configured)    Subdisks:       3 (16 configured)        D a                     State: up       Device /dev/da3h        Avail: 1549/2573 MB (60%)    D b                     State: up       Device /dev/da4h        Avail: 2061/2573 MB (80%)    V myvol                 State: up       Plexes:       1 Size:        512 MB    V mirror                State: up       Plexes:       2 Size:        512 MB      P myvol.p0            C State: up       Subdisks:     1 Size:        512 MB    P mirror.p0           C State: up       Subdisks:     1 Size:        512 MB    P mirror.p1           C State: initializing     Subdisks:     1 Size:        512 MB      S myvol.p0.s0           State: up       PO:        0  B Size:        512 MB    S mirror.p0.s0          State: up       PO:        0  B Size:        512 MB    S mirror.p1.s0          State: empty    PO:        0  B Size:        512 MB</pre><p><a href="vinum-examples.html#VINUM-MIRRORED-VOL">Figure 13-5</a> shows the structuregraphically.</p><p></p><div class="FIGURE"><a id="VINUM-MIRRORED-VOL" name="VINUM-MIRRORED-VOL"></a><p><b>Figure 13-5. A Mirrored Vinum Volume</b></p><p><img src="vinum/vinum-mirrored-vol.png" /></p></div><br /><br /><p>In this example, each plex contains the full 512&nbsp;MB of address space. As in theprevious example, each plex contains only a single subdisk.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN19027" name="AEN19027">13.6.3. OptimizingPerformance</a></h2><p>The mirrored volume in the previous example is more resistant to failure than anunmirrored volume, but its performance is less: each write to the volume requires a writeto both drives, using up a greater proportion of the total disk bandwidth. Performanceconsiderations demand a different approach: instead of mirroring, the data is stripedacross as many disk drives as possible. The following configuration shows a volume with aplex striped across four disk drives:</p><pre class="PROGRAMLISTING">   drive c device /dev/da5h    drive d device /dev/da6h    volume stripe    plex org striped 512k      sd length 128m drive a      sd length 128m drive b      sd length 128m drive c      sd length 128m drive d</pre><p>As before, it is not necessary to define the drives which are already known to Vinum.After processing this definition, the configuration looks like:</p><pre class="PROGRAMLISTING">   Drives:         4 (4 configured)    Volumes:        3 (4 configured)    Plexes:         4 (8 configured)    Subdisks:       7 (16 configured)      D a                     State: up       Device /dev/da3h        Avail: 1421/2573 MB (55%)    D b                     State: up       Device /dev/da4h        Avail: 1933/2573 MB (75%)    D c                     State: up       Device /dev/da5h        Avail: 2445/2573 MB (95%)    D d                     State: up       Device /dev/da6h        Avail: 2445/2573 MB (95%)      V myvol                 State: up       Plexes:       1 Size:        512 MB    V mirror                State: up       Plexes:       2 Size:        512 MB    V striped               State: up       Plexes:       1 Size:        512 MB      P myvol.p0            C State: up       Subdisks:     1 Size:        512 MB    P mirror.p0           C State: up       Subdisks:     1 Size:        512 MB    P mirror.p1           C State: initializing     Subdisks:     1 Size:        512 MB    P striped.p1            State: up       Subdisks:     1 Size:        512 MB      S myvol.p0.s0           State: up       PO:        0  B Size:        512 MB    S mirror.p0.s0          State: up       PO:        0  B Size:        512 MB    S mirror.p1.s0          State: empty    PO:        0  B Size:        512 MB    S striped.p0.s0         State: up       PO:        0  B Size:        128 MB    S striped.p0.s1         State: up       PO:      512 kB Size:        128 MB    S striped.p0.s2         State: up       PO:     1024 kB Size:        128 MB    S striped.p0.s3         State: up       PO:     1536 kB Size:        128 MB</pre><p></p><div class="FIGURE"><a id="VINUM-STRIPED-VOL" name="VINUM-STRIPED-VOL"></a><p><b>Figure 13-6. A Striped Vinum Volume</b></p><p><img src="vinum/vinum-striped-vol.png" /></p></div><br /><br /><p>This volume is represented in <a href="vinum-examples.html#VINUM-STRIPED-VOL">Figure13-6</a>. The darkness of the stripes indicates the position within the plex addressspace: the lightest stripes come first, the darkest last.</p></div><div class="SECT2"><h2 class="SECT2"><a id="AEN19039" name="AEN19039">13.6.4. Resilience andPerformance</a></h2><p><a id="VINUM-RESILIENCE" name="VINUM-RESILIENCE"></a>With sufficient hardware, it ispossible to build volumes which show both increased resilience and increased performancecompared to standard <span class="TRADEMARK">UNIX</span>&reg; partitions. A typicalconfiguration file might be:</p><pre class="PROGRAMLISTING">   volume raid10      plex org striped 512k        sd length 102480k drive a        sd length 102480k drive b        sd length 102480k drive c        sd length 102480k drive d        sd length 102480k drive e      plex org striped 512k        sd length 102480k drive c        sd length 102480k drive d        sd length 102480k drive e        sd length 102480k drive a        sd length 102480k drive b</pre><p>The subdisks of the second plex are offset by two drives from those of the first plex:this helps ensure that writes do not go to the same subdisks even if a transfer goes overtwo drives.</p><p><a href="vinum-examples.html#VINUM-RAID10-VOL">Figure 13-7</a> represents thestructure of this volume.</p><p></p><div class="FIGURE"><a id="VINUM-RAID10-VOL" name="VINUM-RAID10-VOL"></a><p><b>Figure 13-7. A Mirrored, Striped Vinum Volume</b></p><p><img src="vinum/vinum-raid10-vol.png" /></p></div><br /><br /></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="vinum-objects.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="vinum-object-naming.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Vinum Objects</td><td width="34%" align="center" valign="top"><a href="vinum-vinum.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Object Naming</td></tr></table></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -