drbd build from source

 

 


Build on Cetnos 7

 

準備

yum install -y libxslt

yum install kernel-devel kernel-headers

更新到最新 Kernel

yum install kernel

reboot

Build & Compile

./configure --without-manual \
 --without-84support --without-83support \
 --prefix /opt/drbd

make -j KDIR=/usr/src/kernels/$(uname -r)

# drbd.ko drbd_transport_tcp.ko 放到 /lib/modules/3.10.0-1160.31.1.el7.x86_64/updates

make install

Test

depmod

modprobe drbd

cat /proc/drbd

auto load after reboot

echo drbd > /etc/modules-load.d/drbd.conf

CLI

ln -s /opt/drbd/sbin/drbdadm /usr/sbin
ln -s /opt/drbd/sbin/drbdmeta /usr/sbin
ln -s /opt/drbd/sbin/drbdsetup /usr/sbin

copy from drbd-a to drbd-b

scp -r /opt/drbd drbd-b:/opt

scp /etc/modules-load.d/drbd.conf drbd-b:/etc/modules-load.d/drbd.conf

scp -r /lib/modules/$(uname -r)/updates drbd-b:/lib/modules/$(uname -r)/