0

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.

Ishan
  • 13
  • 7
  • Do the tables use the NDB storage engine? AFAIK it's the only storage engine that will get replicated. – zmf Dec 03 '20 at 14:29
  • This question has nothing to do with programming, it is about configuring mysql instances for replication. The dba sister site of SO provides support in such questions. – Shadow Dec 03 '20 at 14:33
  • @zmf , Yes That was the problem. I was using InnoDB engine for tables. I did overlook that clause from the documentation somehow. One more small query, if one of the SQL nodes is down, I am not able to connect to the cluster, so how to address this issue in my case? – Ishan Dec 04 '20 at 09:58
  • @Shadow Apologies. I didn't know that there is separate sister website for DBA related support. Actually I am not a DBA, I am just filling in for a DBA. I will take care next time. – Ishan Dec 04 '20 at 10:01

0 Answers0