<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=gb2312">
<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;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:等线;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
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.EmailStyle19
{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;}
--></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="#0563C1" vlink="#954F72" style="text-justify-trim:punctuation">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hello,<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">In my test environment, I meet one issue about the pacemaker: when a new node is added in the cluster, the master node restart. This issue will lead to the system out of service for a while when adding a new node because
there is no master node. Could you please help tell how to debug such issue? <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">I have a pacemaker master/slave cluster as below. pgsql-ha is a resource. I copy the script from /usr/lib/ocf/resource.d/heartbeat/Dumy and add some simple codes to make it support promote/demote.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Now when I run </span>“<span lang="EN-US">pcs cluster stop</span>”<span lang="EN-US"> on db1,the db1 is stopped status and db2 is still master.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The problem is: when I run </span>“<span lang="EN-US">pcs cluster start</span>”<span lang="EN-US"> on db1.The db2 status changes as below: master -> slave->stop->slave->master. Why does db2 restart?<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">CENTOS7:<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">2 nodes and 7 resources configured<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">Online: [ db1 db2 ]<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">Full list of resources:<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">Clone Set: dlm-clone [dlm]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Started: [ db1 db2 ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Clone Set: clvmd-clone [clvmd]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Started: [ db1 db2 ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">scsi-stonith-device (stonith:fence_scsi): Started db2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Master/Slave Set: pgsql-ha [pgsqld]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Masters: [ db2 ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> Slaves: [ db1 ]<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">Daemon Status:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> corosync: active/enabled<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> pacemaker: active/enabled<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> pcsd: active/enabled<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">[root@db1 heartbeat]#<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">/var/log/messages:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:52:50 db2 cib[3290]: notice: Purged 1 peers with id=1 and/or uname=db1 from the membership cache<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:52:51 db2 kernel: dlm: closing connection to node 1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:52:51 db2 corosync[3268]: [TOTEM ] A new membership (192.168.199.199:372) was formed. Members left: 1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:52:51 db2 corosync[3268]: [QUORUM] Members[1]: 2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:52:51 db2 corosync[3268]: [MAIN ] Completed service synchronization, ready to provide service.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:52:51 db2 crmd[3295]: notice: Node db1 state is now lost<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:52:51 db2 crmd[3295]: notice: do_shutdown of peer db1 is complete<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:52:51 db2 pacemakerd[3289]: notice: Node db1 state is now lost<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:52:57 db2 Doctor(pgsqld)[6671]: INFO: pgsqld monitor : 8<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:12 db2 Doctor(pgsqld)[6681]: INFO: pgsqld monitor : 8<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:27 db2 Doctor(pgsqld)[6746]: INFO: pgsqld monitor : 8<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 corosync[3268]: [TOTEM ] A new membership (192.168.199.197:376) was formed. Members joined: 1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 corosync[3268]: [QUORUM] Members[2]: 1 2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 corosync[3268]: [MAIN ] Completed service synchronization, ready to provide service.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 crmd[3295]: notice: Node db1 state is now member<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 pacemakerd[3289]: notice: Node db1 state is now member<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 crmd[3295]: notice: do_shutdown of peer db1 is complete<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 crmd[3295]: notice: State transition S_IDLE -> S_INTEGRATION<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 pengine[3294]: notice: Calculated transition 17, saving inputs in /var/lib/pacemaker/pengine/pe-input-116.bz2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 crmd[3295]: notice: Transition 17 (Complete=0, Pending=0, Fired=0, Skipped=0, Incomplete=0, Source=/var/lib/pacemaker/pengine/pe-input-116.bz2): Complete<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 crmd[3295]: notice: State transition S_TRANSITION_ENGINE -> S_IDLE<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 stonith-ng[3291]: notice: Node db1 state is now member<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 attrd[3293]: notice: Node db1 state is now member<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:33 db2 cib[3290]: notice: Node db1 state is now member<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:34 db2 crmd[3295]: notice: State transition S_IDLE -> S_INTEGRATION<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 db2 crmd[3295]: warning: No reason to expect node 2 to be down<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:38 db2 pengine[3294]: notice: Unfencing db1: node discovery<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:38 db2 pengine[3294]: notice: Start dlm:1#011(db1)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:38 db2 pengine[3294]: notice: Start clvmd:1#011(db1)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:38 db2 pengine[3294]: notice: Restart pgsqld:0#011(Master db2)<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"><o:p> </o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-family:"Courier New"">/var/log/cluster/corosync.log</span><span lang="EN-US" style="font-family:宋体">:<o:p></o:p></span></p>
<p class="MsoNormal" align="left" style="text-align:left"><span lang="EN-US" style="font-family:宋体"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_process_request: Completed cib_modify operation for section status: OK (rc=0, origin=db2/crmd/99, version=0.60.29)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_process_request: Forwarding cib_delete operation for section //node_state[@uname='db2']/lrm to all (origin=local/crmd/100)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3295] db2 crmd: info: do_state_transition: State transition S_FINALIZE_JOIN -> S_POLICY_ENGINE | input=I_FINALIZED cause=C_FSA_INTERNAL origin=check_join_state<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3295] db2 crmd: info: abort_transition_graph: Transition aborted: Peer Cancelled | source=do_te_invoke:161 complete=true<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3293] db2 attrd: info: attrd_client_refresh: Updating all attributes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3293] db2 attrd: info: write_attribute: Sent update 12 with 2 changes for shutdown, id=<n/a>, set=(null)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3293] db2 attrd: info: write_attribute: Sent update 13 with 1 changes for last-failure-pgsqld, id=<n/a>, set=(null)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3293] db2 attrd: info: write_attribute: Sent update 14 with 2 changes for terminate, id=<n/a>, set=(null)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3293] db2 attrd: info: write_attribute: Sent update 15 with 1 changes for fail-count-pgsqld, id=<n/a>, set=(null)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_process_request: Forwarding cib_modify operation for section status to all (origin=local/crmd/101)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_perform_op: Diff: --- 0.60.29 2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_perform_op: Diff: +++ 0.60.30 (null)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_perform_op: -- /cib/status/node_state[@id='2']/lrm[@id='2']<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_perform_op: + /cib: @num_updates=30<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3295] db2 crmd: warning: match_down_event: No reason to expect node 2 to be down<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3295] db2 crmd: info: abort_transition_graph: Transition aborted by deletion of lrm[@id='2']: Resource state removal | cib=0.60.30 source=abort_unless_down:343 path=/cib/status/node_state[@id='2']/lrm[@id='2']
complete=true<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_process_request: Completed cib_delete operation for section //node_state[@uname='db2']/lrm: OK (rc=0, origin=db2/crmd/100, version=0.60.30)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_perform_op: Diff: --- 0.60.30 2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_perform_op: Diff: +++ 0.60.31 (null)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_perform_op: + /cib: @num_updates=31<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_perform_op: + /cib/status/node_state[@id='2']: @crm-debug-origin=do_lrm_query_internal<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Dec 27 00:53:37 [3290] db2 cib: info: cib_perform_op: ++ /cib/status/node_state[@id='2']: <lrm id="2"/><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">I use this command to create the resource:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">pcs resource create pgsqld ocf:heartbeat:Doctor op start timeout=60s op stop timeout=60s op promote timeout=30s op demote timeout=120s op monitor interval=15s timeout=10s role="Master" op monitor interval=16s timeout=10s
role="Slave" op notify timeout=60s; pcs resource master pgsql-ha pgsqld notify=true;pcs constraint order start clvmd-clone then pgsql-ha;<o:p></o:p></span></p>
</div>
</body>
</html>