Difference between revisions of "DRBD on Fedora 13"

From AN!Wiki
Jump to: navigation, search
(Created page with '{{howto_header}} '''Warning''': Until this warning is removed, do not use or trust this document. When complete and tested, this warning will be removed. This article covers in…')
 
(Configure)
Line 36: Line 36:
 
</source>
 
</source>
 
<source lang="text">
 
<source lang="text">
   PV /dev/sda2  VG an-lvm01   lvm2 [465.50 GB / 443.97 GB free]
+
   PV /dev/sda2  VG vg01   lvm2 [465.50 GiB / 424.44 GiB free]
   Total: 1 [465.50 GB] / in use: 1 [465.50 GB] / in no VG: 0 [0  ]
+
   Total: 1 [465.50 GiB] / in use: 1 [465.50 GiB] / in no VG: 0 [0  ]
 
</source>
 
</source>
  
Line 48: Line 48:
 
</source>
 
</source>
 
<source lang="text">
 
<source lang="text">
   ACTIVE            '/dev/an-lvm01/lv01' [19.53 GB] inherit
+
   ACTIVE            '/dev/vg01/lv_root' [39.06 GiB] inherit
   ACTIVE            '/dev/an-lvm01/lv00' [2.00 GB] inherit
+
   ACTIVE            '/dev/vg01/lv_swap' [2.00 GiB] inherit
 
</source>
 
</source>
  
We see from the above output that <span class="code">lv00</span> and <span class="code">lv01</span> are used, so we will use <span class="code">lv02</span> for the DRBD partition. Of course, you can use <span class="code">drbd</span> or pretty much anything else you want.
+
We see from the above output that <span class="code">lv_root</span> and <span class="code">lv_swap</span> are used, so we will use <span class="code">lv_drbd</span> for the DRBD partition. Of course, you can use pretty much any name you want.
  
Now that we know that we want to create a 400GB logical volume called <span class="code">lv02</span>, we can proceed.
+
Now that we know that we want to create a 400GB logical volume called <span class="code">lv_drbd</span>, we can proceed.
  
 
Now to create the logical volume for the DRBD device on each node. The next two commands show what I need to call on my nodes. If you've used different names of have a different amount of free space, be sure to edit the following arguments to match your nodes.
 
Now to create the logical volume for the DRBD device on each node. The next two commands show what I need to call on my nodes. If you've used different names of have a different amount of free space, be sure to edit the following arguments to match your nodes.
Line 60: Line 60:
 
On <span class="code">an-node01</span>:
 
On <span class="code">an-node01</span>:
 
<source lang="bash">
 
<source lang="bash">
lvcreate -L 400G -n lv02 /dev/an-lvm01
+
lvcreate -L 400G -n lv_drbd /dev/vg01
</source>
+
 
+
On <span class="code">an-node02</span>:
+
<source lang="bash">
+
lvcreate -L 400G -n lv02 /dev/an-lvm02
+
 
</source>
 
</source>
 
<source lang="text">
 
<source lang="text">
   Logical volume "lv02" created
+
   Logical volume "lv_drbd" created
 
</source>
 
</source>
  
Line 77: Line 72:
 
</source>
 
</source>
 
<source lang="text">
 
<source lang="text">
   ACTIVE            '/dev/an-lvm01/lv01' [19.53 GB] inherit
+
   ACTIVE            '/dev/vg01/lv_root' [39.06 GiB] inherit
   ACTIVE            '/dev/an-lvm01/lv00' [2.00 GB] inherit
+
   ACTIVE            '/dev/vg01/lv_swap' [2.00 GiB] inherit
   ACTIVE            '/dev/an-lvm01/lv02' [400.00 GB] inherit
+
   ACTIVE            '/dev/vg01/lv_drbd' [400.00 GiB] inherit
 
</source>
 
</source>
  

Revision as of 19:04, 24 August 2010

 AN!Wiki :: How To :: DRBD on Fedora 13

Warning: Until this warning is removed, do not use or trust this document. When complete and tested, this warning will be removed.

This article covers installing and configuring DRBD on a two-node Fedora 13 cluster.

Contents

Why DRBD?

DRBD is useful in small clusters as it provides real-time mirroring of data across two (or more) nodes. In two-node clusters, this can be used to host clustered LVM physical volumes. On these volumes you can create logical volumes to host GFS2 partitions, virtual machines, iSCSI and so forth.

Install

yum -y install drbd.x86_64 drbd-xen.x86_64

If You're Running Xen From Mercurial

The above RPM installs will drag in the Xen 3.4.3 hypervisor and tools. To get back to the Xen 4.0.0 tools, rerun the make install-*.

Note: Change to the directory where you checked out the git repo.

cd xen-4.0-testing.hg
make install-xen
make install-tools
make install-stubdom

Configure

We need to see how much space you have left on you LVM PV. The pvscan tool will show you this.

pvscan
  PV /dev/sda2   VG vg01   lvm2 [465.50 GiB / 424.44 GiB free]
  Total: 1 [465.50 GiB] / in use: 1 [465.50 GiB] / in no VG: 0 [0   ]

On my nodes, each of which has a single 500GB drive, I've allocated only 20GB to dom0 so I've got over 440GB left free. I like to leave a bit of space unallocated because I never know where I might need it, so I will allocate 400GB even to DRBD and keep the remaining 44GB set aside for future growth. The space you have left and how you want to allocate is an exercise you must settle based on your own needs.

Next, check that the name you will give to the new LV isn't used yet. The lvscan tool will show you what names have been used.

lvscan
  ACTIVE            '/dev/vg01/lv_root' [39.06 GiB] inherit
  ACTIVE            '/dev/vg01/lv_swap' [2.00 GiB] inherit

We see from the above output that lv_root and lv_swap are used, so we will use lv_drbd for the DRBD partition. Of course, you can use pretty much any name you want.

Now that we know that we want to create a 400GB logical volume called lv_drbd, we can proceed.

Now to create the logical volume for the DRBD device on each node. The next two commands show what I need to call on my nodes. If you've used different names of have a different amount of free space, be sure to edit the following arguments to match your nodes.

On an-node01:

lvcreate -L 400G -n lv_drbd /dev/vg01
  Logical volume "lv_drbd" created

If I re-run lvscan now, I will see the new volume:

lvscan
  ACTIVE            '/dev/vg01/lv_root' [39.06 GiB] inherit
  ACTIVE            '/dev/vg01/lv_swap' [2.00 GiB] inherit
  ACTIVE            '/dev/vg01/lv_drbd' [400.00 GiB] inherit

We can now proceed with the DRBD setup!


 

Any questions, feedback, advice, complaints or meanderings are welcome.
Us: Alteeve's Niche! Support: Mailing List IRC: #clusterlabs on Freenode   © Alteeve's Niche! Inc. 1997-2019
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.
Personal tools
Namespaces

Variants
Actions
Navigation
projects
Toolbox