User Tools

Site Tools


bash:add_drbd_lvm_kvm_vps

Step 1 - Create an LVM partition for your new VPS - do this on both boxes:

lvcreate -n mcbox -L 5G acerbox

Explanation: Create a partition named 'mcbox' on volume 'acerbox' with the size of 5GB - Find your own volume name with 'pvdisplay'

Step 2 - Edit the drbd conf (you should probably create a ressource file instead of using the flatfile like I do) - do this on both boxes:

nano /etc/drbd.d/global_common.conf

RESSOURCE EXAMPLE DATA - fujbox = server 1, acerbox = server 2. Needs to be resolvable by DNS on both servers (hosts file or your own local DNS server):

# mcbox
resource drbd0 {
       on fujbox {
               disk /dev/fujbox/mcbox;
               device /dev/drbd0;
               meta-disk internal;
               address 10.0.0.9:7788;
       }
       on acerbox {
               disk /dev/acerbox/mcbox;
               device /dev/drbd0;
               meta-disk internal;
               address 10.0.0.12:7788;
       }
}

Step 3 - Initialize the new ressource - do this on both boxes:

drbdadm create-md drbd0

Step 4 - Attach the disk - do this on both boxes:

drbdadm attach drbd0 (attach internally)

Step 5 - Mark 1 box as primary master to fetch the data - do this on ONE of the boxes:

drbdadm -- --overwrite-data-of-peer primary drbd0
drbdadm primary --force drbd0

Step 6 - Establish network connection and start sync

drbdadm connect drbd0
bash/add_drbd_lvm_kvm_vps.txt · Last modified: 2015/08/15 22:56 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki