1

I have problem on slave replication on mysql cluster.

When I create table with select as CREATE TABLE tmp1 AS SELCT * FROM tmp2 the table can be created but the sql is not recorded in binlog and not replicated to slave.

But if I create table by definition or like as: CREATE TABLE tmp1 LIKE tmp2" OR "CREATE TABLEtmp1(idint(11) NOT NULL ), the sql commands can be recorded in binlog and will be replicated to slave.

Is there any setting on this?

My mysql cluster version is 5.6.31-ndb-7.4.12-cluster-gpl-log and my default engine is ndbcluster.

jrbedard
  • 3,662
  • 5
  • 30
  • 34
Yaochun
  • 11
  • 1
  • This is probably what you are running into http://dev.mysql.com/doc/refman/5.7/en/replication-features-create-select.html – alvits Oct 11 '16 at 01:50

1 Answers1

0

If you want to replicate your Table you have to add ENGINE=ndbcluster Like this : CREATE TABLE tmp1 AS SELCT * FROM tmp2 ENGINE=ndbcluster;

For existing tables you can use : ALTER TABLE tbl_name ENGINE=NDBCLUSTER;

More infos here : https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-install-example-data.html

Good luck !

Kenovo
  • 86
  • 1
  • 2