Quantcast
Channel: Raspberry Pi – IT Solutions Technology Blog
Viewing all articles
Browse latest Browse all 1170

Raspberry Pi DRBD Cluster – all you need is two Raspberry Pi and two USB memory sticks

$
0
0

drbd_logo.jpg   DRBD (Distributed Replicated Block Device) is a data replication software for Linux. It presents as a block-device to the user. DRBD is similiar to a RAID 1 except that it runs over a network between two Servers for data replication at least GBit Ethernet should be used

DRBD_01DRBD_02

# apt-get -y install drbd8-utils
# echo drbd >>/etc/modules
# modprobe drbd
# vi /etc/drbd.conf
global { usage-count yes; }
resource r0 { protocol C;
syncer { rate 10M; }
net { allow-two-primaries; }
startup { become-primary-on both; }
on JSHODRBD01 {
device /dev/drbd0;
disk /dev/sda;
address 192.168.1.91:7791;
meta-disk  internal;
}
on JSHODRBD02 {
device /dev/drbd0;
disk /dev/sda;
address 192.168.1.92:7791;
meta-disk internal;
}
}
# /etc/init.d/drbd restart
# drbdadm down r0
# drbdadm create-md r0
# only on the primary node
# drbdsetup /dev/drbd0 primary –overwrite-data-of-peer
# /etc/init.d/drbd status
# cat /proc/drbd
# # mount the primary node
# mkfs.ext3 /dev/drbd0
# mkdir /u0_drbd0
# mount /dev/drbd0 /u0_drbd0
# # change the primary node
# umount /u0_drbd0
# drbdadm — secondary r0
# # make the secondary node to the primary node
# drbdadm — primary r0
# mkdir /u0_drbd0
# mount /dev/drbd0 /u0_drbd0

Viewing all articles
Browse latest Browse all 1170

Trending Articles