<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:等线;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@等线";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;}
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:0cm;
margin-bottom:.0001pt;
text-indent:21.0pt;
font-size:12.0pt;
font-family:宋体;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:宋体;}
span.EmailStyle18
{mso-style-type:personal;
font-family:等线;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:等线;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:2035231219;
mso-list-type:hybrid;
mso-list-template-ids:1549279154 1497636632 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:"\(%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:18.0pt;
text-indent:-18.0pt;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-text:"%2\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:42.0pt;
text-indent:-21.0pt;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
margin-left:63.0pt;
text-indent:-21.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:84.0pt;
text-indent:-21.0pt;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-text:"%5\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:105.0pt;
text-indent:-21.0pt;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
margin-left:126.0pt;
text-indent:-21.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:147.0pt;
text-indent:-21.0pt;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-text:"%8\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
margin-left:168.0pt;
text-indent:-21.0pt;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
margin-left:189.0pt;
text-indent:-21.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="ZH-CN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Hi Marek and all,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">I use the following command to create a stonith resource in virtualbox</span><span style="font-size:10.5pt;font-family:等线">(<span lang="EN-US">centos7</span>)<span lang="EN-US">which
has no /dev/mapper/fence:<o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Courier New"">p<b>cs stonith create scsi-stonith-device fence_scsi devices=/dev/mapper/fence pcmk_monitor_action=metadata pcmk_reboot_action=off pcmk_host_list="node1 node2" meta provides=unfencing;</b></span><span lang="EN-US" style="font-size:10.5pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">The stonith resource status could be “started” in 2017 and I think that it is because I use the metadata. But when I install a new VM this year and create the stonith again using
the same command. It always be stopped status. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">I try many times and here are current situation:<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
<![if !supportLists]><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><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:10.5pt;font-family:等线">I created a cluster in 2017 in VM using the following command in CENTOS7. The stonith status is started until now.
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
<![if !supportLists]><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><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:10.5pt;font-family:等线">I created a cluster today in VM using the following command in CENTOS7. The stonith status is always stopped.
<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:18.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
<![if !supportLists]><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><span style="mso-list:Ignore">(3)<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US" style="font-size:10.5pt;font-family:等线">I created a cluster today in VM using the following command in REDHAT7. The stonith status could be started.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">I compare the /usr/sbin/fence_scsi file in different node and it has no logic change.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Why could the Stonith resource could be started? How should I debug it?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Here is my command:<o:p></o:p></span></p>
<p class="MsoNormal"><i><u><span lang="EN-US" style="font-size:10.5pt;font-family:"Courier New"">systemctl stop firewalld;chkconfig firewalld off;<o:p></o:p></span></u></i></p>
<p class="MsoNormal"><i><u><span lang="EN-US" style="font-size:10.5pt;font-family:"Courier New""><o:p><span style="text-decoration:none"> </span></o:p></span></u></i></p>
<p class="MsoNormal"><i><u><span lang="EN-US" style="font-size:10.5pt;font-family:"Courier New"">yum install -y corosync pacemaker pcs gfs2-utils lvm2-cluster *scsi* python-clufter;</span></u></i><i><u><span lang="EN-US" style="font-size:10.5pt"><o:p></o:p></span></u></i></p>
<p class="MsoNormal"><i><u><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p><span style="text-decoration:none"> </span></o:p></span></u></i></p>
<p class="MsoNormal"><i><u><span lang="EN-US" style="font-size:10.5pt;font-family:"Courier New"">pcs cluster auth node1 node2 node3 -u hacluster;pcs cluster setup --name cluster_pgsql node1 node2 node3;pcs cluster start --all;pcs property set no-quorum-policy=freeze;pcs
property set stonith-enabled=true;</span></u></i><i><u><span lang="EN-US" style="font-size:10.5pt"><o:p></o:p></span></u></i></p>
<p class="MsoNormal"><i><u><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p><span style="text-decoration:none"> </span></o:p></span></u></i></p>
<p class="MsoNormal"><i><u><span lang="EN-US" style="font-size:10.5pt;font-family:"Courier New"">p<b>cs stonith create scsi-stonith-device fence_scsi devices=/dev/mapper/fence pcmk_monitor_action=metadata pcmk_reboot_action=off pcmk_host_list="node1 node2"
meta provides=unfencing;</b></span></u></i><i><u><span lang="EN-US" style="font-size:10.5pt"><o:p></o:p></span></u></i></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Here is the log:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 crmd[2215]: notice: Requesting fencing (on) of node db1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: notice: Client crmd.2215.c5d11cbe wants to fence (on) 'db2' with device '(any)'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: notice: Requesting peer fencing (on) of db2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: notice: Client crmd.2215.c5d11cbe wants to fence (on) 'db1' with device '(any)'<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: notice: Requesting peer fencing (on) of db1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: notice: scsi-stonith-device can fence (on) db1: static-list<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: notice: scsi-stonith-device can fence (on) db1: static-list<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 fence_scsi: Failed: device "/dev/mapper/fence" does not exist<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 fence_scsi: Please use '-h' for usage<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: warning: fence_scsi[9072] stderr: [ WARNING:root:Parse error: Ignoring unknown option 'port=db1' ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: warning: fence_scsi[9072] stderr: [ ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: warning: fence_scsi[9072] stderr: [ ERROR:root:Failed: device "/dev/mapper/fence" does not exist ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: warning: fence_scsi[9072] stderr: [ ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: warning: fence_scsi[9072] stderr: [ Failed: device "/dev/mapper/fence" does not exist ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: warning: fence_scsi[9072] stderr: [ ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: warning: fence_scsi[9072] stderr: [ ERROR:root:Please use '-h' for usage ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: warning: fence_scsi[9072] stderr: [ ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: warning: fence_scsi[9072] stderr: [ Please use '-h' for usage ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:55:08 db1 stonith-ng[2211]: warning: fence_scsi[9072] stderr: [ ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:59:11 db1 rsyslogd: [origin software="rsyslogd" swVersion="7.4.7" x-pid="627" x-info="http://www.rsyslog.com"] start<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Feb 26 03:59:12 db1 rsyslogd-2027: imjournal: fscanf on state file `/var/lib/rsyslog/imjournal.state' failed<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">[try http://www.rsyslog.com/e/2027 ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:等线">发件人<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:11.0pt;font-family:等线">
</span><span style="font-size:11.0pt;font-family:等线">范国腾<span lang="EN-US"> <br>
</span><b>发送时间<span lang="EN-US">:</span></b><span lang="EN-US"> 2018</span>年<span lang="EN-US">2</span>月<span lang="EN-US">11</span>日<span lang="EN-US"> 15:43<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> Cluster Labs - All topics related to open-source clustering welcomed <users@clusterlabs.org><br>
</span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> </span>答复<span lang="EN-US">: [ClusterLabs]
</span>答复<span lang="EN-US">: How to create the stonith resource in virtualbox<o:p></o:p></span></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Marek,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线">Thank you very much for your help. I add the
</span><span style="font-size:10.5pt;font-family:等线">“</span><span lang="EN-US">pcmk_monitor_action=metadata</span>”<span lang="EN-US">and the stonith could work now.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:等线">发件人<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:11.0pt;font-family:等线"> Users [<a href="mailto:users-bounces@clusterlabs.org">mailto:users-bounces@clusterlabs.org</a>]
</span><b><span style="font-size:11.0pt;font-family:等线">代表 </span></b><span lang="EN-US" style="font-size:11.0pt;font-family:等线">Marek Grac<br>
</span><b><span style="font-size:11.0pt;font-family:等线">发送时间<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:11.0pt;font-family:等线"> 2018</span><span style="font-size:11.0pt;font-family:等线">年<span lang="EN-US">2</span>月<span lang="EN-US">9</span>日<span lang="EN-US">
16:38<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> Cluster Labs - All topics related to open-source clustering welcomed <<a href="mailto:users@clusterlabs.org">users@clusterlabs.org</a>><br>
</span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> Re: [ClusterLabs] </span>
答复<span lang="EN-US">: How to create the stonith resource in virtualbox<o:p></o:p></span></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">for fence_vbox take a look at my older blogpost> <a href="https://ox.sk/howto-fence-vbox-cdd3da374ecd">https://ox.sk/howto-fence-vbox-cdd3da374ecd</a><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">if all you need is to have fencing in a state when dlm works and you promise that you will never have real data on it. There is an easy hack, it really does not matter which fence agent you use. All we care about is if
action 'monitor' works, so add option><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">pcmk_monitor_action=metadata<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">It means that instead of monitor action, you will use action 'metadata' which just prints XML metadata and succeed.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">m,<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On Fri, Feb 9, 2018 at 6:33 AM, </span>范国腾<span lang="EN-US"> <<a href="mailto:fanguoteng@highgo.com" target="_blank">fanguoteng@highgo.com</a>> wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US">Thank Klaus,<br>
<br>
The information is very helpful. I try to study the fence_vbox and the fence_sdb.<br>
<br>
In our test lab, we use ipmi as the stonith. But I want to setup a simulator environment in my laptop. So I just need the stonith resource in start state so that I could create dlm and clvm resource.And I don't need it relally work. Do anybody have other suggestion?<br>
<br>
<br>
-----</span>邮件原件<span lang="EN-US">-----<br>
</span>发件人<span lang="EN-US">: Users [mailto:<a href="mailto:users-bounces@clusterlabs.org">users-bounces@clusterlabs.org</a>]
</span>代表<span lang="EN-US"> Klaus Wenninger<br>
</span>发送时间<span lang="EN-US">: 2018</span>年<span lang="EN-US">2</span>月<span lang="EN-US">9</span>日<span lang="EN-US"> 1:11<br>
</span>收件人<span lang="EN-US">: <a href="mailto:users@clusterlabs.org">users@clusterlabs.org</a><br>
</span>主题<span lang="EN-US">: Re: [ClusterLabs] How to create the stonith resource in virtualbox<o:p></o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US"><br>
On 02/08/2018 02:05 PM, Andrei Borzenkov wrote:<br>
> On Thu, Feb 8, 2018 at 5:51 AM, </span>范国腾<span lang="EN-US"> <<a href="mailto:fanguoteng@highgo.com">fanguoteng@highgo.com</a>> wrote:<br>
>> Hello,<br>
>><br>
>> I setup the pacemaker cluster using virtualbox. There are three nodes. The OS is centos7, the /dev/sdb is the shared storage</span>(<span lang="EN-US">three nodes use the same disk file</span>)<span lang="EN-US">.<br>
>><br>
>> (1) At first, I create the stonith using this command:<br>
>> pcs stonith create scsi-stonith-device fence_scsi<br>
>> devices=/dev/mapper/fence pcmk_monitor_action=metadata<br>
>> pcmk_reboot_action=off pcmk_host_list="db7-1 db7-2 db7-3" meta<br>
>> provides=unfencing;<br>
>><br>
>> I know the VM not have the /dev/mapper/fence. But sometimes the stonith resource able to start, sometimes not. Don't know why. It is not stable.<br>
>><br>
> It probably tries to check resource and fails. State of stonith<br>
> resource is irrelevant for actual fencing operation (this resource is<br>
> only used for periodical check, not for fencing itself).<br>
><br>
>> (2) Then I use the following command to setup stonith using the shared disk /dev/sdb:<br>
>> pcs stonith create scsi-shooter fence_scsi<br>
>> devices=/dev/disk/by-id/ata-VBOX_HARDDISK_VBc833e6c6-af12c936 meta<br>
>> provides=unfencing<br>
>><br>
>> But the stonith always be stopped and the log show:<br>
>> Feb 7 15:45:53 db7-1 stonith-ng[8166]: warning: fence_scsi[8197]<br>
>> stderr: [ Failed: nodename or key is required ]<br>
>><br>
> Well, you need to provide what is missing - your command did not<br>
> specify any host.<br>
><br>
>> Could anyone help tell what is the correct command to setup the stonith in VM and centos? Is there any document to introduce this so that I could study it?<br>
<br>
I personally don't have any experience setting up a pacemaker-cluster in vbox.<br>
<br>
Thus I'm limited to giving rather general advice.<br>
<br>
What you might have to assure together with fence_scsi is if the scsi-emulation vbox offers lives up to the requirements of fence_scsi.<br>
I've read about troubles in a posting back from 2015. The guy then went for using scsi via iSCSI.<br>
<br>
Otherwise you could look for alternatives to fence_scsi.<br>
<br>
One might be fence_vbox. It doesn't come with centos so far iirc but the upstream repo on github has it.<br>
Fencing via the hypervisor is in general not a bad idea when it comes to clusters running in VMs (If you can live with the boundary conditions like giving certain credentials to the VMs that allow communication with the hypervisor.).<br>
There was some discussion about fence_vbox on the clusterlabs-list a couple of months ago. iirc there had been issues with using windows as a host for vbox - but I guess they were fixed in the course of this discussion.<br>
<br>
Another way of doing fencing via a shared disk is fence_sbd (available in centos) - although quite different from how fence_scsi is using the disk. One difference that might be helpful here is that it has less requirements on which disk-infrastructure is emulated.<br>
On the other hand it is strongly advised for sbd in general to use a good watchdog device (one that brings down your machine - virtual or physical - in a very reliable manner). And afaik the only watchdog-device available inside a vbox VM is softdog that doesn't
meet this requirement too well as it relies on the kernel running in the VM to be at least partially functional.<br>
<br>
Sorry for not being able to help in a more specific way but I would be interested in which ways of fencing people are using when it comes to clusters based on vbox VMs myself ;-)<br>
<br>
Regards,<br>
Klaus<br>
>><br>
>><br>
>> Thanks<br>
>><br>
>><br>
>> Here is the cluster status:<br>
>> [root@db7-1 ~]# pcs status<br>
>> Cluster name: cluster_pgsql<br>
>> Stack: corosync<br>
>> Current DC: db7-2 (version 1.1.16-12.el7_4.7-94ff4df) - partition<br>
>> with quorum Last updated: Wed Feb 7 16:27:13 2018 Last change: Wed<br>
>> Feb 7 15:42:38 2018 by root via cibadmin on db7-1<br>
>><br>
>> 3 nodes configured<br>
>> 1 resource configured<br>
>><br>
>> Online: [ db7-1 db7-2 db7-3 ]<br>
>><br>
>> Full list of resources:<br>
>><br>
>> scsi-shooter (stonith:fence_scsi): Stopped<br>
>><br>
>> Daemon Status:<br>
>> corosync: active/disabled<br>
>> pacemaker: active/disabled<br>
>> pcsd: active/enabled<br>
>> _______________________________________________<br>
>> Users mailing list: <a href="mailto:Users@clusterlabs.org">Users@clusterlabs.org</a><br>
>> <a href="http://lists.clusterlabs.org/mailman/listinfo/users" target="_blank">
http://lists.clusterlabs.org/mailman/listinfo/users</a><br>
>><br>
>> Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a> Getting started:<br>
>> <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">
http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
>> Bugs: <a href="http://bugs.clusterlabs.org" target="_blank">http://bugs.clusterlabs.org</a><br>
> _______________________________________________<br>
> Users mailing list: <a href="mailto:Users@clusterlabs.org">Users@clusterlabs.org</a><br>
> <a href="http://lists.clusterlabs.org/mailman/listinfo/users" target="_blank">http://lists.clusterlabs.org/mailman/listinfo/users</a><br>
><br>
> Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a> Getting started:<br>
> <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">
http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
> Bugs: <a href="http://bugs.clusterlabs.org" target="_blank">http://bugs.clusterlabs.org</a><br>
<br>
_______________________________________________<br>
Users mailing list: <a href="mailto:Users@clusterlabs.org">Users@clusterlabs.org</a>
<a href="http://lists.clusterlabs.org/mailman/listinfo/users" target="_blank">http://lists.clusterlabs.org/mailman/listinfo/users</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a> Getting started:
<a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">
http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://bugs.clusterlabs.org" target="_blank">http://bugs.clusterlabs.org</a><br>
_______________________________________________<br>
Users mailing list: <a href="mailto:Users@clusterlabs.org">Users@clusterlabs.org</a><br>
<a href="http://lists.clusterlabs.org/mailman/listinfo/users" target="_blank">http://lists.clusterlabs.org/mailman/listinfo/users</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">
http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://bugs.clusterlabs.org" target="_blank">http://bugs.clusterlabs.org</a><o:p></o:p></span></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</div>
</body>
</html>