Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.
Hello All,
I am still trying to enable the out-of-sync handler,
such that online device verification executed from a
cron job will notify an administrator if any blocks are
found to be out of sync.
So far I have been unsuccessful: online device
verification, whether run from the command line
manually, or from cron, does not trigger my handler.
I have followed the example described in
http://git.drbd.org/?p=drbd-8.2.git;a=blob;f=scripts/drbd.conf
My full configuration is reproduced below, along with my
handler script and log output from "drbdadm verify".
I have ensured that my handler script works as expected
when invoked directly on the command line. I have also
tried using a simple inline script for my out-of-sync
handler (e.g., "echo test | mail root"), with the same
results: my handler is never invoked.
So my questions at this point are:
1. Am I making any obvious mistakes or omissions in my
configuration?
2. Is there any documentation for the out-of-sync handler
beyond the example configuration cited above?
3. Has anyone else successfully enabled this handler?
4. Is there a way to increase log output regarding the
invocation of this handler, so that I can better determine
exactly why it is not running?
I am using CentOS-4.6, drbd-8.2.5, kernel 2.6.9-67.0.7.EL.
My configuration is as follows:
---------------------------------------------------
global { usage-count yes; }
common {
startup {
wfc-timeout 20;
degr-wfc-timeout 20;
}
}
resource spare {
protocol C;
syncer {
rate 100M;
verify-alg sha1;
}
net {
cram-hmac-alg sha1;
shared-secret "foo";
}
handlers {
out-of-sync "/opt/drbd/handlers/out-of-sync.sh $DRBD_RESOURCE";
}
disk {
size 1703936K;
on-io-error pass_on;
}
on host1 {
device /dev/drbd0;
disk /dev/VolGroup00/LogVol09;
address 172.21.103.1:7788;
meta-disk internal;
}
on host2 {
device /dev/drbd0;
disk /dev/VolGroup00/LogVol07;
address 172.21.103.2:7788;
meta-disk internal;
}
}
-------------------------------------------------------------------
Running the command "drbdadm verify spare" on host1 produces
this output in /var/log/messages (is the "helper command"
supposed to be my handler?):
drbd0: conn( Connected -> VerifyS )
drbd0: Out of sync: start=0, size=16 (sectors)
drbd0: Out of sync: start=840, size=24 (sectors)
drbd0: Out of sync: start=4952, size=8 (sectors)
drbd0: Out of sync: start=5000, size=96 (sectors)
drbd0: Out of sync: start=70616, size=8 (sectors)
drbd0: Online verify done (total 39 sec; paused 0 sec; 43688K/sec)
drbd0: Online verify found 19 4k block out of sync!
drbd0: helper command: /sbin/drbdadm out-of-sync
drbd0: Writing the whole bitmap.
drbd0: writing of bitmap took 2 jiffies
drbd0: 76 KB (19 bits) marked out-of-sync by on disk bit-map.
drbd0: conn( VerifyS -> Connected )
_______________________________________________
My handler script is as follows:
#!/bin/bash
admin_address="root"
subject="Alert: Out-of-sync drbd resource found."
alert="
Found out-of-sync drbd resource $1 on $HOSTNAME.
To re-synchronize, run:\n
\n
# drbdadm disconnect $1\n
# drbdadm connect $1\n
"
/bin/echo -e "$alert" | /bin/mail -s "$subject" "$admin_address"
_______________________________________________
Thank you,
Jeffrey