sudo drbdadm -f primary r0
I would get this error:
0: State change failed: (-2) Need access to UpToDate data
Command 'drbdsetup 0 primary' terminated with exit code 17
Checking the status reveals:
cat /proc/drbd
version: 8.3.11 (api:88/proto:86-96)
srcversion: DA5A13F16DE6553FC7CE9B2
0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent 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:1953460984
The reason for this is because neither server can tell if it has the correct data, so we need to invalidate one of them, so the other one thinks it is up-to-date. This is pretty simple. On the secondary server, simple use this command (replacing r0 with your resource):
sudo drbdadm invalidate r0
That's it. You can now successfully set your primary server with:
sudo drbdadm -f primary r0
Now check your status:
cat /proc/drbd
and you should see something similar to:
version: 8.3.11 (api:88/proto:86-96)
srcversion: DA5A13F16DE6553FC7CE9B2
0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r-----
ns:1818624 nr:0 dw:0 dr:1819288 al:0 bm:110 lo:0 pe:48 ua:0 ap:0 ep:1 wo:f oos:1951645432
[>....................] sync'ed: 0.1% (1905900/1907676)Mfinish: 16:47:51 speed: 32,260 (30,772) K/sec
Huzzah, success!
No works for me....still same error !!
ReplyDelete# drbdadm primary r0
0: State change failed: (-2) Need access to UpToDate data
Command 'drbdsetup primary 0' terminated with exit code 17
Did you get any other solution please
DeleteIt worked for me at least. Thanks.
ReplyDeleteThanks ! It works.
ReplyDeleteThanks a lot!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThank you very much It works now.
ReplyDeleteThank you!
ReplyDeletelifesaver; thank you :)
ReplyDeleteyes it works !
ReplyDeleteThank you, it worked for me.
ReplyDeleteOption -f is unknown. Instead, use this:
ReplyDelete$ drbdadm --force primary r0
Thanks! Worked for me also.
ReplyDeleteThanks!
ReplyDeleteThanks it worked !
ReplyDeleteThank you
ReplyDeletedrbdadm invalidate drbd0
ReplyDelete0: State change failed: (-11) Device is diskless, the requested operation requires a disk
I am not able to up my resource, still with the same issue
ReplyDeleteWhen I run drbdadm up r0, I get
ReplyDeleteopen(/dev/sdb) failed: device or resource busy
Operation cancelled.
command 'drbdmeta 0 v08 /dev/sdb internal apply-al' terminated with exit code 20
Disable SElinux and restart. It worked for me
ReplyDeleteMe too,thanks!
Deletemuito obrigado man
ReplyDelete