Welcome to FreeSoftwareServers Confluence Wiki

cat << EOL >/etc/drbd.d/varlibasterisk.res
resource varlibasterisk {
        meta-disk internal;
        disk   /dev/sda7;
        device /dev/drbd7;
on node1 {
on node2 {
drbdadm create-md varlibasterisk
modprobe drbd
drbdadm up varlibasterisk
drbdadm primary --force varlibasterisk
watch cat /proc/drbd
mkfs.ext4 /dev/drbd7
mount /dev/drbd7 /mnt
df -h | grep drbd
umount /mnt
mount /dev/drbd7 /mnt

I-O Error Fix :
This happens every time I do initialization, but its an easy fix. The end goal is to be able to unmount and mount and unmount and mount the drbd without any errors. I have tested this over 50 times.

drbdadm up varlibasterisk
watch cat /proc/drbd

#Asterisk Config
#Both Nodes

systemctl disable astersik.service
service asterisk stop
chkconfig asterisk off


mount /dev/drbd7 /mnt
df -h | grep drbd
ls -la /var/lib/asterisk/*
mv /var/lib/asterisk/* /mnt
ls -la /mnt/*
umount /mnt 


rm /var/lib/asterisk/* -R 

Cluster CFG

pcs cluster cib asterisk_clust_cfg
pcs -f asterisk_clust_cfg resource create varlibasterisk_drbd_res ocf:linbit:drbd drbd_resource=varlibasterisk op monitor interval=60s
pcs -f asterisk_clust_cfg resource master VARLIBASTERISKClone varlibasterisk_drbd_res master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true
pcs -f asterisk_clust_cfg resource create varlibasterisk ocf:heartbeat:Filesystem device="/dev/drbd7" directory="/var/lib/asterisk" fstype="ext4"
pcs  -f asterisk_clust_cfg resource create Asterisk lsb:asterisk params binary="asterisk" canary_binary="astercany" config="/etc/asterisk/asterisk.conf" user="asterisk" group="asterisk" additional_parameters="-g -vvv" op monitor timeout="30"
pcs -f asterisk_clust_cfg resource group add ASTERISK-Group varlibasterisk Asterisk
pcs -f asterisk_clust_cfg constraint order promote VARLIBASTERISKClone then ASTERISK-Group
pcs -f asterisk_clust_cfg constraint colocation add  ASTERISK-Group with VARLIBASTERISKClone INFINITY with-rsc-role=Master
pcs -f asterisk_clust_cfg constraint location ASTERISK-Group prefers node1
pcs -f asterisk_clust_cfg constraint
pcs cluster cib-push asterisk_clust_cfg
pcs status





  • No labels