2

I have a problem while installing and configuring MySQL cluster running on Ubuntu 10.10

This is configuration for Cluster management

[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]

and this is configuration for both node :

[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

After running all node and management, and I use ndb_mgm, the type 'show' command, and something appear like this :

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)

look at two last line.. not as what http://dev.mysql.com/tech-resources/articles/mysql-cluster-for-two-servers.html look like (see at point 4)

anyone have ever had this problem ?

Stefan Lasiewski
  • 22,949
  • 38
  • 129
  • 184
Firman
  • 21
  • 1

1 Answers1

1

Hmm First what is very important... the management server and the mysql/storage server cannot be the same. I hope you have here really different Servers.

But your problem looks like that you have a configuration problem on your nodes or not started the nodes correct.

On first Start or for 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

its really important that the directory exists and you initial it. And for notice its a bit confusing the storage engine and mysql.server are different things. One is really the storage witch hold the data and the other is the client what you can see on bottom. Both must be started.

BUT

use --initial ONLY if its really important.

But for notice. In MySQL Cluster is one small problem. You cannot change Tables in running storage engine. So if you have a Table with the NDB storage engine you cannot add a field for example.

For this you need to change it to myisam for example change the table and then change it back to ndbcluster engine i think when you have a finished application its ok. But for many projects you have a lot of problems.

I have tried MySQL Cluster for days and read a lot of documentations and its a really cool system but complicated to run and manage. But i have used an older version of mysql cluster like the new 7.1 its possible that there are many things different.

I hope you can solve the problem.

René Höhle
  • 1,418
  • 3
  • 17
  • 26
  • Thank you @Stony. I have read carefully the documentation. and I made it identically. but the problem is the cluster doesn't work. I think the problem is in 2 last line in my management 'show' command. take a look at **[mysqld(API)] 1 node(s) id=4 (not connected, accepting connect from 192.168.10.101) ** but, as i saw in documentation, it should be like this ** [mysqld(API)] 2 node(s) id=4 (Version: 4.1.9) id=5 (Version: 4.1.9) ** – Firman Feb 27 '11 at 04:28
  • sorry for my late reply, this is because the mysql deamons are not running or not configured correct then he can't find it. What i have seen is that you gave all of them an ID. When you make this give the both mysqld an ID [MYSQLD] Id = 4 [MYSQLD] Id = 5 i hope this is the problem. In the Tutorial nothing have an Id then he can generate it for its own. And then restart mysqld under init.d for sure look in the mysql errorlog if there are any problems. – René Höhle Feb 27 '11 at 22:04
  • have you solved this problem? @Firman. – René Höhle Feb 28 '11 at 09:03