drbd debian heartbeat samba ifconfig - problem

Discussion in 'HOWTO-Related Questions' started by mr.si, Oct 29, 2014.

  1. mr.si

    mr.si New Member

    Hi all I have some problems with my drbd / heartbeat / samba setup which I hope you can help me with!

    Firstly, I have been using the following guides to help me:

    https://sigterm.sh/2014/02/01/highly-available-nfs-cluster-on-debian-wheezy/
    http://www.howtoforge.com/high_availability_nfs_drbd_heartbeat_p3

    and have been reading the forum topic:
    http://www.howtoforge.com/forums/showthread.php?t=6292&page=6

    The initial sync went fine with aafile1 as primary and aafile2 as secondary

    The problems I have are:

    1. on failing back by re-starting heartbeat on aafile1, it does not re-become primary, I thought heartbeat was supposed to do that. After a reboot it still doesn't do it and both stay as secondary/secondary

    2. I cannot mount at boot /dev/drbd0 to mount point /data which I set up in fstab. The directory was created to enable it to mount at boot.

    3. the heartbeat virtual IP does not show in either ifconfig or ip addr show.


    My config files are as follows:

    /etc/drbd.d/global_common.conf
    Code:
    global {
        usage-count yes;
    }
    
    common {
        protocol C;
    
        handlers {
            pri-on-incon-degr "/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
            pri-lost-after-sb "/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";
            local-io-error "/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f";
    
            split-brain "/usr/lib/drbd/notify-split-brain.sh root";
        }
    
        startup {
            wfc-timeout 15;
            degr-wfc-timeout 60;
        }
    
        net {
            cram-hmac-alg sha1;
        }
    
        syncer {
            rate 10M;
        }
    }
    

    /etc/drbd.d/r0.res
    Code:
    resource r0 {
        net {
            shared-secret "secretcode";
        }
    
        on aafile1.domain.lan {
            device    /dev/drbd0;
            disk      /dev/mapper/aafile1vg-data;
            address   192.168.2.3:7788;
            meta-disk internal;
        }
    
        on aafile2.domain.lan {
            device    /dev/drbd0;
            disk      /dev/mapper/aafile2vg-data;
            address   192.168.2.4:7788;
            meta-disk internal;
        }
    }
    

    /etc/heartbeat/ha.cf
    Code:
    logfailicty local0
    logfile /var/log/ha-log
    keepalive 2
    deadtime 30
    initdead 120
    bcast eth0
    autofailback off
    node aafile1.domain.lan aafile2.domain.lan
    
    /etc/heartbeat/haresources
    Code:
    aafile1.domain.lan IPaddr::192.168.2.5/24/eth0 drbddisk::r0 Filesystem::/dev/drbd0::/data::ext4 smbd nmbd
    
     
    Last edited: Oct 29, 2014

Share This Page