安装和configuration在Ubuntu 10.10上运行的MySQL集群时遇到问题
这是群集pipe理的configuration
[NDBD DEFAULT] NoOfReplicas=2 DataMemory=10MB IndexMemory=25MB MaxNoOfTables=256 MaxNoOfOrderedIndexes=256 MaxNoOfUniqueHashIndexes=128 [MYSQLD DEFAULT] [NDB_MGMD DEFAULT] [TCP DEFAULT] [NDB_MGMD] Id=1 # the NDB Management Node (this one) HostName=192.168.10.101 [NDBD] Id=2 # the first NDB Data Node HostName=192.168.10.11 DataDir= /var/lib/mysql-cluster [NDBD] Id=3 # the second NDB Data Node HostName=192.168.10.12 DataDir=/var/lib/mysql-cluster [MYSQLD] [MYSQLD]
这是两个节点的configuration:
[mysqld] ndbcluster ndb-connectstring=192.168.10.101 # the IP of the MANAGMENT (THIRD) SERVER [mysql_cluster] ndb-connectstring=192.168.10.101 # the IP of the MANAGMENT (THIRD) SERVER
运行完所有节点和pipe理后,我使用ndb_mgm,types'show'命令,并且显示如下:
ndb_mgm> show Connected to Management Server at: localhost:1186 Cluster Configuration --------------------- [ndbd(NDB)] 2 node(s) id=2 @192.168.10.11 (mysql-5.1.39 ndb-7.0.9, Nodegroup: 0, Master) id=3 @192.168.10.12 (mysql-5.1.39 ndb-7.0.9, Nodegroup: 0) [ndb_mgmd(MGM)] 1 node(s) id=1 @192.168.10.101 (mysql-5.1.39 ndb-7.0.9) [mysqld(API)] 1 node(s) id=4 (not connected, accepting connect from 192.168.10.101)
看看最后两行..不像http://dev.mysql.com/tech-resources/articles/mysql-cluster-for-two-servers.html看起来像(见第4点)
有谁曾经有过这个问题?
嗯,首先什么是非常重要的…pipe理服务器和MySQL /存储服务器不能相同。 我希望你在这里有不同的服务器。
但是,您的问题看起来像是您的节点上有configuration问题,或者没有正确启动节点。
在第一次开始或testing。
mkdir / var / lib / mysql-cluster cd / var / lib / mysql-cluster / usr / local / mysql / bin / ndbd –initial /etc/rc.d/init.d/mysql.server start
目录是否存在,以及你是否初始化它是非常重要的。 并注意它有点混淆的存储引擎和mysql.server是不同的东西。 一个是真正的存储女巫持有的数据,另一个是客户端,你可以看到底部。 两者都必须启动。
但
如果它真的很重要,只用 – 初始化。
但要注意。 在MySQL集群中是一个小问题。 运行存储引擎中不能更改表。 所以如果你有一个NDB存储引擎的表,你不能添加一个字段。
为此,您需要将其更改为myisam,例如更改表格,然后将其更改回ndbcluster引擎,我认为当您完成应用程序的确定后。 但是对于很多项目你有很多问题。
我已经尝试了MySQL Cluster数天,并阅读了大量的文档和它的一个非常酷的系统,但复杂的运行和pipe理。 但是我已经使用了像7.1新版本那样的老版本的mysql集群,可能有很多不同的东西。
我希望你能解决这个问题。