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.
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
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/
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
alter table new engine=ndbcluster
create table t2 (id int) engine=ndbcluster
create table t4 (id int) engine=ndbcluster
I doubt these structures are easilly manipulated manually, but that is
what you would have to do.
Certified MySQL DBA
Certified Cloudera Certified Hadoop Professional (CCHP)