<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 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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="FR" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<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">I'm having trouble with a MariaDB cluster (2 nodes, master-slave) on Debian 11.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I don't know what to do anymore.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">Environment:<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Node1: <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> OS: Debian 11<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Kernel: 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Versions: resource-agents (4.7.0-1), pacemaker (2.0.5-2), corosync (3.1.2-2), mariadb (10.5.18-0+deb11u1)<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">Node2: <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> OS: Debian 11<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Kernel: 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Versions: resource-agents (4.7.0-1), pacemaker (2.0.5-2), corosync (3.1.2-2), mariadb (10.5.18-0+deb11u1)<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">crm configure show as attachment.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">Problem: <o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US">When I restart Node2 (which is a slave), it goes up correctly in the cluster:<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">$ crm status<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Cluster Summary:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> * Stack: corosync<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> * Current DC: Node1 (version 2.0.5-ba59be7122) - partition with quorum<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> * Last updated: Thu Jan 26 12:04:57 2023<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> * Last change: Thu Jan 26 11:39:58 2023 by root via cibadmin on Node2<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> * 2 nodes configured<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> * 3 resource instances 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">Node List:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> * Online: [ Node1 Node2 ]<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"> * VIP (ocf::heartbeat:IPaddr2): Started Node1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> * Clone Set: MYSQLREPLICATOR [MYSQL] (promotable):<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> * Masters: [ Node1 ]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> * Slaves: [ Node2 ]<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">But it does not retrieve the replication information. (SHOW SLAVE STATUS; returns nothing)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In the Node2 logs, I can see this message that explains that replication is not taking place:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:none">
<tbody>
<tr>
<td width="626" valign="top" style="width:469.8pt;border:solid windowtext 1.0pt;background:black;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="color:white">Jan 25 16:29:38 mysql(MYSQL)[22862]: INFO: No MySQL master present - clearing replication state</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white">Jan 25 16:29:39 mysql(MYSQL)[22862]: WARNING: MySQL Slave IO threads currently not running.</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white">Jan 25 16:29:39 mysql(MYSQL)[22862]: ERROR: MySQL Slave SQL threads currently not running.</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white">Jan 25 16:29:39 mysql(MYSQL)[22862]: ERROR: See for details</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white">Jan 25 16:29:39 mysql(MYSQL)[22862]: ERROR: ERROR 1200 (HY000) at line 1: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO</span><span lang="EN-US"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">From what I see in the following file, Node2 does not seem to find the master name. So it clears its replication information:<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">/usr/lib/ocf/resource.d/heartbeat/mysql<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:none">
<tbody>
<tr>
<td width="626" valign="top" style="width:469.8pt;border:solid windowtext 1.0pt;background:black;padding:0cm 5.4pt 0cm 5.4pt">
<p class="MsoNormal"><span lang="EN-US" style="color:white"> master_host=`echo $OCF_RESKEY_CRM_meta_notify_master_uname|tr -d " "`</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> if [ "$master_host" -a "$master_host" != ${NODENAME} ]; then</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> ocf_log info "Changing MySQL configuration to replicate from $master_host."</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> set_master</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> start_slave</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> if [ $? -ne 0 ]; then</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> ocf_exit_reason "Failed to start slave"</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> return $OCF_ERR_GENERIC</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> fi</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> else</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> ocf_log info "No MySQL master present - clearing replication state"</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> unset_master</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:white"> fi</span><span lang="EN-US"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">As it is a production environment, I performed a bare metal restore of these machines on 2 LAB machines and I have no problem…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In production, there is a lot of writing but the servers are far from being saturated.<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">Thank you in advance for all the help you can give me.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><br>
Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="background:white;border-collapse:collapse">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="line-height:18.75pt"><span style="font-size:13.0pt;color:#1E195A;mso-fareast-language:FR">Thomas Cas</span><span style="color:#3C566A;mso-fareast-language:FR"> </span><span style="font-size:13.0pt;color:#FF7828;mso-fareast-language:FR"> | Technicien
du support infogérance</span><span style="color:#3C566A;mso-fareast-language:FR"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="line-height:18.75pt"><span lang="EN-US" style="font-size:10.0pt;color:#1E195A;mso-fareast-language:FR">PHONE : </span><span lang="EN-US" style="color:black;mso-fareast-language:FR">+33 3 51 25 23 26
</span><span lang="EN-US" style="font-size:10.0pt;color:#002060;mso-fareast-language:FR">WEB :</span><span lang="EN-US" style="color:black;mso-fareast-language:FR"> </span><span style="color:black;mso-fareast-language:FR"><a href="https://www.ikoula.com/en"><span lang="EN-US" style="color:black">www.ikoula.com/en</span></a></span><span lang="EN-US" style="font-size:10.0pt;color:#111111;mso-fareast-language:FR"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="line-height:18.75pt"><span style="font-size:10.0pt;color:#111111;mso-fareast-language:FR">IKOULA Data Center 34 rue Pont Assy - 51100 Reims - FRANCE</span><span style="mso-fareast-language:FR"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="line-height:21.0pt"><span lang="EN-US" style="font-size:10.0pt;color:#336600;mso-fareast-language:FR">Before printing this letter, think about the impact on the environment!</span><span lang="EN-US" style="color:#3C566A;mso-fareast-language:FR"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:FR"><o:p> </o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="background:white;border-collapse:collapse">
<tbody>
<tr>
<td valign="bottom" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="color:black"><a href="https://www.ikoula.com/en"><span style="color:#428BCA;mso-fareast-language:FR;text-decoration:none"><img border="0" width="268" height="91" style="width:2.7916in;height:.9479in" id="Image_x0020_1" src="cid:image001.png@01D9317E.18E40FA0" alt="Ikoula"></span></a></span><span style="color:black;mso-fareast-language:FR"> </span><span style="mso-fareast-language:FR"><o:p></o:p></span></p>
</td>
<td valign="bottom" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:22.5pt"><span style="color:black"><a href="https://twitter.com/ikoula_en" title="Twitter Ikoula"><span style="color:#428BCA;mso-fareast-language:FR;text-decoration:none"><img border="0" width="24" height="24" style="width:.25in;height:.25in" id="Image_x0020_2" src="cid:image002.png@01D9317E.18E40FA0" alt="Twitter"></span></a></span><span style="color:#3C566A;mso-fareast-language:FR"> </span><span style="color:black"><a href="https://www.linkedin.com/company/ikoula" title="Linkedin Ikoula"><span style="color:#428BCA;mso-fareast-language:FR;text-decoration:none"><img border="0" width="24" height="24" style="width:.25in;height:.25in" id="Image_x0020_3" src="cid:image003.png@01D9317E.18E40FA0" alt="Linkedin"></span></a></span><span style="color:#3C566A;mso-fareast-language:FR"> </span><span style="color:black"><a href="http://www.youtube.fr/ikoulanet" title="YouTube Ikoula"><span style="color:#428BCA;mso-fareast-language:FR;text-decoration:none"><img border="0" width="24" height="24" style="width:.25in;height:.25in" id="Image_x0020_4" src="cid:image004.png@01D9317E.18E40FA0" alt="Youtube"></span></a></span><span style="color:#3C566A;mso-fareast-language:FR"> </span><span style="color:black"><a href="https://pressroom.ikoula.com/" title="Pressroom Ikoula"><span style="color:#428BCA;mso-fareast-language:FR;text-decoration:none"><img border="0" width="24" height="24" style="width:.25in;height:.25in" id="Image_x0020_5" src="cid:image005.png@01D9317E.18E40FA0" alt="Pressroom"></span></a></span><span style="color:#3C566A;mso-fareast-language:FR"> </span><span style="color:black"><a href="https://blog.ikoula.com/en" title="Blog Ikoula"><span style="color:#428BCA;mso-fareast-language:FR;text-decoration:none"><img border="0" width="24" height="24" style="width:.25in;height:.25in" id="Image_x0020_6" src="cid:image006.png@01D9317E.18E40FA0" alt="Blog"></span></a></span><span style="color:#3C566A;mso-fareast-language:FR"> <o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>