<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1518470976;
        mso-list-type:hybrid;
        mso-list-template-ids:-1621048680 67895313 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l0:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Elias !<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>“crm status” will tell you on which node a given resource is active. You can also use “crm_mon” (underscore!) which will present the same thing in real time (crm status is a one shot run).<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Basically, crm is the command to use to do everything you intend to do.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Regarding the iSCSI target daemon, you have declared an IP resource in your cluster, the one that your remote iSCSI initiators point to. Since the IP resource is a resource, you will see it in the crm status report, and you will know which node owns it.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>In order to failover your resources, guess what, you may use crm too! </span><span lang=EN-US style='font-size:11.0pt;font-family:Wingdings;color:#1F497D'>J</span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> As far as I remember, it’s something like “crm resource migrate <res_name> <target_host>”. Have a look to the crm man pages for more details.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You may also manually modify the cib config within the cluster to change the scores of your resources. This is what I use to do, although I’m not sure it is actually a best practice… To make short, the “score” is sort of a “weight” that you give to your resource on a given host. The host on which the weight/score is the highest is the host on which the resource is tied to. Change the scores, the resource moves.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You must read at least 2 docs to better understand that complex stuff :<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>1)<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>“Pacemaker 1.0 Configuration Explained”, by Andrew Beekhof. There might be a more recent release, but I don’t know of it… I had to read it twice, but it gives valuable information regarding the way a Pacemaker cluster is structured and works. This manual worths gold!<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><span style='mso-list:Ignore'>2)<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>And then the “CRM CLI guide” (not sure which version is the latest, I have the 0.94) by Dejan Muhamedagic and Yan Gao, to understand all crm is able to achieve, and that’s not few!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Also, the “Cluster from scratch” manual is a good introduction. </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>An dit contains DRBD examples. </span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>May be you might start by it, to catch the first concepts… It is easier to read than the “Pacemaker 1.0 Configuration Explained” I mentioned above.<o:p></o:p></span></p><p class=MsoListParagraph><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You’ll find all this on the web of course!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>HTH!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best regards,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Pascal.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De :</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> drbd-user-bounces@lists.linbit.com [mailto:drbd-user-bounces@lists.linbit.com] <b>De la part de</b> Elias Chatzigeorgiou<br><b>Envoyé :</b> jeudi 5 janvier 2012 03:14<br><b>À :</b> drbd-user@lists.linbit.com<br><b>Objet :</b> [DRBD-user] HA DRBD setup - graceful failover/active node detection<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I have a two-node active/passive cluster, with DRBD controlled by corosync/pacemaker. <o:p></o:p></p></div><div><p class=MsoNormal>All storage is based on LVM.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>------------------------------------------------------------------------------------<o:p></o:p></p></div><div><p class=MsoNormal>a) How do I know, which node of the cluster is currently active? <o:p></o:p></p></div><div><p class=MsoNormal> How can I check if a node is currently in use by the iSCSI-target daemon?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> I can try to deactivate a volume group using:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>[root@node1 ~]# vgchange -an data<o:p></o:p></p></div><div><p class=MsoNormal> Can't deactivate volume group "data" with 3 open logical volume(s)<span class=apple-tab-span> </span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>In which case, if I get a message like the above then I know that <o:p></o:p></p></div><div><p class=MsoNormal>node1 is the active node, but is there a better (non-intrusive)<o:p></o:p></p></div><div><p class=MsoNormal>way to check?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>A better option seems to be 'pvs -v'. If the node is active then it shows the volume names:<o:p></o:p></p></div><div><p class=MsoNormal>[root@node1 ~]# pvs -v<o:p></o:p></p></div><div><p class=MsoNormal> Scanning for physical volume names<o:p></o:p></p></div><div><p class=MsoNormal> PV VG Fmt Attr PSize PFree DevSize PV UUID<o:p></o:p></p></div><div><p class=MsoNormal> /dev/drbd1 data lvm2 a- 109.99g 0 110.00g c40m9K-tNk8-vTVz-tKix-UGyu-gYXa-gnKYoJ<o:p></o:p></p></div><div><p class=MsoNormal> /dev/drbd2 tempdb lvm2 a- 58.00g 0 58.00g 4CTq7I-yxAy-TZbY-TFxa-3alW-f97X-UDlGNP<o:p></o:p></p></div><div><p class=MsoNormal> /dev/drbd3 distrib lvm2 a- 99.99g 0 100.00g l0DqWG-dR7s-XD2M-3Oek-bAft-d981-UuLReC<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>where on the inactive node it gives errors:<o:p></o:p></p></div><div><p class=MsoNormal>[root@node2 ~]# pvs -v<o:p></o:p></p></div><div><p class=MsoNormal> Scanning for physical volume names<o:p></o:p></p></div><div><p class=MsoNormal> /dev/drbd0: open failed: Wrong medium type<o:p></o:p></p></div><div><p class=MsoNormal> /dev/drbd1: open failed: Wrong medium type<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Any further ideas/comments/suggestions?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>------------------------------------------------------------------------------------<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>b) how can I gracefully failover to the other node ? Up to now, the only way I<o:p></o:p></p></div><div><p class=MsoNormal> know is forcing the active node to reboot (by entering two subsequent 'reboot'<o:p></o:p></p></div><div><p class=MsoNormal> commands). This however breaks the DRBD synchronization, and I need to <o:p></o:p></p></div><div><p class=MsoNormal> use a fix-split-brain procedure to bring back the DRBD in sync.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal> On the other hand, if I try to stop the corosync service on the active node,<o:p></o:p></p></div><div><p class=MsoNormal> the command takes forever! I understand that the suggested procedure should be<o:p></o:p></p></div><div><p class=MsoNormal> to disconnect all clients from the active node and then stop services, <o:p></o:p></p></div><div><p class=MsoNormal> is it a better approach to shut down the public network interface before<o:p></o:p></p></div><div><p class=MsoNormal> stopping the corosync service (in order to forcibly close client connections)?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>