I'm doing my first tests with drbd.<br>My configuration is two pcs with two hdd each.<br>One drive is xenserver the second is drbd dedicated. On the drbd dedicated drive, I created /dev/sdb1 which in drbd.conf is assigned to drbd0.<br>
<br>Well, because it is a test environment, I messed up the things a bit and so I had to erase drbd0 (which still is not clear to me which is the correct procedure, but I did it) and, to be sure, I also deleted and recreated /dev/sdb1.<br>
<br>The idea was to start over with the creation of drbd0 resource.<br><br>The first issue I had was about one error that was exiting the command <i><b>drbdadm create-md drbd0</b></i>. Googleing I've found the solution was to (I'm not so strong with dd) issue this command <i><b>dd if=/dev/zero bs=1M count=1 of=/dev/sdb; sync</b></i>, looks like that first 1MB data are moved (?), anyway this worked.<br>
<br>Then <i><b>drbdadm create-md drbd0</b></i> worked again and I finished the sequence<br># drbdadm create-md drbd0 #Create device metadata<br># drbdadm attach drbd0 #Attach to backing device<br># drbdadm syncer drbd0 #Set synchronization parameters<br>
# drbdadm connect drbd0 #Connect to peer<br><br>last I launched the primary command and started the sync<br># drbdadm -- --overwrite-data-of-peer primary drbd0<br><br>and the sync worked fine, with a final average speed of 81MB/sec, in 35 minutes the 200GB volume was synced, I also copied and pasted to my notes the cat /proc/drbd command result while syncing<br>
[root@xenserver-2 dev]# cat /proc/drbd<br>version: 8.3.8.1 (api:88/proto:86-94)<br>GIT-hash: 0d8589fcc32c874df57c930ca1691399b55ec893 build by root@localhost.localdomain, 2010-07-17 10:04:02<br> 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----<br>
ns:935040 nr:0 dw:0 dr:11435392 al:0 bm:697 lo:145 pe:0 ua:145 ap:0 ep:1 wo:b oos:183876844<br> [>...................] sync'ed: 5.9% (179564/190732)M<br> finish: 0:34:18 speed: 89,308 (76,232) K/sec<br>
<br>when finished, it was late night and so I turned off the secondary, last the primary and I went at home.<br><br>Now I'm here to go on with my tests. Turned on the primary, turned on the secondary and with my big surprise, I've found this<br>
<br>[root@xenserver-2 ~]# drbd-overview<br> 0:drbd0 Unconfigured . . . .<br><br>so I also lauched cat /proc/drbd<br><br>[root@xenserver-2 ~]# cat /proc/drbd<br>version: 8.3.8.1 (api:88/proto:86-94)<br>GIT-hash: 0d8589fcc32c874df57c930ca1691399b55ec893 build by root@localhost.localdomain, 2010-07-17 10:04:02<br>
0: cs:Unconfigured<br><br>so I issued<br><br>[root@xenserver-2 ~]# drbdadm up drbd0<br>Can not open device '/dev/sdb1': No such file or directory<br>Command 'drbdsetup 0 disk /dev/sdb1 /dev/sdb1 internal --set-defaults --create-device --max-bio-bvecs=1 --on-io-error=detach' terminated with exit code 20<br>
drbdadm attach drbd0: exited with code 20<br><br>and because of the message, I checked with fdisk -l<br><br>[root@xenserver-2 ~]# fdisk -l<br><br>Disk /dev/sda: 500.1 GB, 500107862016 bytes<br>255 heads, 63 sectors/track, 60801 cylinders<br>
Units = cylinders of 16065 * 512 = 8225280 bytes<br><br> Device Boot Start End Blocks Id System<br>/dev/sda1 * 1 523 4194304 83 Linux<br>Partition 1 does not end on cylinder boundary.<br>
/dev/sda2 523 1045 4194304 83 Linux<br>/dev/sda3 1045 60801 479995393 8e Linux LVM<br><br>Disk /dev/sdb: 1000.2 GB, 1000215724032 bytes<br>255 heads, 63 sectors/track, 121602 cylinders<br>
Units = cylinders of 16065 * 512 = 8225280 bytes<br><br>Disk /dev/sdb doesn't contain a valid partition table<br><br>Yes it is, /dev/sdb1 is disappeared... on both computers...<br><br>Below you find the drbd.conf.<br>
<br>My question are:<br>- which is the correct mode to erase one drbd resource ?<br>- is it possible what described above?<br>- to be able to do such "disaster" (I'm thinking about a production environment), what could be the error/mistake?<br>
- with the following configuration file, both the drbd are starting in secondary mode, maybe this is wanted by drbd concept, but I can't understand it very well.<br>I mean, when everything works fine, I have one primary and one secondary.<br>
If I do a clean shutdown and I shut down first of all the secondary, next I shut down the primary, why starting up first the primary and last the secondary both of them are secondary? Is it the only solution <i><b>become-primary-on server-1</b></i> statement? If yes... I have another issue.. this didn't worked... and powercycling the two pcs in the correct order, again returned a secondary/secondary situation.<br>
- Is it correct to use the server name in the following statement <i><b>become-primary-on server-1</b></i> ?<br>- Which are the downsides of usignthis setting in the drbd.conf: <i><b>become-primary-on server-1</b></i> ?<br>
<br>Thank you for any tip and help, follows the conf file<br>Robert<br><br><br>drbd.conf<br><br># You can find an example in /usr/share/doc/drbd.../drbd.conf.example<br><br>#include "drbd.d/global_common.conf";<br>
#include "drbd.d/*.res";<br><br>global {<br> usage-count yes;<br> }<br><br>common {<br> syncer { <br> rate 1G;<br> verify-alg md5;<br> csums-alg md5;<br> } <br> }<br><br>resource drbd0 {<br>
protocol C;<br><br> startup {<br> #become-primary-on xenserver-2;<br> }<br><br> net {<br> cram-hmac-alg md5;<br> shared-secret "ColdWater";<br> sndbuf-size 0;<br> rcvbuf-size 0;<br>
data-integrity-alg md5;<br> }<br><br> disk {<br> max-bio-bvecs 1;<br> on-io-error detach;<br> }<br><br> on server-1 {<br> device /dev/drbd0;<br> disk /dev/sdb1;<br> address <a href="http://10.1.1.2:7789">10.1.1.2:7789</a>;<br>
meta-disk internal;<br> }<br><br> on server-2 {<br> device /dev/drbd0;<br> disk /dev/sdb1;<br> address <a href="http://10.1.1.3:7789">10.1.1.3:7789</a>;<br> meta-disk internal;<br>
}<br><br> handlers {<br> split-brain "/usr/lib/drbd/notify-split-brain.sh root";<br> }<br><br>}<br><br><br><br><br><br><br>