我有一个带有 4 个数据节点的 mysql 集群。我正在尝试插入 800 万行,使用 50k 块的加载数据 infile 以保持事务较小。就像发条一样,每向表中插入 100 万行后,插入就会停止近 20 分钟,然后再重新开始。我也在日志中收到此错误。
2014-07-17 22:34:59 [NdbApi] 错误——发送带有错误标志的 TCROLLBACKREQ
我假设我需要更改配置
[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2 # Number of replicas
DataMemory=90G # How much memory to allocate for data storage
IndexMemory=10G # How much memory to allocate for index storage
# For DataMemory and IndexMemory, we have used the
# default values. Since the "world" database takes up
# only about 500KB, this should be more than enough for
# this example Cluster setup.
NoOfFragmentLogFiles=20
MaxNoOfOrderedIndexes=1000
MaxNoOfAttributes=10000
MaxBufferedEpochs=10000
MaxNoOfConcurrentTransactions=1000000
MaxNoOfConcurrentOperations=10000000
MaxNoOfLocalOperations=11000000
[tcp default]
# TCP/IP options:
#portnumber=2202 # This the default; however, you can use any
# port that is free for all the hosts in the cluster
# Note: It is recommended that you do not specify the port
# number at all and simply allow the default value to be used
# instead
[ndb_mgmd]
# Management process options:
hostname=########.173 # Hostname or IP address of MGM node
datadir=/var/lib/mysql-cluster # Directory for MGM node log files
nodeId=1
[ndbd]
# Options for data node "A":
hostname=########.173 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
ServerPort=50501
nodeId=2
MaxNoOfExecutionThreads=4
[ndbd]
# Options for data node "B":
hostname=########.174 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
ServerPort=50502
nodeId=3
MaxNoOfExecutionThreads=4
[ndbd]
# Options for data node "C":
hostname=########.175 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
ServerPort=50503
nodeId=5
MaxNoOfExecutionThreads=4
[ndbd]
# Options for data node "D":
hostname=########.176 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
ServerPort=50504
nodeId=6
MaxNoOfExecutionThreads=4
#[ndbd]
# Options for data node "E":
#hostname=########.177 # Hostname or IP address
#datadir=/usr/local/mysql/data # Directory for this data node's data files
#ServerPort=50505
#nodeId=7
#MaxNoOfExecutionThreads=4
[mysqld]
# SQL node options:
nodeId=4
hostname=########.174 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=7
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=8
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=9
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=10
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=11
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=12
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=13
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
[mysqld]
# SQL node options:
nodeId=14
hostname=########.177 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)