我已经在mysql docs中设置了一个Mysql集群7.4,它是如何配置的:
cat /var/lib/mysql-cluster/config.ini [ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=2 # Number of replicas
DataMemory=20G # How much memory to allocate for data storage
IndexMemory=5G # 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.
[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=10.107.16.97 # Hostname or IP address of MGM node
datadir=/var/lib/mysql-cluster # Directory for MGM node log files
[ndbd]
# Options for data node "Node1":
# (one [ndbd] section per data node)
hostname=10.107.16.241 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
MaxNoOfConcurrentOperations=3865470336
MaxNoOfLocalOperations=4294967039
[ndbd]
# Options for data node "Node2":
hostname=10.107.16.242 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
MaxNoOfConcurrentOperations=3865470336
MaxNoOfLocalOperations=4294967039
[ndbd]
# Options for data node "Node3":
# (one [ndbd] section per data node)
hostname=10.107.16.243 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
MaxNoOfConcurrentOperations=3865470336
MaxNoOfLocalOperations=4294967039
[ndbd]
# Options for data node "Node4":
hostname=10.107.16.244 # Hostname or IP address
datadir=/usr/local/mysql/data # Directory for this data node's data files
MaxNoOfConcurrentOperations=3865470336
MaxNoOfLocalOperations=4294967039
[mysqld]
# SQL node options:
hostname=10.107.16.80 # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
这里是mgm节点中的show命令:
ndb_mgm> show
#Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 4 node(s)
id=2 @10.107.16.241 (mysql-5.6.23 ndb-7.4.4, Nodegroup: 0, *)
id=3 @10.107.16.242 (mysql-5.6.23 ndb-7.4.4, Nodegroup: 0)
id=4 @10.107.16.243 (mysql-5.6.23 ndb-7.4.4, Nodegroup: 1)
id=5 @10.107.16.244 (mysql-5.6.23 ndb-7.4.4, Nodegroup: 1)
[ndb_mgmd(MGM)] 1 node(s)
id=1 @10.107.16.97 (mysql-5.6.23 ndb-7.4.4)
[mysqld(API)] 1 node(s)
id=6 @10.107.16.80 (mysql-5.6.23 ndb-7.4.4)
我想通过插入选择将一些数据推送到表order_history但我仍然收到错误
CREATE TABLE `order_history` (
`id` int(11) NOT NULL,
`comment` varchar(255) NOT NULL DEFAULT '',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`lastupdated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified_by` int(11) NOT NULL DEFAULT '0',
`order_id` int(11) NOT NULL DEFAULT '0',
`status` varchar(255) NOT NULL DEFAULT '',
`meta` text NOT NULL,
KEY `order_history_order_id_i` (`order_id`),
KEY `order_history_lastupdated_i` (`lastupdated`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=8
mysql> select count(*) from order_history; ### 32k
mysql> insert into order_history (select * from order_history);
ERROR 1297 (HY000): Got temporary error 233 'Out of operation records in transaction coordinator (increase MaxNoOfConcurrentOperations)' from NDBCLUSTER
为了修复此错误,我已将MaxNoOfConcurrentOperations添加到配置文件中,然后我重新启动它,但看起来它没有采用新的参数值。
您知道如何检查群集中的ndb参数吗?我没有在NDBINFO Db的任何表中找到任何这些值,并且我已经使用类似'%ndb%'的所有全局和状态变量。
答案 0 :(得分:0)
MaxNoOfConcurrentOperations应写在[ndbd default]
部分。停止管理节点,然后使用--initial