0

I am using docker-compose to create MySQL cluster (NDB). After cluster gets created. This is my cluster configuration:

ndb_mgm> show
Connected to Management Server at: mysql-manager-1:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=11 @172.xx.0.5 (mysql-5.7.25 ndb-7.6.9, Nodegroup: 0, *)
id=12 @172.xx.0.8 (mysql-5.7.25 ndb-7.6.9, Nodegroup: 0)
[ndb_mgmd(MGM)] 2 node(s)
id=1 @172.xx.0.2 (mysql-5.7.25 ndb-7.6.9)
id=2 @172.xx.0.3 (mysql-5.7.25 ndb-7.6.9)
[mysqld(API)] 2 node(s)
id=21 @172.xx.0.4 (mysql-5.7.25 ndb-7.6.9)
id=22 @172.xx.0.7 (mysql-5.7.25 ndb-7.6.9)

When I bring down one of the SQL nodes, the cluster becomes unreachable.

E.g when node with id=21 is shut down, data should still be accessible from node id=22 because all other data nodes and management nodes are up and running.

Is this behavior supported out of the box or I have to make some configuration change for it?

I have gone through the MySQL documentation.

Am I referring to the correct documentation?

They advise executing the steps on the host machine but in my case each node is deployed as a separate docker container. How do I achieve this failover in my case?

Hannah Vernon
71.1k22 gold badges178 silver badges323 bronze badges
asked Dec 4, 2020 at 11:00

1 Answer 1

0

You may have set up replication, but failover doesn't just magically happen by itself. You need also

  1. Some kind of cluster manager to notice the failure and initiate the failover procedure.
  2. Complete the failover procedure and ensure that the new master is operational. Part of the process is described here.
  3. A floating IP address or some sort of connection proxy to direct incoming connections to the new master.
answered Dec 4, 2020 at 21:03
2
  • Could you please explain point no 3. As per my limited understanding, incoming connections come to SQL node and I want to setup HA and failover for SQL nodes so that even if one goes down other can take up the load. Kindly throw some light on this. Commented Dec 10, 2020 at 3:56
  • Nodes have unique IP addresses and host names, don't they. So how would the clients know to which node to connect after the failover? Commented Dec 10, 2020 at 13:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.