您好,欢迎访问一九零五行业门户网

关于MySQL簇问题的成功解决

我在测试mysql cluster时出现如下问题请大家帮忙分析一下是怎么回事,我的mysql cluster布署如下,用的是mysql-cluster-gpl-6.2.
我在测试mysql cluster时出现如下问题请大家帮忙分析一下是怎么回事,,我的mysql cluster布署如下,用的是mysql-cluster-gpl-6.2.15-linux-i686-glibc23.tar.gz tar 包
节点管理器:192.168.5.254
存储节点
192.168.5.45
192.168.5.30
sql节点
192.168.5.238
按着官方文档配置好后在节点管理器(192.168.5.254)用show命令显示结果如下:
connected to management server at: localhost:1186
cluster configuration
---------------------
[ndbd(ndb)] 2 node(s)
id=2 @192.168.5.45 (mysql-5.1.23 ndb-6.2.15, starting, nodegroup: 0)
id=3 @192.168.5.30 (mysql-5.1.23 ndb-6.2.15, starting, nodegroup: 0)
[ndb_mgmd(mgm)] 1 node(s)
id=1 (mysql-5.1.23 ndb-6.2.15)
[mysqld(api)] 1 node(s)
id=4 (not connected, accepting connect from 192.168.5.23
管理节点簇日志如下:
2008-09-27 14:17:30 [mgmsrvr] alert -- node 1: node 2 disconnected
2008-09-27 14:17:30 [mgmsrvr] info -- node 2: node shutdown completed.
2008-09-27 14:17:30 [mgmsrvr] alert -- node 1: node 3 disconnected
2008-09-27 14:17:30 [mgmsrvr] info -- node 3: node shutdown completed.
2008-09-27 14:17:32 [mgmsrvr] info -- shutting down server...
2008-09-27 14:17:40 [mgmsrvr] info -- mgmt server state: nodeid 4 freed, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000002.
2008-09-27 14:17:40 [mgmsrvr] info -- shutdown complete
2008-09-27 14:20:37 [mgmsrvr] info -- ndb cluster management server. mysql-5.1.23 ndb-6.2.15
2008-09-27 14:20:37 [mgmsrvr] info -- id: 1, command port: *:1186
2008-09-27 14:20:45 [mgmsrvr] info -- mgmt server state: nodeid 2 reserved for ip 192.168.5.45, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000006.
2008-09-27 14:20:45 [mgmsrvr] info -- node 1: node 2 connected
2008-09-27 14:20:46 [mgmsrvr] info -- mgmt server state: nodeid 2 freed, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000002.
2008-09-27 14:20:48 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:20:51 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:20:54 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:20:57 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:00 [mgmsrvr] warning -- allocate nodeid (0) failed. connection from ip 192.168.5.45. returned error string connection done from wrong host ip 192.168.5.45.
2008-09-27 14:21:00 [mgmsrvr] info -- mgmt server state: node id's 2 connected but not reserved
2008-09-27 14:21:00 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:03 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:06 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:09 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:12 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:15 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:18 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:21 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:24 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:27 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:30 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:21:31 [mgmsrvr] alert -- node 1: node 2 disconnected
2008-09-27 14:21:31 [mgmsrvr] info -- node 2: node shutdown completed.
2008-09-27 14:21:33 [mgmsrvr] info -- shutting down server...
2008-09-27 14:21:37 [mgmsrvr] info -- shutdown complete
2008-09-27 14:33:52 [mgmsrvr] info -- ndb cluster management server. mysql-5.1.23 ndb-6.2.15
2008-09-27 14:33:52 [mgmsrvr] info -- id: 1, command port: *:1186
2008-09-27 14:34:53 [mgmsrvr] info -- mgmt server state: nodeid 2 reserved for ip 192.168.5.45, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000006.
2008-09-27 14:34:53 [mgmsrvr] info -- node 1: node 2 connected
2008-09-27 14:34:54 [mgmsrvr] info -- mgmt server state: nodeid 2 freed, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000002.
2008-09-27 14:34:56 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:34:58 [mgmsrvr] info -- mgmt server state: nodeid 3 reserved for ip 192.168.5.30, m_reserved_nodes 000000000000000000000000000000000000000000000000000000000000000a.
2008-09-27 14:34:59 [mgmsrvr] info -- node 1: node 3 connected
2008-09-27 14:34:59 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:34:59 [mgmsrvr] info -- mgmt server state: nodeid 3 freed, m_reserved_nodes 0000000000000000000000000000000000000000000000000000000000000002.
2008-09-27 14:35:02 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:02 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:05 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:05 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:08 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:08 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:11 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:11 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:14 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:14 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:17 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:17 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:35:20 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:35:20 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
[root@host254 mysql-cluster]# cat ndb_1_cluster.log |tail
2008-09-27 14:36:02 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:36:02 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:36:02 [mgmsrvr] warning -- allocate nodeid (0) failed. connection from ip 192.168.5.45. returned error string connection done from wrong host ip 192.168.5.45.
2008-09-27 14:36:02 [mgmsrvr] info -- mgmt server state: node id's 2 3 connected but not reserved
2008-09-27 14:36:05 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:36:05 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:36:08 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:36:08 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
2008-09-27 14:36:11 [mgmsrvr] info -- node 3: initial start, waiting for 0000000000000004 to connect, nodes [ all: 000000000000000c connected: 0000000000000008 no-wait: 0000000000000000 ]
2008-09-27 14:36:11 [mgmsrvr] info -- node 2: initial start, waiting for 0000000000000008 to connect, nodes [ all: 000000000000000c connected: 0000000000000004 no-wait: 0000000000000000 ]
存储节点的错误日志如下所示:
configuration error: error : could not alloc node id at 192.168.5.254 port 1186: connection done from wrong host ip 192.168.5.45.
080927 14:35:15 [error] plugin 'ndbcluster' init function returned error.
080927 14:35:15 [error] plugin 'ndbcluster' registration as a storage engine failed.
080927 14:35:15 [note] event scheduler: loaded 0 events
080927 14:35:15 [note] /usr/local/mysql/bin/mysqld: ready for connections.
version: '5.1.23-ndb-6.2.15-cluster-gpl' socket: '/tmp/mysql.sock' port: 3306 mysql cluster server (gpl)
在sql节点创建测试表表时出现ndb引擎没有准备好的错误 提示:
mysql> use ctest;
database changed
mysql> create table ctest(name varchar(50)) engine=ndbcluster;
error 1005 (hy000): can't create table 'ctest.ctest' (errno: 157)
管理节点配置文件内容如下config.ini:
#options affecting ndbd processes on all data nodes:
[ndbd default]
noofreplicas=2 # number of replicas
datamemory=180m # how much memory to allocate for data storage
indexmemory=80m # 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/ip options:
[tcp default]
portnumber=2202
# this the default; however, you can use any
# port that is free for all the hosts in cluster
# note: it is recommended beginning with mysql 5.0 that
# you do not specify the portnumber at all and simply allow
# the default value to be used instead
# management process options:
[ndb_mgmd]
id=1
hostname=192.168.5.254 # hostname or ip address of mgm node
datadir=/var/lib/mysql-cluster # directory for mgm node logfiles
# options for data node a:
[ndbd]
# (one [ndbd] section per data node)
id=2
hostname=192.168.5.45 # hostname or ip address
datadir=/usr/local/mysql/data # directory for this data node's datafiles
# options for data node b:
[ndbd]
id=3
hostname=192.168.5.30 # hostname or ip address
datadir=/usr/local/mysql/data # directory for this data node's datafiles
# sql node options:
[mysqld]
id=4
hostname=192.168.5.238
# hostname or ip address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)
存储节点与sql节点配置文件如下 :
[mysqld]
ndbcluster
ndb-connectstring=192.168.5.254
[mysql_cluster]
ndb-connectstring=192.168.5.254
从节点服务器或存储服务器上nmap管理服务器时看不到1186端口,但telnet 192.168.5.254可以连上,不过在输入get version与get status时没有任何反应(这是我在国外一贴子上看到的)。
最终确定为192.168.5.45上防火墙引起的故障,无法与服务器1186端口通话。
其它类似信息

推荐信息