In a MySQL cluster I have three hosts, one with a manager node, and the other two are each both a data node and sql node. Connecting to the manager is possible, however only as [ndbd] and not [mysqld]... Meaning the manager sees them as data nodes but not as sql nodes. Everything looks as it should other than the "not connected" part, and I receive no error messages. So my question is why is the manager node only recognizing each machine as a data node and not as mysql node as well?
在MySQL集群中,我有三个主机,一个带有管理器节点,另外两个都是数据节点和sql节点。连接到管理器是可能的,但是只能作为[ndbd]而不是[mysqld]…这意味着管理器将它们视为数据节点,而不是sql节点。除了“未连接”部分之外,看起来一切正常,我没有收到错误消息。我的问题是为什么管理器节点只将每台机器识别为数据节点而不是mysql节点?
Below you can see the ndb_mgm cluster configuration followed by the contents of config.ini:
下面是ndb_mgm集群配置,后面是config.ini的内容:
Cluster Configuration --------------------- [ndbd(NDB)] 2 node(s) id=2 @10.0.40.105 (mysql-5.5.25 ndb-7.2.7, Nodegroup: 0, Master) id=3 @10.0.40.100 (mysql-5.5.25 ndb-7.2.7, Nodegroup: 0) [ndb_mgmd(MGM)] 1 node(s) id=1 @10.0.40.119 (mysql-5.5.25 ndb-7.2.7) [mysqld(API)] 2 node(s) id=4 (not connected, accepting connect from any host) id=5 (not connected, accepting connect from any host)
config.ini:
config.ini:
[ndbd default] # Options affecting ndbd processes on all data nodes: NoOfReplicas=2 # Number of replicas [tcp default] # TCP/IP options: [ndb_mgmd] # Management process options: hostname=10.0.40.119 # 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-1: # (one [ndbd] section per data node) hostname=10.0.40.105 # Hostname or IP address datadir=/usr/local/mysql/data # Directory for this data node's data files NodeId=2 [ndbd] # Options for data node-2: hostname=10.0.40.100 # Hostname or IP address datadir=/usr/local/mysql/data # Directory for this data node's data files NodeId=3 #one [mysqld] per storage node [mysqld] [mysqld]
/etc/my.cnf:
/etc/my.cnf:
[mysqld] ndbcluster ndb-connectstring=10.0.40.119 [mysql_cluster] ndb-connectstring=10.0.40.119
I have some confusion about starting mysqld. The process I go through to start each node is as follows:
我对启动mysqld有些疑惑。我启动每个节点的过程如下:
ndb_mgmd:
ndb_mgmd:
ndb_mgmd --initial --skip-config-cache -f /var/lib/mysql-cluster/config.ini ndb_mgm
ndbd/mysqld:
ndbd / mysqld:
ndbd --initial /etc/init.d/mysql.server start
1 个解决方案
#1
4
You haven't shown your my.cnf
file for your mysqlds
but my guess is that you're missing one of the following 2 lines from its [mysqld]
section:
您还没有为mysqlds显示您的my.cnf文件,但我的猜测是您错过了它[mysqld]部分的以下两行代码之一:
ndbcluster
ndb-connectstring=10.0.40.119:1186
OK - so you've defined those parameters in your my.cnf
file.
好的,你已经在myc文件中定义了这些参数。
Next thing to check - are you using the mysqld
that came with MySQL Cluster (i.e. not a 'regular' mysqld
- which isn't supported)?
接下来要检查的是——是否使用MySQL集群附带的mysqld(即不支持“常规”mysqld)?
Try starting the mysqld
with the --verbose
option and see if there are more clues. Take a look at the Cluster log (should be on 10.0.40.119 in the /var/lib/mysql-cluster folder. Take a look any log entries generated by the mysqld
.
尝试使用-verbose选项启动sqmyld,看看是否有更多的线索。查看集群日志(应该位于/var/lib/mysql-cluster文件夹中的10.0.40.119。查看mysqld生成的任何日志条目。
#1
4
You haven't shown your my.cnf
file for your mysqlds
but my guess is that you're missing one of the following 2 lines from its [mysqld]
section:
您还没有为mysqlds显示您的my.cnf文件,但我的猜测是您错过了它[mysqld]部分的以下两行代码之一:
ndbcluster
ndb-connectstring=10.0.40.119:1186
OK - so you've defined those parameters in your my.cnf
file.
好的,你已经在myc文件中定义了这些参数。
Next thing to check - are you using the mysqld
that came with MySQL Cluster (i.e. not a 'regular' mysqld
- which isn't supported)?
接下来要检查的是——是否使用MySQL集群附带的mysqld(即不支持“常规”mysqld)?
Try starting the mysqld
with the --verbose
option and see if there are more clues. Take a look at the Cluster log (should be on 10.0.40.119 in the /var/lib/mysql-cluster folder. Take a look any log entries generated by the mysqld
.
尝试使用-verbose选项启动sqmyld,看看是否有更多的线索。查看集群日志(应该位于/var/lib/mysql-cluster文件夹中的10.0.40.119。查看mysqld生成的任何日志条目。