MYSQL5.1 cluster of data saved to disk settings

Non-clustered index portion of after MYSQL5.1.16 data can be saved to disk.
Let me sum up. update at any time.
First what do experiments, these had to run SQL statements on the SQL node.
1. Create LOGFILE GROUP


mysql> create logfile group lg_1
    -> add undofile 'undo_1.dat'
    -> initial_size 128M
    -> undo_buffer_size 16M
    -> engine=ndb;
Query OK, 0 rows affected (3.63 sec)

mysql> alter logfile group lg_1
    -> add undofile 'undo_2.dat'
    -> initial_size 80M
    -> engine ndb;
Query OK, 0 rows affected (2.48 sec)

2, create a table space


mysql> create tablespace ts_1
    -> add datafile 'data_1.dat'
    -> use logfile group lg_1
    -> initial_size 128M
    -> engine ndb;
Query OK, 0 rows affected (3.49 sec)

mysql> alter tablespace ts_1
    -> add datafile 'data_2.dat'
    -> initial_size 160M
    -> engine ndb;
Query OK, 0 rows affected (5.92 sec)

3, applied to the engine NDBCLUSTER table

mysql> alter table t11 tablespace ts_1 storage disk;
Query OK, 5 rows affected (1.88 sec)
Records: 5 Duplicates: 0 Warnings: 0
mysql> desc t11;
+-------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| str | varchar(255) | NO | | | |
| money | decimal(12,2) | NO | | | |
+-------+---------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)


4, we take a look at the files on the NDBD node.
Before and after comparison:


[root@localhost ndb_5_fs]# ls

D1 D10 D11 D2 D8 D9 LCP
[root@localhost ndb_5_fs]# ls

D1 D10 D11 D2 D8 D9 data_1.dat data_2.dat LCP undo_1.dat undo_2.dat

Extra is the file we just created.

5, there is a very very important tips on manual,
--initial initialization time does not clear logfile group, and tablespace. You must be manually deleted.

Important

Starting the cluster with the --initial option does not remove Disk Data files. You must remove these manually prior to performing an initial restart of the cluster.

This article comes from " God, let there or be square! " Blog, reproduced please contact the author!

Reproduced in: https: //my.oschina.net/u/585111/blog/219505

Guess you like

Origin blog.csdn.net/weixin_33894640/article/details/92008329