Database created on both nodes but no tables
I wanted to trial the cluster software so have created four new machines and I have used the configurator to build a cluster across these four machines.
If I create a database using cmon it appears on the other data nodes( it also appears if I make it by hand on one of the notes)
Show looks like this
Connected to Management Server at: x.x.x.103:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=3 @x.x.x.105 (mysql-5.1.56 ndb-7.1.18, Nodegroup: 0, Master)
id=4 @x.x.x.108 (mysql-5.1.56 ndb-7.1.18, Nodegroup: 0)
[ndb_mgmd(MGM)] 2 node(s)
id=1 @x.x.x.103 (mysql-5.1.56 ndb-7.1.18)
id=2 @x.x.x.104 (mysql-5.1.56 ndb-7.1.18)
[mysqld(API)] 15 node(s)
id=5 @x.x.x.105 (mysql-5.1.56 ndb-7.1.18)
id=6 @x.x.x.105 (mysql-5.1.56 ndb-7.1.18)
id=7 @x.x.x.105 (mysql-5.1.56 ndb-7.1.18)
id=8 @x.x.x.105 (mysql-5.1.56 ndb-7.1.18)
id=9 @x.x.x.108 (mysql-5.1.56 ndb-7.1.18)
id=10 @x.x.x.108 (mysql-5.1.56 ndb-7.1.18)
id=11 @x.x.x.108 (mysql-5.1.56 ndb-7.1.18)
id=12 @x.x.x.108 (mysql-5.1.56 ndb-7.1.18)
id=13 (not connected, accepting connect from any host)
id=14 (not connected, accepting connect from any host)
id=15 (not connected, accepting connect from any host)
id=16 (not connected, accepting connect from any host)
id=17 @x.x.x.103 (mysql-5.1.39 ndb-7.0.9)
id=18 (not connected, accepting connect from x.x.x.104)
id=19 (not connected, accepting connect from x.x.x.103)
show databases on both of the data node looks identical like this where the new db is s9test
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| ndbinfo |
| s9test |
| test |
+--------------------+
6 rows in set (0.00 sec)
Now if I do something basic like add a table
CREATE TABLE `s9test`.`Notes` ( `NoteID` int(10) unsigned NOT NULL auto_increment, `NoteBody` text, PRIMARY KEY (`NoteID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.01 sec)
The check it with
mysql> show tables;
+------------------+
| Tables_in_s9test |
+------------------+
| Notes |
+------------------+
1 row in set (0.01 sec)
Now if I do that on the other datanode
mysql> use s9test;
Database changed
mysql> show tables;
Empty set (0.00 sec)
Why is this , the database gets created no problem, the tables dont? nor any data.
Do I need something else ?
-
Hi Dave,
Do you have "engine=innodb" written in the SQL file then you have two options:
- sed -i.bak 's#InnoDB#ndbcluster#g' huge.sql
- load in the big dump (in innodb) and then do for all tables:
ALTER TABLE nnnn ENGINE=ndbcluster
(please note that you can leave out the ".bak" after the -i, but i recommend you replace with sed and keep an backup just in case)
If you don't have ENGINE=InnoDB in the SQL dump , your tables are just listed as:
CREATE TABLE (...)
without the ENGINE= suffix then you can add in my.cnf (edit mysqlcluster-71/cluster/config/my.cnf), in the [MYSQLD] group section:
default-storage-engine=ndbcluster
Then stop and start the mysql servers:
./stop-mysqld --hostname=x
./start-mysqld --hostname=x
Please let me know what works for you!
-
Johan,
Thanks, I have tried this on my small test inserts and set the default for the session with
set storage_engine=ndbcluster;
I have modified the engine defaults in my.cnf and restarted the nodes and this all appears to be working.
Great! all that remains is a real sql insert with some proper data.
final question (for now!)
Is there a quick easy way to modify the root mysql password across the cluster, or is it as easy as changing it on one node
Dave
Please sign in to leave a comment.
Comments
5 comments