[DRBD-cvs] r1462 - in trunk: . documentation drbd scripts

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Wed, 28 Jul 2004 14:06:23 +0200 (CEST)


Author: phil
Date: 2004-07-28 14:06:22 +0200 (Wed, 28 Jul 2004)
New Revision: 1462

Added:
   trunk/upgrade_0.6.x_to_0.7.0.txt
   trunk/upgrade_0.7.0_to_0.7.1.txt
Modified:
   trunk/documentation/drbd.conf.sgml
   trunk/documentation/drbdsetup.sgml
   trunk/drbd/drbd_main.c
   trunk/scripts/drbd.conf
   trunk/scripts/drbd.gentoo
Log:
Some changes to go for majotr 147


Modified: trunk/documentation/drbd.conf.sgml
===================================================================
--- trunk/documentation/drbd.conf.sgml	2004-07-28 09:56:38 UTC (rev 1461)
+++ trunk/documentation/drbd.conf.sgml	2004-07-28 12:06:22 UTC (rev 1462)
@@ -34,13 +34,13 @@
   incon-degr-cmd "halt -f";
 
   on thost1 {
-    device    /dev/nb1;
+    device    /dev/drbd1;
     disk      /dev/hda7;
     address   10.1.1.31:7789;
   }
 
   on thost2 {
-    device    /dev/nb1;
+    device    /dev/drbd1;
     disk      /dev/hda7;
     address   10.1.1.32:7789;
   }
@@ -51,7 +51,7 @@
  protocol C for the connection between its devices.
  The device which runs
  on host <replaceable>thost1</replaceable> uses
- <replaceable>/dev/nb1</replaceable> as devices for its application, and
+ <replaceable>/dev/drbd1</replaceable> as devices for its application, and
  <replaceable>/dev/hda7</replaceable> as low level storage for the data.
  The IP addresses are used to specify the networking interfaces to use.
  </para>
@@ -281,13 +281,15 @@
   </para>
   <para>
     The device nodes must have the same major number as the DRBD
-    driver has. With the current implementation major 43 is used
+    driver has. With the current implementation major 147 is used
     and the corresponding device nodes are usually named 
-    <option>/dev/nb0</option>, <option>/dev/nb1</option>, etc.
+    <option>/dev/drbd0</option>, <option>/dev/drbd1</option>, etc.
+    ( All releases before drbd-0.7.1 used major 43 and the device
+    files /dev/nb*. )
   </para>
   <para>Installation scripts of the DRBD package provide, that
-  <option>/dev/nb0</option> to <option>/dev/nb8</option> are
-  predefined in your system. To be sure, issue something like ls /dev/nb*.
+  <option>/dev/drbd0</option> to <option>/dev/drbd8</option> are
+  predefined in your system. To be sure, issue something like ls /dev/drbd*.
   </para>
   </listitem>
 </varlistentry>

Modified: trunk/documentation/drbdsetup.sgml
===================================================================
--- trunk/documentation/drbdsetup.sgml	2004-07-28 09:56:38 UTC (rev 1461)
+++ trunk/documentation/drbdsetup.sgml	2004-07-28 12:06:22 UTC (rev 1462)
@@ -586,14 +586,14 @@
 	turn /dev/hda6 into a virtually shared disk.</para>
       <para>On tc1 we need:</para>
       <screen>
-	$ drbdsetup /dev/nb0 disk /dev/hda6
-	$ drbdsetup /dev/nb0 net 192.168.37.2 192.168.37.3 B
+	$ drbdsetup /dev/drbd0 disk /dev/hda6
+	$ drbdsetup /dev/drbd0 net 192.168.37.2 192.168.37.3 B
       </screen>
       <para>On tc2 we need:</para>
       <screen>
-	$ drbdsetup /dev/nb0 disk /dev/hda6
-	$ drbdsetup /dev/nb0 net 192.168.37.3 192.168.37.2 B
-	$ drbdsetup /dev/nb0 primary
+	$ drbdsetup /dev/drbd0 disk /dev/hda6
+	$ drbdsetup /dev/drbd0 net 192.168.37.3 192.168.37.2 B
+	$ drbdsetup /dev/drbd0 primary
 	$ cat /proc/drbd
 	<computeroutput>version: 0.7.0 (api:xx/proto:yy)
 
@@ -605,8 +605,8 @@
       that the device is ready for use on tc2.</para>
       <para>We can now run our application on top of it:</para>
       <screen>
-	$ mkfs -b 4096 /dev/nb0
-	$ mount /dev/nb0 /mnt/mountpoint
+	$ mkfs -b 4096 /dev/drbd0
+	$ mount /dev/drbd0 /mnt/mountpoint
       </screen>
     </example>
     <example>
@@ -614,23 +614,23 @@
       <para>
 	In this example the hosts, <replaceable>tc1</replaceable> and
 	<replaceable>tc2</replaceable>, are connected and
-	<replaceable>tc2</replaceable> is primary on the /dev/nb0 device.
+	<replaceable>tc2</replaceable> is primary on the /dev/drbd0 device.
 	The resource should be snapshotted to <replaceable>tc3's
 	/dev/hda6</replaceable>.</para>
       <para>We need to prepare tc3:</para>
       <screen>
-	$ drbdsetup /dev/nb0 disk /dev/hda6
-	$ drbdsetup /dev/nb0 net tc3 tc2 B
+	$ drbdsetup /dev/drbd0 disk /dev/hda6
+	$ drbdsetup /dev/drbd0 net tc3 tc2 B
       </screen>
       <para>On tc2 we have to issue:</para>
       <screen>
-	$ drbdsetup /dev/nb0 disconnect
-	$ drbdsetup /dev/nb0 net tc2 tc3 B --sync-rate 4M
-	$ #drbdsetup /dev/nb0 replicate
-	$ drbdsetup /dev/nb0 wait_sync
-	$ drbdsetup /dev/nb0 disconnect
-	$ drbdsetup /dev/nb0 net tc2 tc1 B
-	$ #drbdsetup /dev/nb0 replicate
+	$ drbdsetup /dev/drbd0 disconnect
+	$ drbdsetup /dev/drbd0 net tc2 tc3 B --sync-rate 4M
+	$ #drbdsetup /dev/drbd0 replicate
+	$ drbdsetup /dev/drbd0 wait_sync
+	$ drbdsetup /dev/drbd0 disconnect
+	$ drbdsetup /dev/drbd0 net tc2 tc1 B
+	$ #drbdsetup /dev/drbd0 replicate
       </screen>
       <para>With release 0.6.x DRBD's meta-data management still can not detect changing
       mirroring partners. Therefore you might have to issue
@@ -638,7 +638,7 @@
       <para>Since the snapshot was taken without bringing the on disk file 
       system into a consistent state we need these commands on tc3:</para>
       <screen>
-	$ drbdsetup /dev/nb0 down
+	$ drbdsetup /dev/drbd0 down
 	$ fsck /dev/hda6
 	$ mount /dev/hda6 /some/mountpoint
       </screen>

Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c	2004-07-28 09:56:38 UTC (rev 1461)
+++ trunk/drbd/drbd_main.c	2004-07-28 12:06:22 UTC (rev 1462)
@@ -56,7 +56,7 @@
 #include "drbd_int.h"
 
 #ifndef CONFIG_DRBD_MAJOR
-#define CONFIG_DRBD_MAJOR NBD_MAJOR
+#define CONFIG_DRBD_MAJOR 147
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)

Modified: trunk/scripts/drbd.conf
===================================================================
--- trunk/scripts/drbd.conf	2004-07-28 09:56:38 UTC (rev 1461)
+++ trunk/scripts/drbd.conf	2004-07-28 12:06:22 UTC (rev 1462)
@@ -209,7 +209,7 @@
   }
 
   on amd {
-    device     /dev/nb0;
+    device     /dev/drbd0;
     disk       /dev/hde5;
     address    192.168.22.11:7788;
     meta-disk  internal;
@@ -228,7 +228,7 @@
   }
 
   on alf {
-    device    /dev/nb0;
+    device    /dev/drbd0;
     disk      /dev/hdc5;
     address   192.168.22.12:7788;
     meta-disk internal;
@@ -262,14 +262,14 @@
   }
 
   on amd {
-    device	/dev/nb1;
+    device	/dev/drbd1;
     disk	/dev/hde6;
     address	192.168.22.11:7789;
     meta-disk	/dev/somewhere [7];
   }
 
   on alf {
-    device     /dev/nb1;
+    device     /dev/drbd1;
     disk       /dev/hdc6;
     address    192.168.22.12:7789;
     meta-disk  /dev/somewhere [7];
@@ -287,10 +287,10 @@
   syncer  { rate 4M; group 2; } # sync when r0 and r1 are finished syncing.
   on amd {
     address 192.168.22.11:7790;
-    disk /dev/hde7; device /dev/nb2; meta-disk "internal";
+    disk /dev/hde7; device /dev/drbd2; meta-disk "internal";
   }
   on alf {
-    device "/dev/nb2"; disk "/dev/hdc7"; meta-disk "internal";
+    device "/dev/drbd2"; disk "/dev/hdc7"; meta-disk "internal";
     address 192.168.22.12:7790;
   }
 }
@@ -305,13 +305,13 @@
     group	3;   # sync when r2 is finished syncing.
   }
   on amd {
-    device	/dev/nb3;
+    device	/dev/drbd3;
     disk	/dev/hde8;
     address	192.168.22.11:7791;
     meta-disk	internal;
   }
   on alf {
-    device	/dev/nb3;
+    device	/dev/drbd3;
     disk	/dev/hdc8;
     address	192.168.22.12:7791;
     meta-disk	/some/where[8];

Modified: trunk/scripts/drbd.gentoo
===================================================================
--- trunk/scripts/drbd.gentoo	2004-07-28 09:56:38 UTC (rev 1461)
+++ trunk/scripts/drbd.gentoo	2004-07-28 12:06:22 UTC (rev 1462)
@@ -18,11 +18,11 @@
 
 start() {
 	ebegin "Starting DRBD"
-	if [ ! -e /dev/nb0 ] ; then
-	   /bin/mknod /dev/nb0 b 43 0
+	if [ ! -e /dev/drbd0 ] ; then
+	   /bin/mknod /dev/drbd0 b 43 0
 	fi
-	if [ ! -e /dev/nb1 ] ; then
-	   /bin/mknod /dev/nb1 b 43 1
+	if [ ! -e /dev/drbd1 ] ; then
+	   /bin/mknod /dev/drbd1 b 43 1
 	fi
 	${DRBDADM} up all
 #	/sbin/drbdadm wait_connect all

Added: trunk/upgrade_0.6.x_to_0.7.0.txt
===================================================================
--- trunk/upgrade_0.6.x_to_0.7.0.txt	2004-07-28 09:56:38 UTC (rev 1461)
+++ trunk/upgrade_0.6.x_to_0.7.0.txt	2004-07-28 12:06:22 UTC (rev 1462)
@@ -0,0 +1,45 @@
+
+DRBD upgrade instructions from 0.6.x to 0.7.0
+
+* Since drbd-0.7.x is protocol incompatile to drbd-0.6.x you need
+  to do a offline upgrade. I.e. no "rolling" upgrade possible.
+
+  Make sure that the devices are in sync, make both sides secondary
+  first and then stop DRBD on both nodes.
+
+* In drbd-0.7.0 each DRBD resource needs 128MB of storage on
+  some block device for its meta data. (With this /var/lib/drbd
+  disappeared.)
+
+  In order to do this upgrade you either need to
+
+   A) shrink your filesystems on the DRBD devices by at least 128MB
+   B) grow the backing_storage of the DRBD devices by at leas 128MB
+   C) have one seperate block_device for all meta data
+
+  A)
+  ext2/ext3   resize2fs
+  reiserfs    resize_reiserfs     
+  xfs         xfsdump, xfsrestore ; xfs can only grow
+
+  B)
+  lvresize    in case you run DRBD on LVM
+  (fdisk)     (Only do this if you know what you are doing.)
+
+  C)
+  The device needs to be n*128MB, where n is the number of 
+  DRBD resources.
+
+* Update you configurate file:
+  - Change it to the new syntax.
+  - Remove the disk-size parameter from you drbd.conf
+  - Add the meta-disk settings
+  - Remove tl-size
+  - Change sync-min & sync-max to sync { rate }
+  - Add the al-extents setting
+
+* Start DRBD on both nodes
+
+* Tune the al-extents setting to balance the number of updates
+  to the metadata per minute (see cat /proc/drbd umber "al:") vs
+  the expected resync time. 

Added: trunk/upgrade_0.7.0_to_0.7.1.txt
===================================================================
--- trunk/upgrade_0.7.0_to_0.7.1.txt	2004-07-28 09:56:38 UTC (rev 1461)
+++ trunk/upgrade_0.7.0_to_0.7.1.txt	2004-07-28 12:06:22 UTC (rev 1462)
@@ -0,0 +1,20 @@
+
+DRBD upgrade instructions from 0.7.0 to 0.7.1
+
+With drbd-0.7.1 we have our own major number, and our own device
+files. (=No longer misuse /dev/nbX)
+
+* Start on the node, on which all devices are secondary.
+* /etc/init.d/drbd stop
+* Install drbd-0.7.1
+* Run these commands as root:
+
+sed -e "s/\/dev\/nb/\/dev\/drbd/" < /etc/drbd.conf > /etc/drbd.conf_new
+mv /etc/drbd.conf /etc/drbd.conf_old ; mv /etc/drbd.conf_new /etc/drbd.conf
+sed -e "s/\/dev\/nb/\/dev\/drbd/" < /etc/fstab > /etc/fstab_new
+mv /etc/fstab /etc/fstab_old ; mv /etc/fstab_new /etc/fstab
+for ((i=0;i<16;i++)); do mknod /dev/drbd$i b 147 $i; done
+
+* /etc/init.d/drbd start
+* migrate all services to the just upgraded node and 
+  upgrade the other node.