我正在尝试使用命令将旧数据库迁移到 mysql 集群(4 个数据节点):
ALTER TABLE sample ENGINE=NDBCLUSTER
但我收到以下错误:
The table '#sql-7ff3_3' is full
该表中大约有 3 亿行。这是我的配置文件:
/mysql-cluster/config.ini
[NDBD DEFAULT]
NoOfReplicas=2
DataDir=/data/mysql-cluster/ndb/
BackupDataDir=/data/mysql-cluster/backup/
DataMemory=10G
IndexMemory=5G
TimeBetweenLocalCheckpoints=6
FragmentLogFileSize=256MB
NoOfFragmentLogFiles=50
MaxNoOfOrderedIndexes=8000
MaxNoOfConcurrentOperations=100000
MaxNoOfTables = 10000
RedoBuffer=128M
MaxNoOfAttributes=5000
MaxNoOfUniqueHashIndexes=1024
/etc/my.cnf
[mysqld]
basedir=/usr/local/mysql
datadir=/data/mysql-cluster/mysqld/
event_scheduler=on
default-storage-engine=ndbcluster
ndbcluster
ndb-connectstring=192.168.x.x,192.168.x.x
innodb_file_per_table
innodb_buffer_pool_size = 512MB
key_buffer = 512M
key_buffer_size = 512M
sort_buffer_size = 512M
table_cache = 1024
read_buffer_size = 512M
答案1
看来完成此操作所需的临时表已满,毫无疑问是因为您没有足够的内存。修改包含如此大量数据的表并不是一个好主意,因为需要时间和资源。最好转储(导出)表,创建一个具有所需规格的新表,然后再加载数据。