DRBD 3 machines stacked setup
Posted by valqk onWARNING: DO NOT do this setup, unless you'r OK with the speed to remote node. The max. speed you will get from drbd device is the speed you can push data to 3rd node.
--------------
DRBD 8.3 Third Node Replication With Debian EtchInstallation and Set Up Guide for DRBD 8.3 + Debian EtchThe Third Node Setupby Brian Hellman The recent release of DRBD 8.3 now includes The Third Node feature as a freely available component. This document will cover the basics of setting up a third node on a standard Debian Etch installation. At the end of this tutorial you will have a DRBD device that can be utilized as a SAN, an iSCSI target, a file server, or a database server. Note: LINBIT support customers can skip Section 1 and utilize the package repositories. LINBIT has hosted third node solutions available, please contact them at sales_us at linbit.com for more information.
Preface:The setup is as follows:
Section 1: Installing The SourceThese steps need to be done on each of the 3 nodes. Prerequisites:
Enter the following at the command line as a privileged user to satisfy these dependencies: apt-get install make gcc libc6 flex linux-headers-`uname -r` libc6-dev linux-kernel-headers Once the dependencies are installed, download DRBD. The latest version can always be obtained at http://oss.linbit.com/drbd/. Currently, it is 8.3.
After the download is complete:
Now load and verify the module:
version: 8.3.0 (api:88/proto:86-89) Once this has been completed on each of the three nodes, continue to next section.
Section 2: Heartbeat ConfigurationSetting up a third node entails stacking DRBD on top of DRBD. A virtual IP is needed for the third node to connect to, for this we will set up a simple Heartbeat v1 configuration. This section will only be done on alpha and bravo. Install Heartbeat:
Edit the authkeys file: vi /etc/ha.d/authkeys auth 1 Once the file has been created, change the permissions on the file. Heartbeat will not start if this step is not followed. chmod 600 /etc/ha.d/authkeys Copy the authkeys file to bravo: scp /etc/ha.d/authkeys bravo:/etc/ha.d/ Edit the ha.cf file: vi /etc/ha.d/ha.cf debugfile /var/log/ha-debug Copy the ha.cf file to bravo: scp /etc/ha.d/ha.cf bravo:/etc/ha.d/ Edit the haresources file, the IP created here will be the IP that our third node refers to. vi /etc/ha.d/haresources alpha IPaddr::192.168.5.2/24/eth0 Copy the haresources file to bravo: scp /etc/ha.d/haresources bravo:/etc/ha.d/ Start the heartbeat service on both servers to bring up the virtual IP: alpha:/# /etc/init.d/heartbeat start bravo:/# /etc/init.d/heartbeat start Heartbeat will bring up the new interface (eth0:0). Note: It may take heartbeat up to one minute to bring the interface up.
eth0:0 Link encap:Ethernet HWaddr 00:08:C7:DB:01:CC
Section 3: DRBD ConfigurationConfiguration for DRBD is done via the drbd.conf file. This needs to be the same on all nodes (alpha, bravo, foxtrot). Please note that the usage-count is set to yes, which means it will notify Linbit that you have installed DRBD. No personal information is collected. Please see this page for more information : global { usage-count yes; }
Section 4: Preparing The DRBD DevicesNow that the configuration is in place, create the metadata on alpha and bravo.
Writing meta data...
Writing meta data... Now start DRBD on alpha and bravo: alpha:/usr/src/drbd-8.3.0# /etc/init.d/drbd start bravo:/usr/src/drbd-8.3.0# /etc/init.d/drbd start Verify that the lower level DRBD devices are connected:
version: 8.3.0 (api:88/proto:86-89) Tell alpha to become the primary node: NOTE: As the command states, this is going to overwrite any data on bravo: Now is a good time to go and grab your favorite drink. alpha:/# drbdadm -- --overwrite-data-of-peer primary data-lower version: 8.3.0 (api:88/proto:86-89) After the data sync has finished, create the meta-data on data-upper on alpha, followed by foxtrot. Note the resource is data-upper and the --stacked option is on alpha only.
Writing meta data...
Writing meta data... Bring up the stacked resource, then make alpha the primary of data-upper: alpha:/# drbdadm --stacked adjust data-upper foxtrot:~# drbdadm adjust data-upper version: 8.3.0 (api:88/proto:86-89) alpha:~# drbdadm --stacked -- --overwrite-data-of-peer primary data-upper version: 8.3.0 (api:88/proto:86-89) Drink time again! After the sync is complete, access your DRBD block device via /dev/drbd3. This will write to both local nodes and the remote third node. In your Heartbeat configuration you will use the "drbdupper" script to bring up your /dev/drbd3 device. Have fun! DRBD® and LINBIT® are registered trademarks of LINBIT, Austria. If you ever get a split-brain (two nodes are in StandAlone and won't want to connect or one is WFConnection the other is StandAlone - it's splitbrain!) On the node that is outdated do: drbdadm secondary drbdadm -- --discard-my-data connect on the node that has fresh data: drbdadm --stacked connect DRBD 3 machines stacked setupPosted by valqk on
This is copy/paste from http://www.howtoforge.com/drbd-8.3-third-node-replication-with-debian-etch plus a split-brain fixes. WARNING: DO NOT do this setup, unless you'r OK with the speed to remote node. The max. speed you will get from drbd device is the speed you can push data to 3rd node. --------------
|