List:Cluster« Previous MessageNext Message »
From:Tom Hanlon Date:January 7 2010 7:13pm
Subject:Re: MySQL NDB Cluster Table definition manipulation
View as plain text  
Manasi, Andrew,

I am keeping this thread alive because I am curious as well, and along 
the way I might further understand the ndb table structure. So here goes.

More below..

Andrew Hutchings wrote:
> Hello Manasi,
> 
> On Thu, 2010-01-07 at 01:24 -0500, Manasi Save wrote:
>> I think you misunderstood my problem. 
>>
>> I have NDB cluster installed and its fully functional. What I want is I 
>> need to create tables at OS level by copy pasting .frm and .ndb files. 
>> or the way innodb supports overwriting them. 
> 
> MySQL gets ndb scehmas from the data nodes.  This means that tables
> MySQL sees have to be created using the "CREATE TABLE" syntax or it will
> just automatically remove the .frm and .ndb files or errors will occur
> depending on what queries you run.  This is because they reference
> cluster tables which not in the data nodes.
> 
> Kind Regards

I am thinking that the closest you would get in Cluster to the OS 
manipulation of tables in order to quickly manage tables would be an 
NDB_API tool.

Perhaps there is an API method to clone a tablespace.

Back to the internals...


have you looked at the cluster file system while tables are created. It 
looks like a datadictionary is stored and a directory per table. Create 
a cluster table, and you will see a new directory created here..

root@localhost mysql-cluster]# ls -alF ndb_2_fs/D1/DBDICT/
total 64
drwxr-x--- 13 root root  4096 Jan  7 05:00 ./
drwxr-x---  4 root root  4096 Jan  7 04:46 ../
-rw-r--r--  1 root root 12288 Jan  7 05:00 P0.SchemaLog
drwxr-x---  2 root root  4096 Jan  7 04:46 T1/
drwxr-x---  2 root root  4096 Jan  7 04:56 T10/
drwxr-x---  2 root root  4096 Jan  7 05:00 T11/
drwxr-x---  2 root root  4096 Jan  7 04:46 T2/
drwxr-x---  2 root root  4096 Jan  7 04:46 T3/
drwxr-x---  2 root root  4096 Jan  7 04:46 T4/
drwxr-x---  2 root root  4096 Jan  7 04:46 T5/
drwxr-x---  2 root root  4096 Jan  7 04:46 T6/
drwxr-x---  2 root root  4096 Jan  7 04:50 T7/
drwxr-x---  2 root root  4096 Jan  7 04:50 T8/
drwxr-x---  2 root root  4096 Jan  7 04:51 T9/

Have you looked at the output of a cluster backup ?

[root@localhost mysql-cluster]# strings BACKUP/BACKUP-1/BACKUP-1-0.2.Data
NDBBCKUP
REPL$mysql/ndb_schema
mysql/def/ndb_schema
NDB$BLOBEVENT_REPL$mysql/ndb_schema_3
mysql/def/NDB$BLOB_4_3
REPL$cluster/t2
cluster/def/t2
cluster
alter table new engine=ndbcluster
cluster
create table t2 (id int) engine=ndbcluster
cluster
create table t4 (id int) engine=ndbcluster

I doubt these structures are easilly manipulated manually, but that is 
what you would have to do.

--
Tom




-- 

Tom Hanlon
Certified MySQL DBA
Certified Cloudera Certified Hadoop Professional (CCHP)

Thread
MySQL NDB Cluster Table definition manipulationManasi Save31 Dec
  • Re: MySQL NDB Cluster Table definition manipulationPekka Nousiainen31 Dec
    • Re: MySQL NDB Cluster Table definition manipulationTom Hanlon1 Jan
  • Re: MySQL NDB Cluster Table definition manipulationStewart Smith14 Jan
Re: MySQL NDB Cluster Table definition manipulationManasi Save7 Jan
  • Re: MySQL NDB Cluster Table definition manipulationSuresh Kuna7 Jan
Re: MySQL NDB Cluster Table definition manipulationManasi Save7 Jan
  • Re: MySQL NDB Cluster Table definition manipulationSuresh Kuna7 Jan
Re: MySQL NDB Cluster Table definition manipulationManasi Save7 Jan
  • Re: MySQL NDB Cluster Table definition manipulationSuresh Kuna7 Jan
    • Re: MySQL NDB Cluster Table definition manipulationStewart Smith14 Jan
  • Re: MySQL NDB Cluster Table definition manipulationAndrew Hutchings7 Jan
    • Re: MySQL NDB Cluster Table definition manipulationTom Hanlon7 Jan
      • Re: MySQL NDB Cluster Table definition manipulationAndrew Hutchings7 Jan
    • Re: MySQL NDB Cluster Table definition manipulationTom Hanlon7 Jan