Obsolete Releases > SME 8.x Contribs

Distributed Replicated Block Device (DRBD) on SME8 ?

(1/2) > >>

fpausp:
I would like to use drbd on sme8, can anyone tell me how to install and maybe configure drbd on sme8 ?

regards
fpausp

Jean-Philippe Pialasse:
as SME8 is based on centos 5 , this how to should do the trick : https://blogs.it.ox.ac.uk/jamest/2011/06/03/replicating-block-devices-with-drbd/

but I can suggest you to have a look to affa to sync two server, or some alternatives like heartbeat etc.

fpausp:
Hi, thanks for your reply, I found alsa a nice howto:


http://www.sherin.co.in/drbd-heartbeat-active-passive-high-availability-cluster/


DRBD is working ... I need more time to finish the cluster ...

janet:
fpausp

This old howto may be of historical interest
http://distro.ibiblio.org/smeserver/contribs/rmitchell/smeserver/howto/High%20Availability%20How-To%20for%20Linux%20Mitel%20SME%20v5.htm

fpausp:
I try to do this on sme8:

http://wiki.centos.org/HowTos/Ha-Drbd


I use two virtual sme8 server with an additional hdd (/dev/vdb).


I started to write a howto, its just an early version v0.1 ...:

--- Code: ---### sme8 cluster howto v.01 ###


# Install packages (on each host)

yum install drbd82 kmod-drbd82 --enablerepo=extras

yum install heartbeat --enablerepo=extras

signal-event post-upgrade; signal-event reboot


# ssh-keygen -t rsa

On each side ...

# copy the key to the other side

# on sme8test1
ssh-copy-id -i ~/.ssh/id_rsa.pub "root@10.10.10.110 -p 11022"


# on sme8test2
ssh-copy-id -i ~/.ssh/id_rsa.pub "root@10.10.10.109 -p 11022"



Test connection with:

ssh -p 11022 root@10.10.10.110

and vice versa ...

ssh -p 11022 root@10.10.10.109



# create template (on each host)

mkdir -p /etc/e-smith/templates-custom/etc/hosts

nano /etc/e-smith/templates-custom/etc/hosts/30hosts



# on sme8test1
10.10.10.110   sme8test2.mydomain.at sme8test2

# on sme8test2
10.10.10.109   sme8test1.mydomain.at sme8test1



# expand template (on each host)

/sbin/e-smith/expand-template /etc/hosts




# configure drbd

nano /etc/drbd.conf

resource r0 {
protocol      C;

on sme8test1 {
device /dev/drbd1;
disk /dev/vdb1;
address 10.10.10.109:7789;
meta-disk internal;
}
on sme8test2 {
device /dev/drbd1;
disk /dev/vdb1;
address 10.10.10.110:7789;
meta-disk internal;
}
}


# create a primary partition on /dev/vdb
fdisk /dev/vdb


# create resource
drbdadm create-md r0



# start drbd service
/etc/init.d/drbd start





nano /etc/rc.d/rc.local

Add the following line to the end of the file
/etc/rc.d/init.d/drbd start



# chose a server as master (sme8test1), and start replication
drbdadm -- --overwrite-data-of-peer primary r0



# temporary speedup sync (680 for virtual lan)
drbdsetup /dev/drbd1 syncer -r 680M



# make mountpoint on each side
mkdir -p /media/drbd


# we can now format /dev/drbd1 and mount it on sme8test1:
mke2fs -j /dev/drbd1 ; mkdir /media/drbd ; mount /dev/drbd1 /media/drbd



# create a testfile
touch /media/drbd/testfile-sme8test1.txt



# umount and make sme8sme1 secondary
umount /media/drbd
drbdadm secondary r0



# on sme8test2
drbdadm primary r0
mount /dev/drbd1 /media/drbd


# take a look
ls -alih /media/drbd


# write testfile on sme8test2
touch /media/drbd/testfile-sme8test2.txt


# lets switch back to sme8test1, umount drbd and make sme8sme2 secondary
umount /media/drbd
drbdadm secondary r0


# on sme8test1
drbdadm primary r0
mount /dev/drbd1 /media/drbd


# take a look
ls -alih /media/drbd



# start drbd service on boot (on each server)
config setprop drbd status enabled
signal-event post-upgrade;signal-event reboot




### Heartbeat V2 Configuration ###


# Let's configure a simple /etc/ha.d/ha.cf file

nano /etc/ha.d/ha.cf


keepalive 2
deadtime 30
warntime 10
initdead 120
bcast   eth0
node sme8test1
node sme8test2
crm yes


# Create also the /etc/ha.d/authkeys

auth 1
1 sha1 MySecret

# give permission 600
chmod 600 /etc/ha.d/authkeys


# start heartbeat service on sme8test1
/etc/init.d/heartbeat start


# Replicate now the ha.cf and authkeys to sme8test2
scp -P 11022 /etc/ha.d/ha.cf /etc/ha.d/authkeys root@sme8test2:/etc/ha.d/


# start heartbeat service on sme8test2
/etc/init.d/heartbeat start


# Verify cluster with crm_mon
crm_mon



# create a resource group with an ip-address, the drbd-device and filesystem mount operation

# edit cib.xml
nano /var/lib/heartbeat/crm.xml


?????????????????????????????


nano /etc/rc.d/rc.local

Add the following line to the end of the file
/etc/rc.d/init.d/heartbeat start

--- End code ---


Maybe someone can help me to finish the howto (cib.xml) ?

Navigation

[0] Message Index

[#] Next page

Go to full version