[DRBD-user] allow-two-primaries (hot migration) and three nodes...
Stéphane Rivière
stef at genesix.org
Tue Dec 22 12:24:39 CET 2020
So...
I've the answer. After many tries. The right syntax is...
With an equal sign between the parameter and the value :)
drbdadm net-options i1c1 --allow-two-primaries=no
drbdadm net-options i1c1 --allow-two-primaries=yes
But the command did not return an error message (viciously:)
I was alerted because I use this trick in my prompt¹ :
root at n202c1 🍀 ~ >drbdadm status
4-leaf clover=0
root at n202c1 🎱 ~ >drbdadm net-options i1c1 --allow-two-primaries no
8-billiard ball > 0
root at n201c1 🍀 ~ >drbdadm net-options i1c1 --allow-two-primaries=no
4-leaf clover=happy !
And... then... all went "logical"
root at n201c1 🍀 ~ >drbdadm status i1c1
i1c1 role:Secondary
disk:UpToDate
n202c1.genesix.org role:Primary
peer-disk:UpToDate
n250c1.genesix.org role:Secondary
peer-disk:UpToDate
root at n201c1 🍀 ~ >drbdadm primary i1c1
i1c1: State change failed: (-1) Multiple primaries not allowed by config
Command 'drbdsetup primary i1c1' terminated with exit code 11
root at n201c1 🎱 ~ >drbdadm net-options i1c1 --allow-two-primaries=yes
root at n201c1 🍀 ~ >drbdadm primary i1c1
root at n201c1 🍀 ~ >
root at n201c1 🍀 ~ >drbdadm status i1c1
i1c1 role:Primary
disk:UpToDate
n202c1.genesix.org role:Primary
peer-disk:UpToDate
n250c1.genesix.org role:Secondary
peer-disk:UpToDate
All the best from Oleron Island Thomas,
And thanks again to point me the "best practise" to put on
"allow-two-primaries" only if appropriate.
¹ This trick saved my day !!!
in .bashrc
emoji_err_code() {
local errcode="$?"
if [[ "$errcode" -eq 0 ]]
then
ErrSym=$(printf '\xF0\x9F\x8D\x80')
else
ErrSym=$(printf '\xF0\x9F\x8E\xB1')
fi
PS1=''${vecb}'\u'${blcb}'@'${vert}'\h '${ErrSym}' '${gris}'\w
'${blcb}''${c_of}'${STY}>'
}
export PROMPT_COMMAND=emoji_err_code
--
Stéphane Rivière
Ile d'Oléron - France
More information about the drbd-user
mailing list