I have a 2 data-node cluster:
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @10.0.0.2 (mysql-5.1.39 ndb-7.0.9, Nodegroup: 0, Master)
id=3 @10.0.0.3 (mysql-5.1.39 ndb-7.0.9, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @10.0.0.1 (mysql-5.1.39 ndb-7.0.9)
[mysqld(API)] 2 node(s)
id=6 @10.0.0.2 (mysql-5.1.39 ndb-7.0.9)
id=7 @10.0.0.3 (mysql-5.1.39 ndb-7.0.9)
ndb_mgm> Node 3: Data usage is 56%(95341 32K pages of total 169152)
Node 2: Data usage is 56%(95341 32K pages of total 169152)
Node 2: Index usage is 4%(4028 8K pages of total 84640)
Node 3: Index usage is 4%(4028 8K pages of total 84640)
And as you can see it is using a decent amount of storage memory.
This is a production system and i'm loosing about 1% of storage a week, so I need to get largest of the tables out of RAM storage and on to disk-based storage.
I created a disk-based tablespace:
mysql> CREATE LOGFILE GROUP LG1
ADD UNDOFILE 'undo1.log'
INITIAL_SIZE 150M
UNDO_BUFFER_SIZE 16M
ENGINE NDBCLUSTER;
mysql> ALTER LOGFILE GROUP LG1
ADD UNDOFILE 'undo2.log'
INITIAL_SIZE 200M
ENGINE NDBCLUSTER;
mysql> CREATE TABLESPACE ts_1
ADD DATAFILE 'data1.dat'
USE LOGFILE GROUP LG1
EXTENT_SIZE 1M
INITIAL_SIZE 2G
ENGINE NDBCLUSTER;
mysql> ALTER TABLESPACE ts_1
ADD DATAFILE 'data2.dat'
INITIAL_SIZE 2G
ENGINE NDBCLUSTER;
The table i need to move is 'awm_messages' and the data size is at 511442944 bytes
according to
mysql> show table status like '%';
I tried executing:
mysql> alter table awm_messages tablespace ts_1 storage disk engine=ndbcluster;
and this runs for about 10 minutes and the Data Usage spools up to about 58% and then the transaction fails with this error:
ERROR 1017 (HY000): Can't find file: '#sql-1d74_6e' (errno: 2)
I had a thought that my undo log might be too small to make the change, but I cant find anything on what that file(#sql_1d74_6e) is.
Any suggestions or alternate ways to migrate that table to disk?
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=2 @10.0.0.2 (mysql-5.1.39 ndb-7.0.9, Nodegroup: 0, Master)
id=3 @10.0.0.3 (mysql-5.1.39 ndb-7.0.9, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @10.0.0.1 (mysql-5.1.39 ndb-7.0.9)
[mysqld(API)] 2 node(s)
id=6 @10.0.0.2 (mysql-5.1.39 ndb-7.0.9)
id=7 @10.0.0.3 (mysql-5.1.39 ndb-7.0.9)
ndb_mgm> Node 3: Data usage is 56%(95341 32K pages of total 169152)
Node 2: Data usage is 56%(95341 32K pages of total 169152)
Node 2: Index usage is 4%(4028 8K pages of total 84640)
Node 3: Index usage is 4%(4028 8K pages of total 84640)
And as you can see it is using a decent amount of storage memory.
This is a production system and i'm loosing about 1% of storage a week, so I need to get largest of the tables out of RAM storage and on to disk-based storage.
I created a disk-based tablespace:
mysql> CREATE LOGFILE GROUP LG1
ADD UNDOFILE 'undo1.log'
INITIAL_SIZE 150M
UNDO_BUFFER_SIZE 16M
ENGINE NDBCLUSTER;
mysql> ALTER LOGFILE GROUP LG1
ADD UNDOFILE 'undo2.log'
INITIAL_SIZE 200M
ENGINE NDBCLUSTER;
mysql> CREATE TABLESPACE ts_1
ADD DATAFILE 'data1.dat'
USE LOGFILE GROUP LG1
EXTENT_SIZE 1M
INITIAL_SIZE 2G
ENGINE NDBCLUSTER;
mysql> ALTER TABLESPACE ts_1
ADD DATAFILE 'data2.dat'
INITIAL_SIZE 2G
ENGINE NDBCLUSTER;
The table i need to move is 'awm_messages' and the data size is at 511442944 bytes
according to
mysql> show table status like '%';
I tried executing:
mysql> alter table awm_messages tablespace ts_1 storage disk engine=ndbcluster;
and this runs for about 10 minutes and the Data Usage spools up to about 58% and then the transaction fails with this error:
ERROR 1017 (HY000): Can't find file: '#sql-1d74_6e' (errno: 2)
I had a thought that my undo log might be too small to make the change, but I cant find anything on what that file(#sql_1d74_6e) is.
Any suggestions or alternate ways to migrate that table to disk?