Hi Nico,
 
as far as I know, any time your node reboots, your resource is becomes secondary "by design"(initially).
So, you might need to explicitly call "drbdadm primary r0" for example, you might need to check out "drbdadm" or "drbdsetup" manuals for some relevant hooks.
But, to remove automatic promotion to primary on another node, just disable such default behavior: https://docs.linbit.com/man/v9/drbd-conf-5/#Section_options_Parameters_(Resource_Options) for 9.0 or for 8.4 you might need to look on split-brain behavior and fencing settings. See in https://docs.linbit.com/man/v84/drbd-conf-5/#Parameters "after-sb-0pri", "become-primary-on" and similar.
 
-----------------
Best regards,
Alex
 
17.05.2018, 08:59, "Nico De Ranter" <[email protected]>:
 
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 : [email protected]

 

,

_______________________________________________
drbd-user mailing list
[email protected]
http://lists.linbit.com/mailman/listinfo/drbd-user

_______________________________________________
drbd-user mailing list
[email protected]
http://lists.linbit.com/mailman/listinfo/drbd-user

Reply via email to