AOvejero
AOvejero

Reputation: 149

MySQL Cluster Propagation

I created a MySQL Cluster on Ubuntu following the guide: http://bieg.wordpress.com/2008/08/03/mysql-clustering-ubuntu/

I correctly initialize the nodes (a node with MGM and NDBs, and other NDB node) ndb_mgm> show; returns:

Connected to Management Server at: 10.168.222.24:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2    @10.168.222.24  (mysql-5.1.51 ndb-7.1.9, Nodegroup: 0)
id=3    @10.160.91.224  (mysql-5.1.51 ndb-7.1.9, Nodegroup: 0, Master)

[ndb_mgmd(MGM)] 1 node(s)
id=1    @10.168.222.24  (mysql-5.1.51 ndb-7.1.9)

[mysqld(API)]   1 node(s)
id=4    @10.168.222.24  (mysql-5.1.51 ndb-7.1.9)

However, when I go to test the cluster, I created a database on both nodes, but the tables I create in a node doesn't propagate to the other, neither the content.

What could be the problem?

Thank you

Upvotes: 3

Views: 540

Answers (1)

Andrew Morgan
Andrew Morgan

Reputation: 570

By default in MySQL 5.1, tables are created using the MyISAM storage engine (the default changes to InnoDB in MySQL 5.5). Any table that is created using any storage other than ndb/cluster is local to a single MySQL Server.

To have the data stored in the data nodes and hence be visible through all MySQL Servers in the cluster, you need to specify that NDB be used as the storage engine. For example, when creating a table...

CREATE TABLE simples (id INT NOT NULL PRIMARY KEY) ENGINE=ndb;

or to migrate an existing table...

ALTER TABLE simples ENGINE=ndb;

In your case, the output from ndb_mgm is showing that you only have a single MySQL Server, you should edit your config.ini file to define more [mysqld] slots and then start additional mysqld processes.

Why do you believe that the data is stored in just one data node? If you created it with engine=ndb then I'd be pretty certain that it's in both.

Note that the blog post you're following is really out of date (for example, you must not use the MySQL Server you get with "apt-get install mysql-server" but you should instead use the one that is included in the Cluster packages from https://www.mysql.com/downloads/cluster/

Download and use MySQL Cluster 7.2 rather than 7.1.

A much more current set of instructions can be found in http://www.clusterdb.com/mysql-cluster/deploying-mysql-cluster-over-multiple-hosts/

Upvotes: 3

Related Questions