cluster-7.2 $ mkdir cluster-data cluster-7.2 $ mkdir data cluster-7.2 $ ./scripts/mysql_install_db Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: ./bin/mysqladmin -u root password 'new-password' ./bin/mysqladmin -u root -h prosimmon.local password 'new-password' Alternatively you can run: ./bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd . ; ./bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd ./mysql-test ; perl mysql-test-run.pl Please report any problems with the ./bin/mysqlbug script! cluster-7.2 $ cat cluster_1.ini [ndb_mgmd] Hostname=127.0.0.1 Datadir=/Users/kolbe/Devel/mysql/cluster-7.2/cluster-data NodeId=1 [ndbd default] Datadir=/Users/kolbe/Devel/mysql/cluster-7.2/cluster-data NoOfReplicas=2 Hostname=127.0.0.1 [ndbd] NodeId=3 [ndbd] NodeId=4 [mysqld] NodeId=11 [mysqld] NodeId=12 cluster-7.2 $ ./bin/ndb_mgmd -f ./cluster_1.ini --initial MySQL Cluster Management Server mysql-5.5.16 ndb-7.2.2 cluster-7.2 $ ./bin/ndbd --initial 2012-02-11 08:19:40 [ndbd] INFO -- Angel connected to 'localhost:1186' 2012-02-11 08:19:40 [ndbd] INFO -- Angel allocated nodeid: 3 cluster-7.2 $ ./bin/ndbd --initial 2012-02-11 08:19:43 [ndbd] INFO -- Angel connected to 'localhost:1186' 2012-02-11 08:19:43 [ndbd] INFO -- Angel allocated nodeid: 4 cluster-7.2 $ ./bin/ndb_mgm -e 'all status' Connected to Management Server at: localhost:1186 Node 3: started (mysql-5.5.16 ndb-7.2.2) Node 4: started (mysql-5.5.16 ndb-7.2.2) cluster-7.2 $ ./bin/ndb_show_tables id type state logging database schema name 1 0 Online - DEFAULT-HASHMAP-240-2 3 SystemTable Online Yes sys def NDB$EVENTS_0 2 SystemTable Online Yes sys def SYSTAB_0 NDBT_ProgramExit: 0 - OK cluster-7.2 $ ./bin/mysqld_safe & [1] 4532 cluster-7.2 $ 120211 08:24:21 mysqld_safe Logging to '/Users/kolbe/Devel/mysql/cluster-7.2/data/prosimmon.local.err'. 120211 08:24:21 mysqld_safe Starting mysqld daemon with databases from /Users/kolbe/Devel/mysql/cluster-7.2/data cluster-7.2 $ ./bin/mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.16-ndb-7.2.2-gpl-log MySQL Cluster Community Server (GPL) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> show tables; Empty set (0.05 sec) mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> create table c1 (id int) engine=ndbcluster; Query OK, 0 rows affected (0.25 sec) mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> insert into c1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); Query OK, 10 rows affected (0.00 sec) Records: 10 Duplicates: 0 Warnings: 0 mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> select count(*) from ndbinfo.nodes; +----------+ | count(*) | +----------+ | 2 | +----------+ 1 row in set (0.01 sec) mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> select count(*) from information_schema.partitions where table_name='c1' and table_schema='test'; +----------+ | count(*) | +----------+ | 2 | +----------+ 1 row in set (0.01 sec) mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> flush tables; Query OK, 0 rows affected (0.00 sec) mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> quit Bye cluster-7.2 $ ./bin/mysqladmin shutdown 120211 08:25:25 mysqld_safe mysqld from pid file /Users/kolbe/Devel/mysql/cluster-7.2/data/prosimmon.local.pid ended [1]+ Done ./bin/mysqld_safe cluster-7.2 $ ./bin/ndb_desc -p -d test c1 -- c1 -- Version: 1 Fragment type: 9 K Value: 6 Min load factor: 78 Max load factor: 80 Temporary table: no Number of attributes: 2 Number of primary keys: 1 Length of frm data: 203 Row Checksum: 1 Row GCI: 1 SingleUserMode: 0 ForceVarPart: 1 FragmentCount: 2 ExtraRowGciBits: 0 ExtraRowAuthorBits: 0 TableStatus: Retrieved -- Attributes -- id Int NULL AT=FIXED ST=MEMORY $PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR -- Indexes -- PRIMARY KEY($PK) - UniqueHashIndex -- Per partition info -- Partition Row count Commit count Frag fixed memory Frag varsized memory Extent_space Free extent_space 0 6 6 32768 0 0 0 1 4 4 32768 0 0 0 NDBT_ProgramExit: 0 - OK cluster-7.2 $ jobs cluster-7.2 $ ./bin/ndb_mgm -- NDB Cluster -- Management Client -- ndb_mgm> start backup Connected to Management Server at: localhost:1186 Waiting for completed, this may take several minutes Node 3: Backup 1 started from node 1 ndb_mgm> Node 3: Backup 1 started from node 1 completed StartGCP: 63 StopGCP: 66 #Records: 2069 #LogRecords: 0 Data: 52048 bytes Log: 0 bytes ndb_mgm> shutdown Connected to Management Server at: localhost:1186 Node 3: Cluster shutdown initiated Node 4: Cluster shutdown initiated Node 3: Node shutdown completed. Node 4: Node shutdown completed. 3 NDB Cluster node(s) have shutdown. Disconnecting to allow management server to shutdown. ndb_mgm> quit cluster-7.2 $ ps aux | grep mgmd kolbe 4684 0.0 0.0 2435492 0 s004 R+ 8:27AM 0:00.00 grep mgmd cluster-7.2 $ rm -r data cluster-7.2 $ mkdir data cluster-7.2 $ ./scripts/mysql_install_db Installing MySQL system tables... OK Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: ./bin/mysqladmin -u root password 'new-password' ./bin/mysqladmin -u root -h prosimmon.local password 'new-password' Alternatively you can run: ./bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd . ; ./bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd ./mysql-test ; perl mysql-test-run.pl Please report any problems with the ./bin/mysqlbug script! cluster-7.2 $ cat cluster_2.ini [ndb_mgmd] Hostname=127.0.0.1 Datadir=/Users/kolbe/Devel/mysql/cluster-7.2/cluster-data NodeId=1 [ndbd default] Datadir=/Users/kolbe/Devel/mysql/cluster-7.2/cluster-data NoOfReplicas=2 Hostname=127.0.0.1 [ndbd] NodeId=3 [ndbd] NodeId=4 [ndbd] NodeId=5 [ndbd] NodeId=6 [mysqld] NodeId=11 [mysqld] NodeId=12 cluster-7.2 $ ./bin/ndb_mgmd -f ./cluster_2.ini --initial MySQL Cluster Management Server mysql-5.5.16 ndb-7.2.2 cluster-7.2 $ ./bin/ndbd --initial 2012-02-11 08:28:34 [ndbd] INFO -- Angel connected to 'localhost:1186' 2012-02-11 08:28:34 [ndbd] INFO -- Angel allocated nodeid: 3 cluster-7.2 $ ./bin/ndbd --initial 2012-02-11 08:28:35 [ndbd] INFO -- Angel connected to 'localhost:1186' 2012-02-11 08:28:35 [ndbd] INFO -- Angel allocated nodeid: 4 cluster-7.2 $ ./bin/ndbd --initial 2012-02-11 08:28:36 [ndbd] INFO -- Angel connected to 'localhost:1186' 2012-02-11 08:28:36 [ndbd] INFO -- Angel allocated nodeid: 5 cluster-7.2 $ ./bin/ndbd --initial 2012-02-11 08:28:37 [ndbd] INFO -- Angel connected to 'localhost:1186' 2012-02-11 08:28:37 [ndbd] INFO -- Angel allocated nodeid: 6 Node 6: starting (Last completed phase 1) (mysql-5.5.16 ndb-7.2.2) cluster-7.2 $ ./bin/ndb_mgm -e 'all status' Connected to Management Server at: localhost:1186 Node 3: started (mysql-5.5.16 ndb-7.2.2) Node 4: started (mysql-5.5.16 ndb-7.2.2) Node 5: started (mysql-5.5.16 ndb-7.2.2) Node 6: started (mysql-5.5.16 ndb-7.2.2) cluster-7.2 $ ./bin/ndb_show_tables id type state logging database schema name 1 0 Online - DEFAULT-HASHMAP-240-4 3 SystemTable Online Yes sys def NDB$EVENTS_0 2 SystemTable Online Yes sys def SYSTAB_0 NDBT_ProgramExit: 0 - OK cluster-7.2 $ ./bin/ndb_restore -b 1 -r -n 3 -m ./cluster-data/BACKUP/BACKUP-1/ Backup Id = 1 Nodeid = 3 backup path = ./cluster-data/BACKUP/BACKUP-1/ Opening file './cluster-data/BACKUP/BACKUP-1/BACKUP-1.3.ctl' File size 14088 bytes Backup version in files: ndb-6.3.11 ndb version: mysql-5.5.16 ndb-7.2.2 Stop GCP of Backup: 65 Connected to ndb!! Created hashmap: DEFAULT-HASHMAP-240-2 Successfully restored table `mysql/def/ndb_apply_status` Successfully restored table event REPL$mysql/ndb_apply_status Successfully restored table `test/def/c1` Successfully restored table event REPL$test/c1 Successfully restored table `mysql/def/ndb_schema` Successfully restored table event REPL$mysql/ndb_schema Opening file './cluster-data/BACKUP/BACKUP-1/BACKUP-1-0.3.Data' File size 26864 bytes _____________________________________________________ Processing data in table: mysql/def/NDB$BLOB_7_3(8) fragment 0 _____________________________________________________ Processing data in table: mysql/def/ndb_index_stat_sample(5) fragment 0 _____________________________________________________ Processing data in table: sys/def/NDB$EVENTS_0(3) fragment 0 _____________________________________________________ Processing data in table: mysql/def/ndb_apply_status(9) fragment 0 _____________________________________________________ Processing data in table: mysql/def/ndb_index_stat_head(4) fragment 0 _____________________________________________________ Processing data in table: test/def/c1(10) fragment 0 _____________________________________________________ Processing data in table: sys/def/SYSTAB_0(2) fragment 0 _____________________________________________________ Processing data in table: mysql/def/ndb_schema(7) fragment 0 Opening file './cluster-data/BACKUP/BACKUP-1/BACKUP-1.3.log' File size 52 bytes Restored 6 tuples and 0 log entries NDBT_ProgramExit: 0 - OK cluster-7.2 $ ./bin/ndb_restore -b 1 -r -n 4 ./cluster-data/BACKUP/BACKUP-1/ Backup Id = 1 Nodeid = 4 backup path = ./cluster-data/BACKUP/BACKUP-1/ Opening file './cluster-data/BACKUP/BACKUP-1/BACKUP-1.4.ctl' File size 14088 bytes Backup version in files: ndb-6.3.11 ndb version: mysql-5.5.16 ndb-7.2.2 Stop GCP of Backup: 65 Connected to ndb!! Opening file './cluster-data/BACKUP/BACKUP-1/BACKUP-1-0.4.Data' File size 25728 bytes _____________________________________________________ Processing data in table: mysql/def/NDB$BLOB_7_3(8) fragment 1 _____________________________________________________ Processing data in table: mysql/def/ndb_index_stat_sample(5) fragment 1 _____________________________________________________ Processing data in table: sys/def/NDB$EVENTS_0(3) fragment 1 _____________________________________________________ Processing data in table: mysql/def/ndb_apply_status(9) fragment 1 _____________________________________________________ Processing data in table: mysql/def/ndb_index_stat_head(4) fragment 1 _____________________________________________________ Processing data in table: test/def/c1(10) fragment 1 _____________________________________________________ Processing data in table: sys/def/SYSTAB_0(2) fragment 1 _____________________________________________________ Processing data in table: mysql/def/ndb_schema(7) fragment 1 Opening file './cluster-data/BACKUP/BACKUP-1/BACKUP-1.4.log' File size 52 bytes Restored 4 tuples and 0 log entries NDBT_ProgramExit: 0 - OK cluster-7.2 $ ./bin/ndb_show_tables id type state logging database schema name 8 UserTable Online Yes mysql def NDB$BLOB_7_3 4 0 Online - DEFAULT-HASHMAP-240-2 1 0 Online - DEFAULT-HASHMAP-240-4 3 SystemTable Online Yes sys def NDB$EVENTS_0 5 UserTable Online Yes mysql def ndb_apply_status 6 UserTable Online Yes test def c1 2 SystemTable Online Yes sys def SYSTAB_0 7 UserTable Online Yes mysql def ndb_schema 1 TableEvent Online - REPL$mysql/ndb_apply_status 2 TableEvent Online - REPL$test/c1 3 TableEvent Online - REPL$mysql/ndb_schema 4 TableEvent Online - NDB$BLOBEVENT_REPL$mysql/ndb_schema_3 NDBT_ProgramExit: 0 - OK cluster-7.2 $ ./bin/ndb_desc -p -d test c1 -- c1 -- Version: 1 Fragment type: 9 K Value: 6 Min load factor: 78 Max load factor: 80 Temporary table: no Number of attributes: 2 Number of primary keys: 1 Length of frm data: 203 Row Checksum: 1 Row GCI: 1 SingleUserMode: 0 ForceVarPart: 1 FragmentCount: 2 ExtraRowGciBits: 0 ExtraRowAuthorBits: 0 TableStatus: Retrieved -- Attributes -- id Int NULL AT=FIXED ST=MEMORY $PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR -- Indexes -- PRIMARY KEY($PK) - UniqueHashIndex -- Per partition info -- Partition Row count Commit count Frag fixed memory Frag varsized memory Extent_space Free extent_space 0 6 6 32768 0 0 0 1 4 4 32768 0 0 0 NDBT_ProgramExit: 0 - OK cluster-7.2 $ jobs cluster-7.2 $ ./bin/mysqld_safe & [1] 4853 cluster-7.2 $ 120211 08:45:02 mysqld_safe Logging to '/Users/kolbe/Devel/mysql/cluster-7.2/data/prosimmon.local.err'. 120211 08:45:02 mysqld_safe Starting mysqld daemon with databases from /Users/kolbe/Devel/mysql/cluster-7.2/data cluster-7.2 $ ./bin/mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.5.16-ndb-7.2.2-gpl-log MySQL Cluster Community Server (GPL) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> select count(*) from ndbinfo.nodes; +----------+ | count(*) | +----------+ | 4 | +----------+ 1 row in set (0.01 sec) mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> select count(*) from information_schema.partitions where table_name='c1' and table_schema='test'; +----------+ | count(*) | +----------+ | 2 | +----------+ 1 row in set (0.05 sec) mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> select ':('; +----+ | :( | +----+ | :( | +----+ 1 row in set (0.01 sec) mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> create table c2 (id int) engine=ndbcluster; Query OK, 0 rows affected (0.15 sec) mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> insert into c2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); Query OK, 10 rows affected (0.01 sec) Records: 10 Duplicates: 0 Warnings: 0 mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> select count(*) from information_schema.partitions where table_name='c2' and table_schema='test'; +----------+ | count(*) | +----------+ | 4 | +----------+ 1 row in set (0.01 sec) mysql 5.5.16-ndb-7.2.2-gpl-log (root) [test]> [2]+ Stopped ./bin/mysql cluster-7.2 $ ./bin/ndb_desc -p -d test c2 -- c2 -- Version: 1 Fragment type: 9 K Value: 6 Min load factor: 78 Max load factor: 80 Temporary table: no Number of attributes: 2 Number of primary keys: 1 Length of frm data: 203 Row Checksum: 1 Row GCI: 1 SingleUserMode: 0 ForceVarPart: 1 FragmentCount: 4 ExtraRowGciBits: 0 ExtraRowAuthorBits: 0 TableStatus: Retrieved -- Attributes -- id Int NULL AT=FIXED ST=MEMORY $PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR -- Indexes -- PRIMARY KEY($PK) - UniqueHashIndex -- Per partition info -- Partition Row count Commit count Frag fixed memory Frag varsized memory Extent_space Free extent_space 0 4 4 32768 0 0 0 2 2 2 32768 0 0 0 1 1 1 32768 0 0 0 3 3 3 32768 0 0 0 NDBT_ProgramExit: 0 - OK