heartbeat incompatible with drbd8-utils in jaunty

Bug #369124 reported by Duncan Sands
2
Affects Status Importance Assigned to Milestone
heartbeat (Ubuntu)
Won't Fix
Undecided
Registry Administrators

Bug Description

Binary package hint: heartbeat

The version of drbd shipped with jaunty now outputs a warning when using "state" with drbdadm:
  'drbdadm state' is deprecated, use 'drbdadm role' instead.
Unfortunately when heartbeat sees this warning it thinks drbdadm has failed.
The result is that heartbeat cannot be used with drbd in jaunty.
There is a discussion on the heartbeat users list:
http://www.gossamer-threads.com/lists/linuxha/users/54352

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hello there. Are you using Heartbeat V1 or V2 config style? Would you mind providing and step by step to reproduce this bug please?

Changed in heartbeat (Ubuntu):
assignee: nobody → ubuntu-ha
status: New → Incomplete
Revision history for this message
Duncan Sands (baldrick-free) wrote :

This is V2 (crm) style, set up following http://www.drbd.org/docs/about (Part IV, “DRBD-enabled applications”,
section "Using DRBD in Heartbeat CRM-enabled clusters"). It's one drbd disk, and heartbeat simply mounts it.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

So you are setting up MySQL with DRBD. I'll try to reproduce this. However, I've used this setup, and worked ok. Would you mind modying it so it looks similar? I think you'll only need to add the <operations> tag:

 <primitive class="ocf" id="drbd" provider="heartbeat" type="Filesystem">
    <operations>
       <op id="drbd_mon" interval="120s" name="monitor" timeout="60s"/>
    </operations>
    <instance_attributes id="drbd_inst_attr">
       <attributes>
           <nvpair id="drbd_attr_0" name="device" value="/dev/drbd0"/>
           <nvpair id="drbd_attr_1" name="directory" value="/data"/>
           <nvpair id="drbd_attr_2" name="fstype" value="ext3"/>
       </attributes>
    </instance_attributes>
 </primitive>

Revision history for this message
Duncan Sands (baldrick-free) wrote : Re: [Bug 369124] Re: heartbeat incompatible with drbd8-utils in jaunty

Hi Andres,

> So you are setting up MySQL with DRBD.

the service I'm starting is not mysql, but otherwise it is essentially
the same. Since the drbd disk isn't even considered for mounting, due
to error output from drdbadm, it probably doesn't matter what service
is started.

> I'll try to reproduce this.
> However, I've used this setup, and worked ok. Would you mind modying it
> so it looks similar? I think you'll only need to add the <operations>
> tag:
>
> <primitive class="ocf" id="drbd" provider="heartbeat" type="Filesystem">
> <operations>
> <op id="drbd_mon" interval="120s" name="monitor" timeout="60s"/>
> </operations>
> <instance_attributes id="drbd_inst_attr">
> <attributes>
> <nvpair id="drbd_attr_0" name="device" value="/dev/drbd0"/>
> <nvpair id="drbd_attr_1" name="directory" value="/data"/>
> <nvpair id="drbd_attr_2" name="fstype" value="ext3"/>
> </attributes>
> </instance_attributes>
> </primitive>

Thanks, I will experiment with it next week sometime.

Ciao,

Duncan.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Well the first thing to do, is to bring up DRBD and then mount it. So you need something like this first:

               <primitive class="heartbeat" id="drbd_disk" provider="heartbeat" type="drbddisk">
                    <operations>
                        <op id="drbd_disk_mon" interval="120s" name="monitor" timeout="60s"/>
                    </operations>
                    <instance_attributes id="drbd_disk_inst_attr">
                        <attributes>
                            <nvpair id="drbd_disk_attr_1" name="1" value="stacked-resource"/>
                        </attributes>
                    </instance_attributes>
                </primitive>

And after this, you use what I've posted above.

Revision history for this message
Duncan Sands (baldrick-free) wrote :

Hi, I am now trying to come up with a simple recipe that
will enable you to reproduce the problem. However, let
me just point out that the current jaunty heartbeat sources
has

./resources/OCF/drbd: DRBD_STATE=$(do_drbdadm state $RESOURCE)

which results in the mentioned problematic output using jaunty drbdadm:

$ sudo drbdadm state r0
'drbdadm state' is deprecated, use 'drbdadm role' instead.
Primary/Unknown

For the heartbeat developers it seems that the tricky question
is how to use "state" or "role" depending on the installed drbd
version.

Ciao,

Duncan.

Revision history for this message
Duncan Sands (baldrick-free) wrote :
Download full text (3.9 KiB)

OK, here is a recipe to see this problem. I hope all the
steps are here!

(0) Install drbd8-utils and heartbeat.
(1) Create a fake disk
dd if=/dev/zero of=drbd_disk count=1M bs=1
losetup /dev/loop0 ./drbd_disk
(2) Create /etc/drbd.conf. I used:

global {
  usage-count yes;
}
common {
  protocol C;
}
resource r0 {
  device /dev/drbd0;
  meta-disk internal;

  on maisy {
    disk /dev/loop0;
    address 192.168.0.4:7788;
  }
  on hazy {
    disk /dev/loop0;
    address 192.168.0.5:7788;
  }
}

(3) Create the drbd disk:
drbdadm create-md r0
modprobe drbd
drbdadm attach r0
drbdadm syncer r0
drbdadm connect r0
mkfs.ext3 /dev/drbd0

(4) Turned off drbd: /etc/init.d/drbd stop
Stopped the drbd init script from running at startup (to avoid clashes
with heartbeat):
update-rc.d -f drbd remove

(5) Created /etc/ha.d/ha.cf, contents:

autojoin none
mcast eth2 239.0.0.43 694 1 0
warntime 5
deadtime 15
initdead 60
keepalive 2
node maisy
node hazy
crm yes

(6) Created an appropriate /etc/ha.d/authkeys file.

(7) Set up resources and constraints:

cibadmin -o resources -C -x resources.xml
cibadmin -o constraints -C -x constraints.xml

where these files contain:
resources.xml:

<resources>
  <master_slave id="ms_drbd_files">
    <meta_attributes id="ms_drbd_files-meta_attributes">
      <attributes>
        <nvpair name="notify" value="yes" id="ms_drbd_files-meta_attributes-notify"/>
        <nvpair name="globally_unique" value="false" id="ms_drbd_files-meta_attributes-globally_unique"/>
      </attributes>
    </meta_attributes>
    <primitive id="drbd_files" class="ocf" provider="heartbeat" type="drbd">
      <instance_attributes id="ms_drbd_files-instance_attributes">
        <attributes>
          <nvpair name="drbd_resource" value="r0" id="ms_drbd_files-instance_attributes-drbd_resource"/>
        </attributes>
      </instance_attributes>
      <operations>
        <op id="ms_drbd_files-monitor-master" name="monitor" interval="29s" timeout="10s" role="Master"/>
        <op id="ms_drbd_files-monitor-slave" name="monitor" interval="30s" timeout="10s" role="Slave"/>
      </operations>
    </primitive>
  </master_slave>
  <group id="rg_files">
    <primitive class="ocf" type="Filesystem" provider="heartbeat" id="mount_data">
      <instance_attributes id="mount_data-instance_attributes">
        <attributes>
          <nvpair name="device" value="/dev/drbd0" id="mount_data-device"/>
          <nvpair name="directory" value="/mnt" id="mount_data-directory"/>
          <nvpair name="fstype" value="ext3" id="mount_data-fstype"/>
        </attributes>
      </instance_attributes>
    </primitive>
  </group>
</resources>

constraints.xml:

<constraints>
  <rsc_order id="files_after_drbd" from="rg_files" action="start" to="ms_drbd_files" to_action="promote" type="after"/>
  <rsc_colocation id="files_on_drbd" to="ms_drbd_files" to_role="master" from="rg_files" score="infinity"/>
</constraints>

(8) Started heartbeat: /etc/init.d/heartbeat start

(9) Observed the following failure in the system logs:

May 4 15:09:11 maisy lrmd: [4150]: info: RA output: (drbd_files:0:start:stdout)
May 4 15:09:11 maisy drbd[4491]: [4549]: DEBUG: r0 start: Module loaded.
May 4...

Read more...

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Thank you for reporting bugs and trying to make Ubuntu better!

Given that Ubuntu Jaunty 9.04 has hit it's End of Life (EOL), I'm closing this bug report. For more information about the EOL please refer to [1].

[1]: https://wiki.ubuntu.com/Releases

Changed in heartbeat (Ubuntu):
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.