0

So, I have a cluster of 3 nodes, each in a different data center located in the same city. My architecture is a single primary one where one node (let's call it Node 1) is primary and the other two are secondary nodes.

So, I noticed that the MySQL client is down. I tried to restart it but it failed. When I checked the logs, I saw an error that said: InnoDB: Unable to lock ./ibdata1, error: 11.

At this point, trying to resolve the issue, the only thing that worked for me is when I used lsof -i:3306 and killed the process that was associated with mysqld.

As I expected, killing the mysqld process forced my cluster to switch its primary node from Node 1 to Node 3. Then I used mysqlsh to manage my cluster and used the setPrimaryInstance() method to reswitch from Node 3 back to Node 1, as my primary node.

After doing so, the MySQL client in Node 1 stopped working again and it crashed and can't start again. I have to go through the same process (i.e. kill the process associated with it) for it to work again, which will again switch the primary node.

So, my question is: Is there any way to keep Node 1 as the primary node while MySQL client still works? And why does switching the primary instance make MySQL client go down anyway? I can't understand why it happens.

P.S. I also have mysql router installed on my system. And I am using MySQL version 8.0.25.

1 Answer 1

0

The daemon is called mysqld. This is normally "started" once after booting, probably automatically.

The commandline client is called mysql; this is not a 'service' and does not need sudo.

"Cluster" implies multiple servers. That implies that you must connect to a specific machine (or through a proxy). Running mysql without a -h asks to connect to the instance on the same machine, that is, through a "socket".

If that is not sufficient to figure out what to fix, then please list the machines involved, stating which MySQL component is on which server. Include the client(s), such as mysql, MySQL Shell, and the "automatic scripts".

3
  • Thank you for the clarification. I was already aware of that but unfortunately I did confuse the two in my question. Anyway, the MySQL client does not start when my InnoDB cluster is running and I'm wondering why. Is this normal for an InnoDB cluster? Commented Jun 26, 2021 at 17:10
  • I elaborated...
    – Rick James
    Commented Jun 26, 2021 at 19:07
  • Thanks for your elaboration. I improved my post by taking your points into consideration and I also added more information on what is happening. Commented Jul 6, 2021 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.