Centos5: OCFS2 cluster FS on dual primary DRBD: part 1 – prepare LVM on RAID1

A while ago I promised to you ( and myself) to publish the instruction on how to setup OCFS2 cluster fs for 2 nodes over DRBD dual primary configuration. Now it’s time.
I am going to split it over multiple posts to cover as many details as possible.
This is part 1 – laying the foundation – LVM over RAID1 setup.

Prerequisites: 2 Centos5 servers with identical disk configuration
Time: up to 30 minuts (depends on shared disk size and network speed)
Skill level required: Advanced (means you understand the difference between apache and kernel modules and not afraid of command line – this is called advanced nowdays).

To start we will be configuring DRBD on top of LVM which is configured on top of RAID1. The reasons are – LVM means scalability, so some time down the line we can add more PVs to expand the configured disk. RAID1 – reliability with slight performance improvement on read.
On both servers node1 and node2 we have /dev/md5 – identical raid1 arrays. For simplicity sake we will create 1 logical volume shared that takes 100% of space on volume group vg0
1. Creating physical volume
[cc lang=”bash” width=”100%”]
# >
pvcreate /dev/md5
# >
pvdisplay
— Physical volume —
PV Name /dev/md5
VG Name vg0
PV Size 892.35 GB / not usable 3.38 MB
Allocatable yes (but full)
PE Size (KByte) 4096
Total PE 228441
Free PE 0
Allocated PE 228441
PV UUID sMWW6Z-5aIJ-hSuq-kvpn-jCgT-rT2A-UCwOFD
[/cc]
2. Creating volume group vg0 on this physical volume
[cc lang=”bash” width=”100%”]
#>
vgcreate vg0 /dev/md5
#>
vgdisplay
— Volume group —
VG Name vg0
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 892.35 GB
PE Size 4.00 MB
Total PE 228441
Alloc PE / Size 228441 / 892.35 GB
Free PE / Size 0 / 0
VG UUID uCDZhY-igFW-2DLb-XOOM-IUqT-Zfox-VdtKjA
[/cc]
3. Creating logical volume shared on volume group vg0
[cc lang=”bash” width=”100%”]
#>
lvcreate -l100%VG -nshared vg0
#>
lvdisplay

— Logical volume —
LV Name /dev/vg0/shared
VG Name vg0
LV UUID 2OZACr-UCLV-iLUg-cWdG-vZS6-sXyX-d9dq3T
LV Write Access read/write
LV Status available
# open 2
LV Size 892.35 GB
Current LE 228441
Segments 1
Allocation inherit
Read ahead sectors auto
– currently set to 256
Block device 253:0
[/cc]

All done for now.
Please stay tuned for the next articles in this series – I intended to finish the instructions with working dual node OCFS2 cluster setup.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">