我搭建了一个3台服务器所做的mysql-cluster集群
集群版本是7.09G 操作系统是RH-5.2-32
使用的是RPM包安装方式
服务器为 MySQL-Cluster-gpl-server和MySQL-Cluster-gpl-client和MySQL-Cluster-gpl-storage
MGM为MySQL-Cluster-gpl-manm..和MySQL-Cluster-gpl-tools
为了速度搭建config.ini和my.cnf都是为简易的书写
MGM的输出状态为
ndb_mgm> show
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @192.168.187.138  (mysql-5.1.39 ndb-7.0.9, starting, Nodegroup: 0)
id=3    @192.168.187.139  (mysql-5.1.39 ndb-7.0.9, starting, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1    @192.168.187.140  (mysql-5.1.39 ndb-7.0.9)
[mysqld(API)]   3 node(s)
id=4 (not connected, accepting connect from any host)
id=5 (not connected, accepting connect from any host)
id=6 (not connected, accepting connect from any host)
服务和端口都没有问题
mysql> show engines;
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                        | Transactions | XA   | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| ndbcluster | YES     | Clustered, fault-tolerant tables                               | YES          | NO   | NO         |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| CSV        | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
| FEDERATED  | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
| ARCHIVE    | YES     | Archive storage engine                                         | NO           | NO   | NO         |
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         | NO           | NO   | NO         |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
到NDB上 可以创建库 但是创建表就报错
mysql> use test;
Database changed
mysql> create table test111(id int,name char(10))engine=ndbcluster;
ERROR 1005 (HY000): Can't create table 'test.test111' (errno: 157)
mysql> show warnings;
+-------+------+---------------------------------------------------------------------------------+
| Level | Code | Message                                                                         |
+-------+------+---------------------------------------------------------------------------------+
| Error | 1296 | Got error 4009 'Cluster Failure' from NDB. Could not acquire global schema lock |
| Error | 1296 | Got error 4009 'Cluster Failure' from NDB                                       |
| Error | 1005 | Can't create table 'test.test111' (errno: 157)                                  |
+-------+------+---------------------------------------------------
错误日志为
091201  1:30:05 [Note] NDB: NodeID is 4, management server '192.168.187.140:1186'
091201  1:30:06 [Note] NDB[0]: NodeID: 4, no storage nodes connected (timed out)
091201  1:30:06 [Warning] NDB: server id set to zero will cause any other mysqld with bin log to log with wrong server id
091201  1:30:06 [Note] Starting Cluster Binlog Thread
091201  1:30:07 [Note] Event Scheduler: Loaded 0 events
091201  1:30:22 [Warning] NDB : Tables not available after 15 seconds.  Consider increasing --ndb-wait-setup value
091201  1:30:22 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.39-ndb-7.0.9-cluster-gpl'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Cluster Server (GPL)
2009-12-01 01:34:32 [NdbApi] INFO     -- Management server closed connection early. It is probably being shut down (or has problems). We will retry the connection. 110 Time out talking to management server Error line: 467
091201 02:01:12 mysqld_safe A mysqld process already exists
091201  2:02:15 [Warning] NDB: Could not acquire global schema lock (4009)Cluster Failur
求高手~~
                  	
				

于 2012-05-23 09:09:01发表:
091201 1:30:06 [Note] NDB[0]: NodeID: 4, no storage nodes connected (timed out)
存储节点没有启起来,连接超时。肯定建不了表。
x2002g 于 2010-03-11 17:29:41发表:
我也遇到了同样的问题,就我自己的情况来说,主要是两个原因造成这种问题
1. 数据节点的2202端口被iptables屏蔽了,造成sql node无法连接data node。配置iptables开放2202端口即可
2. 一般来说,我都是使用service mysql start开启mysql服务的。但事实证明,这条命令开启的mysql服务无法连接到数据节点,原因不明。使用mysqld_safe & 开启mysql服务即可。(楼上说的很对)
希望能够有帮助。
xxtianxiaxin 于 2010-01-01 15:13:39发表:
you try to use mysqld_safe & for starting sql node
szlfeng 于 2009-12-15 21:09:36发表:
谢谢分享。支持~