MySQL Cluster Replication

220 views Asked by At

I am using docker-compose to create MySQL cluster (NDB). After cluster gets created, I am unable to see data replication when querying through other mysql API node. For example, this is my 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)

So, when I am creating a database from node id = 21, it gets reflected in the output of command

mysql> SHOW DATABASES; 

when the same command is ran on id = 22 But when I create tables and insert rows into the same database, and trying to access it through node id=22, I am getting Empty result-set. I am trying this scenario to test failover of SQL nodes and data replication.

In official documentation, there are some replication settings given according to this

I am not getting how to do this since I am creating all the nodes on the same host machine and I don't want to disturb original mysql configuration of my host machine.

I am using this GIT for testing purpose. Kindly advice how to go ahead with this.

0

There are 0 answers