You are most likely to experience an error when importing data into a table. The following sections cover some of the common errors you may experience while carrying out the procedures covered earlier in this chapter.
ERROR 1114 (HY000) at line 227: The table 'table_log' is full
This error means that you do not have enough DataMemory or IndexMemory. You will learn how to change these values in Chapter 2, but for now you just need to know how to find out what values you should set them to. In theory, you should either work it out manually or use a script such as ndb_size.pl, as discussed earlier in this chapter. However, if you want to find out your actual usage, you can use the command ALL DUMP 1000. In the management client, you issue ALL DUMP 1000 like this:
ndb_mgm> ALL DUMP 1000 Sending dump signal with data: 0x000003e8 Sending dump signal with data: 0x000003e8
You should now see the recorded memory usage of each node in the cluster log on the management daemon. You exit the management client and tail this log file:
ndb_mgm> exit [root@s1 mysql-cluster]# ls config.ini config.ini.threenode ndb_1_cluster.log ndb_1_out.log ndb_1.pid [root@s1 mysql-cluster]# tail -4 ndb_1_cluster.log date time [MgmSrvr] INFO -- Node 3: Data usage is 0%(19 32K pages of total 2560) date time [MgmSrvr] INFO -- Node 3: Index usage is 1%(34 8K pages of total 2336) date time [MgmSrvr] INFO -- Node 2: Data usage is 0%(19 32K pages of total 2560) date time [MgmSrvr] INFO -- Node 2: Index usage is 1%(34 8K pages of total 2336)
The number after the tail command should be double the number of storage nodes because you are telling tail how many lines to display (starting at the bottom of the file), and each storage node will produce two lines of log after you issue this command.
Now all you need is some simple math to work out how much DataMemory and IndexMemory are currently being used. To work this out, you choose the highest value for the data usage and index usage if there is a difference between the results for the different storage nodes (which there should not be).
19 32K pages of total 2560 means that the actual usage is 19 x 32KB, which is 2560KB (which is 2.5MB). Similarly, 34 8K pages of total 2336 means 2336KB of space.
You should make sure that your values in config.ini are significantly larger than the minimum values you have just calculated because there will be times when storage nodes will need more space for temporary tables, and you don't want to run the risk of a table suddenly filling up and hitting its size limit, causing downtime.
ERROR 1005 (HY000) at line x: Can't create table './dbname/tablename.frm' (errno: 4242)
This error means "too many indexes." As you'll learn in Chapter2, you need to increase MaxNoOfUniqueIndexes and/or MaxNoOfOrderedIndexes.
ERROR 1005 (HY000) at line x: Can't create table './dbname/tablename.frm' (errno: 4335)
This error indicates a problem with too many auto-increment fields. Only one auto-increment column is allowed per table. Having a table without a primary key uses an auto-incremented hidden key. That is, a table without a primary key cannot have an auto-incremented column, and a table with a primary key cannot have two auto-incremented columns.
ERROR 1015 (HY000): Can't lock file (errno: 4006)
This error means "increase MaxNoOfConcurrentTransactions." When the MySQL server needs to start a transaction, it looks for a transaction object in a pool. Each object in this pool is connected to a certain data node. When starting a scan of a table, a transaction object is also used. Thus, in the worst case, a connection could potentially allocate the following at the same time on one data node:
Max number of tables in query + 1 (transaction) + 1 (short term usage)
This means if say you use a maximum of 20 table joins, you would get a maximum of 22 transaction objects per connection, so you can work out what value to set MaxNoOfConcurrentTransactions to. Of course, 22 would be a worst-case scenario. Most transactions use 1 or 2 transaction objects, but you should be aware that this is an error that you may encounter.
Chapter2 provides more information on changing config.ini parameters.
ERROR 1050 (42S01): Table 'ctest' already exists
This error may be generated by a query such as this:
mysql> create table ctest (i int) engine=ndbcluster;
It means the cluster is not working. As a preventive measure, if the cluster is not working, you will not be able to create tables simply because the SQL node does not know what tables actually exist in NDB format and so would run the risk of overwriting the tables that are already stored in the cluster.
In this case, you should go back to ndb_mgm and make sure all nodes are connected; if they are not, you should get them to connect. If all the storage nodes are connected, you should make sure that the /etc/my.cnf configuration on each storage node is correct and points to the correct management daemon.
"Out of operation records in transaction coordinator"
This error can occur during migration of tables, particularly during INSERT INTO...SELECT style queries because each INSERT becomes an operation. The solution is to increase the parameter MaxNoOfConcurrentOperations in config.ini.
Backup and Recovery
Security and Management
A MySQL Cluster Binaries
B Management Commands
C Glossary of Cluster Terminology