Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DRBD: Users

DRBD Diskless with LVM

 

 

DRBD users RSS feed   Index | Next | Previous | View Threaded


m.verhaeg at opentsp

Sep 20, 2011, 11:38 PM

Post #1 of 5 (1156 views)
Permalink
DRBD Diskless with LVM

Because only a couple of our colleagues really know the ins and outs of DRBD
we are setting up a test environment which serves to learn how DRBD works
and how to configure it. We are using the latest version of the DRBD user's
guide (http://www.drbd.org/users-guide/) as a guideline for the
configuration.

The configuration file for R0 looks like this:
resource r0 {
on venvmdrbd001 {
device /dev/drbd0;
disk /dev/sdb1;
address 192.168.5.1:7789;
meta-disk internal;
}
on venvmdrbd002 {
device /dev/drbd0;
disk /dev/sdb1;
address 192.168.5.2:7789;
meta-disk internal;
}
}
We are using sdb1 for the resource. This is working fine:
0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r-----
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0

Because we are using LVM in our production environment we tried to setup
DRBD over LVM, this would mean the following configuration file should be
okay:
resource r1 {
on venvmdrbd001 {
device /dev/drbd1;
disk /dev/r1vg/r1lv;
address 192.168.5.1:7790;
meta-disk internal;
}
on venvmdrbd002 {
device /dev/drbd1;
disk /dev/r1vg/r1lv;
address 192.168.5.2:7790;
meta-disk internal;
}
}
We compared this configuration file to the (working) configuration file in
production. We also compared the LVM configuration, this should be okay. The
problem we are having is:
1: cs:Connected ro:Secondary/Secondary ds:Diskless/Diskless C r-----
ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0
Both nodes are in the Diskless state.

We are also seeing this message in the /var/log/messages file for drbd1:
Sep 20 09:02:38 venvmdrbd001 kernel: block drbd1: Barriers not supported on
meta data device - disabling
Sep 20 09:02:38 venvmdrbd001 kernel: block drbd1:
drbd_md_sync_page_io(,16449528s,WRITE) failed!
Sep 20 09:02:38 venvmdrbd001 kernel: block drbd1: meta data update failed!
Sep 20 09:02:38 venvmdrbd001 kernel: block drbd1: disk( Inconsistent ->
Failed )
Sep 20 09:02:38 venvmdrbd001 kernel: block drbd1: Local IO failed in
drbd_md_sync. Detaching...
Sep 20 09:02:38 venvmdrbd001 kernel: block drbd1: disk( Failed -> Diskless )

[root [at] venvmdrbd00 drbd.d]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 12.91G
LogVol01 VolGroup00 -wi-ao 1.97G
r1lv r1vg -wi-a- 7.84G
[root [at] venvmdrbd00 drbd.d]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 VolGroup00 lvm2 a- 14.88G 0
/dev/sdb2 r1vg lvm2 a- 7.84G 0


Differences between the systems you used in the course and our new systems:
Course Systems:
• Kernel: 2.6.18-194.8.1.el5
• drbd-udev-8.3.8.1-1
• drbd-xen-8.3.8.1-1
• drbd-km-2.6.18_194.8.1.el5-8.3.8.1-1
• drbd-pacemaker-8.3.8.1-1
• drbd-heartbeat-8.3.8.1-1
• drbd-utils-8.3.8.1-1
• drbd-8.3.8.1-1
• drbd-bash-completion-8.3.8.1-1
New test systems:
• Kernel: 2.6.18-238.19.1.el5
• drbd-bash-completion-8.4.0-1
• drbd-udev-8.4.0-1
• drbd-xen-8.4.0-1
• drbd-heartbeat-8.4.0-1
• drbd-pacemaker-8.4.0-1
• drbd-8.4.0-1
• drbd-utils-8.4.0-1
• drbd-km-2.6.18_238.19.1.el5-8.4.0-1

We have checked the configuration of the course systems and compared those
to the test systems. We couldn’t find a difference (except from the expected
version differences). Our DRBD specialist couldn’t find out what the problem
with the test setup is. Logically the problem should be in the combination
LVM – DRBD (the resource without LVM is working fine). Are there known
problems in the area with the versions we are using?

Could you help us with this issue? If you need more information, don’t
hesitate to ask. Thank you for your

Kind regards,

Mario Verhaeg

--
View this message in context: http://old.nabble.com/DRBD-Diskless-with-LVM-tp32503717p32503717.html
Sent from the DRBD - User mailing list archive at Nabble.com.

_______________________________________________
drbd-user mailing list
drbd-user [at] lists
http://lists.linbit.com/mailman/listinfo/drbd-user


m.verhaeg at opentsp

Dec 6, 2011, 11:03 PM

Post #2 of 5 (962 views)
Permalink
Re: DRBD Diskless with LVM [In reply to]

Hi mickaelFr,

We didn't resolve the problem on that particular system. However, I've
created a new (CentOS 6 / DRBD 8.4) test setup with LVM and this is working
fine.

Kind regards,

Mario Verhaeg
--
View this message in context: http://old.nabble.com/DRBD-Diskless-with-LVM-tp32503717p32926958.html
Sent from the DRBD - User mailing list archive at Nabble.com.

_______________________________________________
drbd-user mailing list
drbd-user [at] lists
http://lists.linbit.com/mailman/listinfo/drbd-user


mickael.terrien at alcatel-lucent

Dec 7, 2011, 12:52 AM

Post #3 of 5 (971 views)
Permalink
Re: DRBD Diskless with LVM [In reply to]

Hi Mario,

As my configuration is RHEL6 / DRBD8.4, I understand that this DRBD release
doesn't support LVM with RHEL6 (or I have a bad use of it) even if RHEL6 and
CentOS6 have very close implementation.

What is the workaround in this case as I can't use LVM and must keep RHEL6 ?
I only want to replicate my database directory (active/passive) which sould
have been the logical volume and not the full disk.

Regards,
Mickael


marioverhaeg wrote:
>
> Hi mickaelFr,
>
> We didn't resolve the problem on that particular system. However, I've
> created a new (CentOS 6 / DRBD 8.4) test setup with LVM and this is
> working fine.
>
> Kind regards,
>
> Mario Verhaeg
>

--
View this message in context: http://old.nabble.com/DRBD-Diskless-with-LVM-tp32503717p32927799.html
Sent from the DRBD - User mailing list archive at Nabble.com.

_______________________________________________
drbd-user mailing list
drbd-user [at] lists
http://lists.linbit.com/mailman/listinfo/drbd-user


lars.ellenberg at linbit

Dec 7, 2011, 7:46 AM

Post #4 of 5 (964 views)
Permalink
Re: DRBD Diskless with LVM [In reply to]

On Wed, Dec 07, 2011 at 12:52:03AM -0800, mickaelFr wrote:
>
> Hi Mario,
>
> As my configuration is RHEL6 / DRBD8.4, I understand that this DRBD release
> doesn't support LVM with RHEL6 (or I have a bad use of it) even if RHEL6 and
> CentOS6 have very close implementation.
>
> What is the workaround

Workaround:
in drbd.conf, say
no-disk-drain, no-disk-flushes, no-md-flushes.
does not work in that setup, anyways,
that's where the "IO error" comes from.
Fix:
http://git.drbd.org/gitweb.cgi?p=drbd-8.4.git;a=commitdiff;h=c4956f2

which will catch the IO error, implicitly set the things given
as work around above, and retry with those flags disabled.

Though I recommend to stay away from 8.4.0 in production for now,
at least if you use its main feature (multiple volumes per connection),
it shows some serious misbehavior still.

Once 8.4.1 is released, that may be better,
but even what is tagged as 8.4.1rc1 is known to be broken.

> in this case as I can't use LVM and must keep RHEL6 ?
> I only want to replicate my database directory (active/passive) which sould
> have been the logical volume and not the full disk.

Go with 8.3.12 please.

--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com
_______________________________________________
drbd-user mailing list
drbd-user [at] lists
http://lists.linbit.com/mailman/listinfo/drbd-user


mickael.terrien at alcatel-lucent

Dec 9, 2011, 6:09 AM

Post #5 of 5 (914 views)
Permalink
Re: DRBD Diskless with LVM [In reply to]

Now my configuration with one logical volume (active/passive) works with
8.3.11 on rhel6.

With a mydata.res file like this one:

resource mydata {
protocol C;
disk {
on-io-error detach;
}
on hamain.mydomain.com {
device /dev/drbd0;
disk /dev/vg_rhel6/lv_data;
meta-disk internal;
address 172.27.134.88:7788;
}
on haslave.mydomain.com {
device /dev/drbd0;
disk /dev/vg_rhel6/lv_data;
meta-disk internal;
address 172.27.134.90:7788;
}
}

There's a main step I had forgotten before running the "drbdadm create-md"
command which is:

- umount the lv partition so on my side /dev/vg_rhel6/lv_data

Then to anticipate below error running "drbdadm create-md" too:


md_offset 55372546048
al_offset 55372513280
bm_offset 55370821632

Found ext3 filesystem which uses 54074756 kB
current configuration leaves usable 54073068 kB

Device size would be truncated, which
would corrupt data and result in
'access beyond end of device' errors.
You need to either
* use external meta data (recommended)
* shrink that filesystem first
* zero out the device (destroy the filesystem)
Operation refused.

Command 'drbdmeta /dev/drbd0 v08 /dev/sda10 internal create-md' terminated
with exit code 40
drbdadm aborting


I have run this command on the lv:

- dd if=/dev/zero bs=1M count=1 of=/dev/vg_rhel6/lv_data

Finally, to anticipate another error message "Failed to create file in
/var/lib/drbd", I created the directory with rights:

- mkdir /var/lib/drbd
- chmod on it

Then run the command:

- modprobe drbd
- drbdadm create-md r0

That's ok.
--
View this message in context: http://old.nabble.com/DRBD-Diskless-with-LVM-tp32503717p32941735.html
Sent from the DRBD - User mailing list archive at Nabble.com.

_______________________________________________
drbd-user mailing list
drbd-user [at] lists
http://lists.linbit.com/mailman/listinfo/drbd-user

DRBD users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.