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?

1 Answer 1


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.
  • 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.
    – Ishan
    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?
    – mustaccio
    Dec 10, 2020 at 13:04

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.