[DRBD-user] primary reverts to secondary after reboot

Veit Wahlich cru.lists at zodia.de
Fri May 18 13:11:54 CEST 2018


Hi Nico,

if you want DRBD to promote one node automatically at boot-up, your
resource file(s) will need a startup{} section featuring a
become-primary-on statement.

If your setup is not yet in production, you might consider using single
DRBD ressources per VM instead of a replicated filesystem, so you could
live-migrate VMs between the hosts and let libvirt promote/demote the
ressource when the VM is powered on/off using a handler script.
You do not need a permanent dual-primary configuration for this, but
only during live migration and only for the ressource of the VM being
currently migrated.

Best regards,
// Veit


Am Mittwoch, den 16.05.2018, 10:20 +0200 schrieb Nico De Ranter:
> 
> 
> Hi all,
> 
> 
> I'm trying to create a simple setup containing 2 servers.  One server
> has a filesystem on /dev/drbd0 mounted as /var/lib/libvirt/. The drbd
> disk is synchronised to a second 'passive' server.  If something goes
> wrong with the primary a script should be run manually on the
> secondary to promote it to primary and restart all VM's.  I do not
> intend this to be automatic.
> 
> 
> The initial configuration seems to run fine until I reboot the primary
> server.  After the primary reboots the drbd0 resource is set to
> Secondary/Secondary. I need to manually promote it back to Primary and
> restart all my services.  
> 
> cat /proc/drbd 
> version: 8.4.5 (api:1/proto:86-101)
> srcversion: 4B3E2E2CD48CAE5280B5205 
>  0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r-----
>     ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0
> 
> 
> How can I prevent this from happening?  I want my primary to remain
> primary until I manually promote the secondary in which case the
> original primary is considered dead and will be wiped.
> 
> content of /etc/drbd.d/test.res
> resource r0 {
>         protocol C;
>         startup {
>                 wfc-timeout  15;
>                 degr-wfc-timeout 60;
>         }
>     syncer {
>         rate 200M;
>         al-extents 1801;
>     }
>         net {
>                 cram-hmac-alg sha1;
>                 shared-secret "somesillypassword";
>         max-buffers    8000;
>         max-epoch-size    8000;
>         }
>     on core1-spc {
>         address 10.0.0.1:7788;
>                 device /dev/drbd0;
>                 disk /dev/md3;
>                 meta-disk internal;
>         }
>     on core2-spc {
>         address 10.0.0.2:7788;
>                 device /dev/drbd0;
>                 disk /dev/md3;
>                 meta-disk internal;
>         }
> } 
> 
> 
> content of /etc/fstab
> ...
> /dev/drbd0        /var/lib/libvirt        ext4     defaults,_netdev
> 0       0
> 
> 
> 
> 
> 
> -- 
> 
> Nico De Ranter
> Operations Engineer
> 
> T. +32 16 38 72 10
> 
> 
> 
> 
> 
> 
> eSATURNUS
> Romeinse straat 12
> 3001 Leuven – Belgium
> 
> 
> T. +32 16 40 12 82
> F. +32 16 40 84 77
> www.esaturnus.com
> 
> 
> 
> For Service & Support 
> 
> Support Line: +32 16 387210 or via email : support at esaturnus.com
> 
>  
> 
> 
> 
> 
> _______________________________________________
> drbd-user mailing list
> drbd-user at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-user




More information about the drbd-user mailing list