My first Cluster running on Windows

I figured that it was time to check out how to install, configure, run and use MySQL Cluster on Windows. To keep things simple, this first Cluster will all run on a single host but includes these nodes:

  • 1 Management node (ndb_mgmd)
  • 2 Data nodes (ndbd)
  • 3 MySQL Server (API) nodes (mysqld)

Downloading and installing

Browse to the Windows section of the MySQL Cluster 7.0 download page and download the installer (32 or 64 bit).

MySQL Cluster Windows Installer

MySQL Cluster Windows Installer

Run the .msi file and choose the “Custom” option. Don’t worry about the fact that it’s branded as “MySQL Server 7.0” and that you’ll go on to see adverts for MySQL Enterprise – that’s just an artefact of how the installer was put together.

On the next screen, I decided to change the “Install to” directory to “c:mysql” – not essential but it saves some typing later.

Go ahead and install the software and then you’ll be asked if you want to configure the server – uncheck that as we’ll want to tailor the configuration so that it works with our Cluster.

There are a couple of changes you need to make to your Windows configuration before going any further:

  1. Add the new bin folder to your path (in my case “C:mysqlbin”)
  2. Make hidden files visible (needed in order to set up multiple MySQL Server processes on the same machine)

Configure and run the Cluster

Copy the contents of “C:ProgramDataMySQLMySQL Server 7.0data” to “C:ProgramDataMySQLMySQL Server 7.0data4”, “C:ProgramDataMySQLMySQL Server 7.0data5” and “C:ProgramDataMySQLMySQL Server 7.0data6”. Note that this assumes that you’ve already made hidden files visible. Each of these folders will be used by one of the mysqld processes.

Create the folder “c:mysqlcluster” and then create the following files there:

config.ini

[ndbd default]
noofreplicas=2
[ndbd]
hostname=localhost
id=2
[ndbd]
hostname=localhost
id=3
[ndb_mgmd]
id = 1
hostname=localhost
[mysqld]
id=4
hostname=localhost
[mysqld]
id=5
hostname=localhost
[mysqld]
id=6
hostname=localhost

my.4.cnf

[mysqld]
ndb-nodeid=4
ndbcluster
datadir="C:ProgramDataMySQLMySQL Server 7.0data4"
port=3306
server-id=3306

my.5.cnf

[mysqld]
ndb-nodeid=5
ndbcluster
datadir="C:ProgramDataMySQLMySQL Server 7.0data5"
port=3307
server-id=3307

my.6.cnf

[mysqld]
ndb-nodeid=6
ndbcluster
datadir="C:ProgramDataMySQLMySQL Server 7.0data6"
port=3308
server-id=3308

Those files configure the nodes that make up the Cluster.

From a command prompt window, launch the management node:

C:UsersAndrew>cd mysqlcluster
C:mysqlcluster>ndb_mgmd -f config.ini
2009-06-16 20:01:20 [MgmSrvr] INFO     -- NDB Cluster Management Server. mysql-5.1.34 ndb-7.0.6
2009-06-16 20:01:20 [MgmSrvr] INFO     -- The default config directory 'c:mysqlmysql-cluster' does not exist. Trying to create it...
2009-06-16 20:01:20 [MgmSrvr] INFO     -- Sucessfully created config directory
2009-06-16 20:01:20 [MgmSrvr] INFO     -- Reading cluster configuration from 'config.ini'

and then from another window, check that the cluster has been defined:

 C:UsersAndrew>ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: localhost:1186
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2 (not connected, accepting connect from localhost)
id=3 (not connected, accepting connect from localhost)
[ndb_mgmd(MGM)] 1 node(s)
id=1    @localhost  (mysql-5.1.34 ndb-7.0.6)
[mysqld(API)]   3 node(s)
id=4 (not connected, accepting connect from localhost)
id=5 (not connected, accepting connect from localhost)
id=6 (not connected, accepting connect from localhost)

Fire up 2 more command prompt windows and launch the 2 data nodes:

C:UsersAndrew>ndbd
2009-06-16 20:08:57 [ndbd] INFO     -- Configuration fetched from 'localhost:118
6', generation: 1
2009-06-16 20:08:57 [ndbd] INFO     -- Ndb started
NDBMT: non-mt
2009-06-16 20:08:57 [ndbd] INFO     -- NDB Cluster -- DB node 2
2009-06-16 20:08:57 [ndbd] INFO     -- mysql-5.1.34 ndb-7.0.6 --
2009-06-16 20:08:57 [ndbd] INFO     -- Ndbd_mem_manager::init(1) min: 84Mb initi
al: 104Mb
Adding 104Mb to ZONE_LO (1,3327)
2009-06-16 20:08:57 [ndbd] INFO     -- Start initiated (mysql-5.1.34 ndb-7.0.6)
WOPool::init(61, 9)
RWPool::init(22, 13)
RWPool::init(42, 18)
RWPool::init(62, 13)
Using 1 fragments per node
RWPool::init(c2, 18)
RWPool::init(e2, 14)
WOPool::init(41, 8 )
RWPool::init(82, 12)
RWPool::init(a2, 52)
WOPool::init(21, 5)

(repeat from another new window for the second data node).

After both data nodes (ndbd) have been launched, you should be able to see them through the management client:

ndb_mgm> show
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @127.0.0.1  (mysql-5.1.34 ndb-7.0.6, Nodegroup: 0, Master)
id=3    @127.0.0.1  (mysql-5.1.34 ndb-7.0.6, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1    @127.0.0.1  (mysql-5.1.34 ndb-7.0.6)
[mysqld(API)]   3 node(s)
id=4 (not connected, accepting connect from localhost)
id=5 (not connected, accepting connect from localhost)
id=6 (not connected, accepting connect from localhost)

Finally, the 3 MySQL Server/API nodes should be lauched from 3 new windows:

C:UsersAndrew>cd mysqlcluster
C:mysqlcluster>mysqld --defaults-file=my.4.cnf

C:UsersAndrew>cd mysqlcluster
C:mysqlcluster>mysqld --defaults-file=my.5.cnf

C:UsersAndrew>cd mysqlcluster
C:mysqlcluster>mysqld --defaults-file=my.6.cnf

Now, just check that all of the Cluster nodes are now up and running from the management client…

ndb_mgm> show
Cluster Configuration
---------------------
[ndbd(NDB)]     2 node(s)
id=2    @127.0.0.1  (mysql-5.1.34 ndb-7.0.6, Nodegroup: 0, Master)
id=3    @127.0.0.1  (mysql-5.1.34 ndb-7.0.6, Nodegroup: 0)
[ndb_mgmd(MGM)] 1 node(s)
id=1    @127.0.0.1  (mysql-5.1.34 ndb-7.0.6)
[mysqld(API)]   3 node(s)
id=4    @127.0.0.1  (mysql-5.1.34 ndb-7.0.6)
id=5    @127.0.0.1  (mysql-5.1.34 ndb-7.0.6)
id=6    @127.0.0.1  (mysql-5.1.34 ndb-7.0.6)

Using the Cluster

There are now 3 API nodes/MySQL Servers/mgmds running; all accessing the same data. Each of those nodes can be accessed by the mysql client using the ports that were configured in the my.X.cnf files. For example, we can access the first of those nodes (node 4) in the following way from (yet another) window:

C:UsersAndrew>mysql -h localhost -P 3306
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.1.34-ndb-7.0.6-cluster-gpl MySQL Cluster Server (GPLType 'help;' or 'h' for help. Type 'c' to clear the current input statement.

mysql> use test;
Database changed
mysql> create table assets (name varchar(30) not null primary key, value int) engine=ndb;
Query OK, 0 rows affected (1.44 sec
mysql> insert into assets values ('car', 950);
Query OK, 1 row affected (0.00 sec
mysql> select * from assets;
+------+-------+
| name | value |
+------+-------+
| car  |   950 |
+------+-------+
1 row in set (0.00 sec
mysql> insert into assets2 values ('car', 950);
Query OK, 1 row affected (0.00 sec)

To check that everything is working correctly, we can access the same database through another of the API nodes:

C:UsersAndrew>mysql -h localhost -P 3307
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.1.34-ndb-7.0.6-cluster-gpl MySQL Cluster Server (GPL)
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> use test;
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| assets         |
+----------------+
1 row in set (0.06 sec)
mysql> select * from assets;
+------+-------+
| name | value |
+------+-------+
| car  |   950 |
+------+-------+
1 row in set (0.09 sec)

It’s important to note that the table (and its contents) of any table created using the ndb storage engine can be accessed through any of the API nodes but those created using other storage engines are local to each of the API nodes (MySQL Servers).

Your next steps

This is a very simple, contrived set up – in any sensible deployment, the nodes would be spread accross multiple physical hosts in the interests of performance and redundancy. You’d also set several more variables in the configuration files in order to size and tune your Cluster. Finally, you’d likely want to have some of these processes running as daemons or services rather than firing up so many windows.

It’s important to note that Windows is not a fully supported platform for MySQL Cluster. If you have an interest in deploying a production system on Windows then please contact me at andrew@clusterdb.com





77 comments

  1. […] subsequent post will take the subsequent steps of moving some of them to a second host. As with my Windows post the Cluster will contain the following […]

  2. […] this article, I used 2 LINUX hosts but you could extend the Windows example introduced in My first Cluster running on Windows in exactly the same way. MySQL Cluster LINUX, multi-host, MySQL, MySQL […]

  3. Siddharth Prasad says:

    Hi
    i tried this out.seems that the cluster is working, but when i am accesing it using mysql -h localhost -p 3307 . it asks for a password and when i give the previous password it shows
    “access denied for user odbc@localhost.
    what i did is that i unsinstalled the previous version of mysql 5.1. and then installed the mysql cluster. but it did not asked me for giving any password .
    Please suggest how to go with it?

    • admin says:

      Have you made sure that permission has been granted for ‘odbc’@’localhost’? Try logging in with ‘mysql -u root’ to check and fix if needed.

  4. Siddharth Prasad says:

    hi it’s working..now . but how can i deploy it on other systems , so that i can use it from other systems…….how to get the more broader version of this….
    please Reply…

  5. Siddharth Prasad says:

    hi Andrew.
    i have some problem while making the data node on other system.when i configure all the files on my management node as described by the “DEPLOYING MYSQL CLUSTER OVER MULTIPLE HOST ON LINUX” .I am just extending it to windows.if use your example every thing is working fine…but when i make the data node on other system without making it as management node.when i issue the ndbd command…. it’s not able to identify the management node…
    I am not getting it…Can you please help me..
    it’s necessary….

    Siddharth Prasad

    • admin says:

      Hi Siddharth,

      are you specifying the correct IP address and port number (e.g. ndbd –initial -c 192.168.0.3:1186).

      What error message did you get?

      Regards, Andrew

  6. siddharth prasad says:

    Hi Andrew,
    Thanks for the Reply..Now it’s working..
    i just have to give the managment node ip with the NDBD command and in the sql node Configuration file i just have to mention one more parametre called ndb-connectstring 192.168.1.8 the ip of the managment node…..
    but every time i start my cluster i have to open like many command prompt windows…how to avoid this?

    And Can you name some good resources about managing and using the cluster configuration?

    Thanks
    Siddharth prasad

  7. Siddharth Prasad says:

    Hi Andrew
    there is a problem …when i start more than 4 data nodes . and use the
    shell: ndb_mgm show command to see the status of the server.it says cannot get configuration,illegal reply from server..and the managment server crashes..

    i searched the net and found that windows
    ” On Windows, the internal basestring_vsprintf() function did not return a POSIX-compliant value as expected, causing the management server to crash when trying to start a MySQL Cluster
    with more than 4 data nodes.”

    it will be nice of you,if you can help me out of this.

    Thank you
    siddharth Prasad

  8. Siddharth Prasad says:

    Hi Andrew
    sorry to disturb you again.
    This time the problem is of speed.with 7 lacs records in a table A group by and order by sql query takes 32 secs to give the reply.

    when i took the back up and executed it on other machine without clustering and with engine=innodb . that also takes approx 35 secs.

    is it OK . or my clustering is not working .
    i have a four data node , with 2 replica, 2 node group and 6 sql node clustering.

    if it’s not ok what should i do? Waiting for the Reply.

    Thank You
    Siddharth Prasad

  9. Erik says:

    Hi, thanks for the great post, it helped me alot setting up my first cluster on Windows. I’ve got the cluster up and running but are now faced with a stability problem, it seems that “a little now and then” my datanodes simply shut down for no apparent reason. The shutdown is not synched though and it could well be that only one datanode shut down while the other (on a different server) keep running. This would be expected if I had any connection issues and one datanode lost contact with the management node and the other node, but as far as I can see there are no connection issues here. Do you know how I can proceed to find out what’s going on?

    • admin says:

      Hi Erik,

      the first thing to check would be the log files – you should be able to recognise from the log files which data node each belongs too.

      Once you’ve had a look and there’s no obvious cause from your side then search bugs.mysql.com to see if your problem has been raised before and then raise it if not.

      Note that Windows is still considered a development-only platform for MySQL Cluster but bug reports are still gratefully received as that will help to bring it up to production level.

      Regards, Andrew.

      If it looks like there’s a problem

  10. LanhVC says:

    hi AndRew,

    in this step: Copy the contents of “C:ProgramDataMySQLMySQL Server 7.0data” to “C:ProgramDataMySQLMySQL Server 7.0data4″

    I try to find data directory in “C:ProgramDataMySQLMySQL Server 7.0” and “C:Program FilesMySQLMySQL Server 7.0” but don’t have anything.

    Please help me.
    Thanks.

  11. admin says:

    LanhVC,

    did you first make sure that you’ve set up Windows to make hidden files visible?

    Regards, Andrew.

  12. Kelvin says:

    I just tried to follow the instructions to create the cluster. After I typed ndbd, I got the errors:
    Error setting NTFS compression attribute: 6
    Error setting NTFS compression attribute: 6
    Error setting NTFS compression attribute: 6
    Error setting NTFS compression attribute: 6
    Error setting NTFS compression attribute: 5
    Error setting NTFS compression attribute: 5

    Do you have any ideas how to solve this?

    Thanks a lot

  13. LanhVC says:

    hi ANDREW,
    I maked hidden files visible.

    I finded but have in “C:Documents and SettingsAll UsersApplication DataMySQLMySQL Server 7.0”

    is this directory needed to find?
    this directory content all folder of database exist MySQL.

    Thanks,
    LanhVC.

  14. Kelvin says:

    Hi, Thanks for your reply. I downloaded from the link provided but need to search for the tutorial on how to compile it in windows as I’ve never done this before.

  15. alex says:

    hello andrew,

    i am already searching for this tutorial for ages, and thx god and to you who wrote this tutorial.
    but still, i have problems to connect to mysql API/nodes, when i launched mysqld –defaults-files=my.#.cnf, i saw in ndb_mgm like this :

    ndb_mgm> show
    Cluster Configuration
    ———————
    [ndbd(NDB)] 2 node(s)
    id=2 @127.0.0.1 (mysql-5.1.35 ndb-7.0.7, Nodegroup: 0, Master)
    id=3 @127.0.0.1 (mysql-5.1.35 ndb-7.0.7, Nodegroup: 0)

    [ndb_mgmd(MGM)] 1 node(s)
    id=1 @127.0.0.1 (mysql-5.1.35 ndb-7.0.7)

    [mysqld(API)] 3 node(s)
    id=4 @127.0.0.1 (mysql-5.1.35 ndb-7.0.7)
    id=5 (not connected, accepting connect from localhost)
    id=6 (not connected, accepting connect from localhost)

    ndb_mgm> show
    Cluster Configuration
    ———————
    [ndbd(NDB)] 2 node(s)
    id=2 @127.0.0.1 (mysql-5.1.35 ndb-7.0.7, Nodegroup: 0, Master)
    id=3 @127.0.0.1 (mysql-5.1.35 ndb-7.0.7, Nodegroup: 0)

    [ndb_mgmd(MGM)] 1 node(s)
    id=1 @127.0.0.1 (mysql-5.1.35 ndb-7.0.7)

    [mysqld(API)] 3 node(s)
    id=4 (not connected, accepting connect from localhost)
    id=5 (not connected, accepting connect from localhost)
    id=6 (not connected, accepting connect from localhost)

    ndb_mgm> show
    Cluster Configuration
    ———————
    [ndbd(NDB)] 2 node(s)
    id=2 @127.0.0.1 (mysql-5.1.35 ndb-7.0.7, Nodegroup: 0, Master)
    id=3 @127.0.0.1 (mysql-5.1.35 ndb-7.0.7, Nodegroup: 0)

    [ndb_mgmd(MGM)] 1 node(s)
    id=1 @127.0.0.1 (mysql-5.1.35 ndb-7.0.7)

    [mysqld(API)] 3 node(s)
    id=4 (not connected, accepting connect from localhost)
    id=5 (not connected, accepting connect from localhost)
    id=6 (not connected, accepting connect from localhost)

    ndb_mgm>

    it wont connect, well it connect for a while and than disconnect, could u help me with this…?

    Best Regards

    Alex

  16. alex says:

    hi andrew

    the are no messages on the mysqld, as shown below :

    Ion@ION C:mysqlmysql-cluster
    # mysqld –default-files=my.7.cnf

    Ion@ION C:mysqlmysql-cluster
    #

  17. Xavi says:

    Hi Andrew,

    I’ve had the same problem and I fixed it. It was because I didn’t install the MySql Administrator wizard. And then restart your machine.

  18. Xavi says:

    Sorry, my message was for Alex not Andrew.

  19. alex says:

    hi andrew

    i am tracing the mysql error and found this ;

    091006 11:00:28 [Note] Plugin ‘FEDERATED’ is disabled.
    091006 11:00:29 [Note] PrimeBase XT (PBXT) Engine 1.0.08 RC loaded…
    091006 11:00:29 [Note] Paul McCullagh, PrimeBase Technologies GmbH, http://www.primebase.org
    091006 11:00:30 InnoDB: Started; log sequence number 0 46409
    091006 11:00:32 [Note] Event Scheduler: Loaded 0 events
    091006 11:00:32 [Note] C:xamppmysqlbinmysqld.exe: ready for connections.
    Version: ‘5.1.37’ socket: ” port: 3306 Source distribution
    091006 11:31:11 [Note] C:xamppmysqlbinmysqld.exe: Normal shutdown

    091006 11:31:12 [Note] Event Scheduler: Purging the queue. 0 events
    091006 11:31:12 InnoDB: Starting shutdown…
    091006 11:31:13 InnoDB: Shutdown completed; log sequence number 0 46409
    091006 11:31:13 [Note] PrimeBase XT Engine shutdown…
    091006 11:31:13 [Warning] Forcing shutdown of 1 plugins
    091006 11:31:13 [Note] C:xamppmysqlbinmysqld.exe: Shutdown complete

    091006 11:34:10 InnoDB: Started; log sequence number 0 46409
    091006 11:34:11 [Note] Event Scheduler: Loaded 0 events
    091006 11:34:11 [Note] C:xamppmysqlbinmysqld.exe: ready for connections.
    Version: ‘5.1.35-ndb-7.0.7-cluster-gpl’ socket: ” port: 3306 MySQL Cluster Server (GPL)

    could u help me with this, it make my other node database didn’t work

    regards

    alex

  20. alex says:

    hi andrew

    there are another log error, as shown bellow :

    091010 14:42:03 InnoDB: Started; log sequence number 0 46409
    091010 14:42:03 [Note] NDB: NodeID is 7, management server ‘localhost:1186’
    091010 14:42:03 [Note] NDB[0]: NodeID: 7, all storage nodes connected
    091010 14:42:03 [Note] Starting Cluster Binlog Thread
    Can’t start server: Bind on TCP/IP port: No such file or directory
    091010 14:42:03 [ERROR] Do you already have another mysqld server running on port: 3307 ?
    091010 14:42:03 [ERROR] Aborting

    this is confussing cos, i am using deffrent port on it 3306,3307,3308 as usuggested in your tutorial but it said Do you already have another mysqld server running on port : 3307

    please help me

    regards

    alex

    • admin says:

      Hi Alex,

      I’ll be experimenting more on Windows soon – I’ll let you know if I seem anything similar.

      Have you tried the suggestion from Xavi?

      If that doesn’t help then I’d suggest searching bugs.mysql.com to see if anyone has raised a similar issue and create a bug report if they haven’t.

      Andrew.

  21. alex says:

    hi xavi

    what do you mean about mysql administrator wizard..? do you mean mysql administrator GUI or else..?

    regards

    Alex

  22. jimmy says:

    Hi there, i cant seem to connect my nodes. Same problem with alex…

  23. admin says:

    Something has recently changed in Cluster that meant that the mysqld processes wouldn’t connect to the Cluster. I’ve now replaced “ndbcluster=true” with just “ndbcluster” in the my.X.cnf files and it should now work again.

    Andrew.

  24. kelvin says:

    Hi Andrew,

    Currently i am using different hosts for my SQL nodes. However, they do seem to work when i fire them to start. I have tried alot of method but it just didnt work.

    this is my my.cnf file on the different machines:

    [mysqld]
    ndbcluster
    ndb-connectstring=xxx.xxx.42.158
    datadir=”C:…data”
    port=3306
    server-id=3306
    —————————————
    this is my config.ini:
    [ndbd default]
    NoOfReplicas=4

    [ndb_mgmd]
    id=1
    hostname=xxx.xxx.42.158

    [ndbd]
    id=19
    hostname=xxx.xxx.178.197

    [ndbd]
    id=20
    hostname=xxx.xxx.12.195

    [ndbd]
    id=21
    hostname=xxx.xxx.178.197

    [ndbd]
    id=22
    hostname=xxx.xxx.17.234

    [mysqld]
    [mysqld]
    [mysqld]

  25. […] on from the earlier article on running MySQL Cluster on a single Windows host, this one looks at installing and running over multiple Windows […]

  26. person says:

    excellent tutorial!

    Definitely helped me get my cluster working!

    Thanks! =D

  27. Mayank says:

    I cannot find the .msi file
    where is it??
    I searched the whole folder 🙁

  28. Anbu says:

    Hi Andrew

    I am using mysql-cluster-gpl-7.1.2a-beta-win32.zip version of MySQL Cluster.

    I prepared the config.ini file but when I ran ndb_mgmd command, it is showing the following error:

    C:mysqlcluster>ndb_mgmd -f config.ini
    2010-04-19 16:59:51 [MgmtSrvr] INFO — NDB Cluster Management Server. mysql-5.1.41 ndb-7.1.2
    2010-04-19 16:59:51 [MgmtSrvr] INFO — Reading cluster configuration from ‘config.ini’
    2010-04-19 16:59:51 [MgmtSrvr] ERROR — at line 1: Value specified outside section
    2010-04-19 16:59:51 [MgmtSrvr] ERROR — at line 1: Could not parse name-value pair in config file
    .
    2010-04-19 16:59:51 [MgmtSrvr] ERROR — Could not load configuration from ‘config.ini’
    2010-04-19 16:59:51 [MgmtSrvr] ERROR — Could not determine which nodeid to use for this node. Sp
    ecify it with –ndb-nodeid= on command line

    Help me in resolving it

    Thanks
    Anbu

  29. Anbu says:

    Hi Andrew

    I resolved this above issue of “config.ini” file read error by saving the file with Converter type as “default” in the file editor.

    Now, the following processes are running as expected as discussed in the article “My first Cluster running on Windows”

    (1) ndb_mgmd

    (2) nbd_mgm

    (3) ndbd

    (4) ndbd

    When I try to start the mysqld with the following commands,

    C:mysqlcluster>mysqld –defaults-file=my.4.cnf

    C:mysqlcluster>mysqld –defaults-file=my.5.cnf

    C:mysqlcluster>mysqld –defaults-file=my.6.cnf

    these commands make the processes to stay for two seconds and it exits by itself.

    So, it is not shwoing any error messages also but in the ndb_mgmd console shows the following log messages:

    reserved_nodes 1 and 4.
    2010-04-20 14:46:30 [MgmtSrvr] INFO — Node 4: mysqld –server-id=3306
    2010-04-20 14:46:31 [MgmtSrvr] INFO — Node 3: Node 4 Connected
    2010-04-20 14:46:31 [MgmtSrvr] INFO — Node 3: Node 4: API mysql-5.1.41 ndb-7.1.2
    2010-04-20 14:46:31 [MgmtSrvr] INFO — Node 2: Node 4 Connected
    2010-04-20 14:46:31 [MgmtSrvr] INFO — Node 2: Node 4: API mysql-5.1.41 ndb-7.1.2
    2010-04-20 14:46:31 [MgmtSrvr] ALERT — Node 2: Node 4 Disconnected
    2010-04-20 14:46:31 [MgmtSrvr] INFO — Node 2: Communication to Node 4 closed
    2010-04-20 14:46:31 [MgmtSrvr] INFO — Node 3: Communication to Node 4 closed
    2010-04-20 14:46:31 [MgmtSrvr] ALERT — Node 3: Node 4 Disconnected
    2010-04-20 14:46:31 [MgmtSrvr] INFO — Mgmt server state: nodeid 4 freed, m_reserved_nodes 1.
    2010-04-20 14:46:35 [MgmtSrvr] INFO — Node 2: Communication to Node 4 opened
    2010-04-20 14:46:35 [MgmtSrvr] INFO — Node 3: Communication to Node 4 opened
    2010-04-20 15:06:34 [MgmtSrvr] INFO — Mgmt server state: nodeid 4 reserved for ip 127.0.0.1, m_
    reserved_nodes 1 and 4.
    2010-04-20 15:06:34 [MgmtSrvr] INFO — Node 4: mysqld –server-id=3306
    2010-04-20 15:06:35 [MgmtSrvr] INFO — Node 2: Node 4 Connected
    2010-04-20 15:06:35 [MgmtSrvr] INFO — Node 3: Node 4 Connected
    2010-04-20 15:06:35 [MgmtSrvr] INFO — Node 2: Node 4: API mysql-5.1.41 ndb-7.1.2
    2010-04-20 15:06:35 [MgmtSrvr] INFO — Node 3: Node 4: API mysql-5.1.41 ndb-7.1.2
    2010-04-20 15:06:35 [MgmtSrvr] ALERT — Node 3: Node 4 Disconnected
    2010-04-20 15:06:35 [MgmtSrvr] INFO — Node 3: Communication to Node 4 closed
    2010-04-20 15:06:35 [MgmtSrvr] ALERT — Node 2: Node 4 Disconnected
    2010-04-20 15:06:35 [MgmtSrvr] INFO — Node 2: Communication to Node 4 closed
    2010-04-20 15:06:35 [MgmtSrvr] INFO — Mgmt server state: nodeid 4 freed, m_reserved_nodes 1.
    2010-04-20 15:06:38 [MgmtSrvr] INFO — Node 2: Communication to Node 4 opened
    2010-04-20 15:06:38 [MgmtSrvr] INFO — Node 3: Communication to Node 4 opened
    2010-04-20 15:06:54 [MgmtSrvr] INFO — Mgmt server state: nodeid 5 reserved for ip 127.0.0.1, m_
    reserved_nodes 1 and 5.
    2010-04-20 15:06:54 [MgmtSrvr] INFO — Node 5: mysqld –server-id=3307
    2010-04-20 15:06:54 [MgmtSrvr] INFO — Node 3: Node 5 Connected
    2010-04-20 15:06:54 [MgmtSrvr] INFO — Node 2: Node 5 Connected
    2010-04-20 15:06:54 [MgmtSrvr] INFO — Node 3: Node 5: API mysql-5.1.41 ndb-7.1.2
    2010-04-20 15:06:54 [MgmtSrvr] INFO — Node 2: Node 5: API mysql-5.1.41 ndb-7.1.2
    2010-04-20 15:06:55 [MgmtSrvr] INFO — Node 2: Communication to Node 5 closed
    2010-04-20 15:06:55 [MgmtSrvr] ALERT — Node 3: Node 5 Disconnected
    2010-04-20 15:06:55 [MgmtSrvr] INFO — Node 3: Communication to Node 5 closed
    2010-04-20 15:06:55 [MgmtSrvr] ALERT — Node 2: Node 5 Disconnected
    2010-04-20 15:06:55 [MgmtSrvr] INFO — Mgmt server state: nodeid 5 freed, m_reserved_nodes 1.
    2010-04-20 15:06:58 [MgmtSrvr] INFO — Node 2: Communication to Node 5 opened
    2010-04-20 15:06:59 [MgmtSrvr] INFO — Node 3: Communication to Node 5 opened
    2010-04-20 15:37:25 [MgmtSrvr] INFO — Node 2: Local checkpoint 4 started. Keep GCI = 2578 oldes
    t restorable GCI = 2578
    2010-04-20 15:37:25 [MgmtSrvr] INFO — Node 2: Local checkpoint 4 completed
    2010-04-20 16:40:24 [MgmtSrvr] INFO — Node 2: Local checkpoint 5 started. Keep GCI = 4422 oldes
    t restorable GCI = 2578
    2010-04-20 16:40:25 [MgmtSrvr] INFO — Node 2: Local checkpoint 5 completed

    Can you please help to resolve this issue?
    Advance Thanks
    Anbu

  30. Anbu says:

    Hi Andrew

    With respect to the above issue, following are the errors shown when I try to use the mysql client in the same desktop

    C:mysqlmysql-cluster>mysql -h localhost -P 3306
    ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)

    C:mysqlmysql-cluster>mysql -h localhost -P 3307
    ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)

    C:mysqlmysql-cluster>mysql -h localhost -P 3308
    ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)

    Please help in resolving this above issues

    Advance Thanks & Regards
    Anbu

    • admin says:

      Hi Anbu,

      have you used the Windows task manager to check if the mysqld processes are running? If so, try substituting ‘localhost’ with 127.0.0.1.

      Andrew.

  31. Anbu says:

    Hi Andrew

    I have replaced the ‘localhost’ text with ‘127.0.0.1’ and I ran the ndb_mgmd, but there is no effect in the mysqld process execution. It has the same behavior as mentioned above.

    Yes, I have used the Task Manager only to verify the processes running.

    When I verified the mysqld error log file as mentioned by you, I am seeing the following error in it.

    mysqld: Table ‘mysql.plugin’ doesn’t exist
    100421 19:27:48 [ERROR] Can’t open the mysql.plugin table. Please run mysql_upgrade to create it.
    100421 19:27:48 InnoDB: Started; log sequence number 0 44233
    100421 19:27:49 [Note] NDB: NodeID is 4, management server ‘localhost:1186’
    100421 19:27:49 [Note] NDB[0]: NodeID: 4, all storage nodes connected
    100421 19:27:49 [Note] Starting Cluster Binlog Thread
    100421 19:27:49 [ERROR] Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist

    I have verified the MySQL forums to resolve these issues. They are describing that the MySQL System Table are not available properly and need to recreate them. For this, we need to execute the following commands

    mysql_install_db
    mysqld_safe

    To run the first command, I need to execute the perl script file provided in the scripts folder but it is expecting that the MySQL Server should be installed in the following folder

    C:Program FilesMySqlMySQL Server 5.1

    As per our initial discussion in the article, the mysql cluster should be installed in the following folder

    c:mysql

    Please send your suggestion to resolve this issue of not starting the mysqld processes.

    Advance Thanks
    Anbu

    • admin says:

      Hi Anbu,

      on Windows, I don’t use the mysql_install_db script (as I haven’t gone to the trouble of installing Perl); instead, I just copy the contents of the mysql database that came with the installation. This is described in the above blog entry.

      Regards, Andrew.

  32. Rajendra Stalekar says:

    Hi Andrew,
    I have installed mysql-cluster-gpl-7.1.3 on my desktop.
    Everything is working fine , except sqld
    I have created a directory C:ProgramDataMySQLMySQL Server 7.1.3data4, then similarly data5 and data6 folders.
    I then created in C:mysqlcluster my.4.cnf, my.5.cnf and my.6.cnf as mentioned in the above steps.
    Following is what I have mentioned in the my.4.cnf file :-
    [mysqld]
    ndb-nodeid=4
    ndbcluster=true
    datadir=”C:ProgramDataMySQLMySQL Server 7.1.3data4″
    port=3306
    server-id=3306

    Then I executed
    mysqld –defaults-file=my.4.cnf from the command prompt and it gave me an error

    [ERROR] Can’t find messagefile ‘C:mysqlshareenglisherrmsg.sys’

    Later I created the folder hierarchy as shown above and created a empty text file errmsg.sys
    I again executed the
    mysqld –defaults-file=my.4.cnf from the command prompt and it gave me an error
    [ERROR] Can’t read from messagefile ‘C:mysqlshareenglisherrmsg.sys’
    What could be the problem?
    Thanks in advance.

  33. Manik says:

    Hi Andrew,

    I am getting the same error as Rajendra. But i used “ndbcluster” directly.

    Can you please give me a guideline.

    thanks in advance

    manik

  34. Manik says:

    thanks admin.
    it now working.
    i used the zip file.

    manik

  35. Sammy says:

    Got my cluster up and running.
    I would be interested to see –

    1. How I can run the nodes and the management server in the form of services

    2. Or an alternate way by which I don’t have to manually run the command to start the nodes ..

    Regards,
    Sammy Lamba

  36. Md. Mijanur Rahman says:

    Sir, when I wanna access the first node, it asks me for a password and I don’t know where from I’d get the password as I’m a beginner.
    And whats the name of the second data node other than ndbd. I’m waiting for your help.

  37. Rabin says:

    When I type command “ndbd”, I can’t start the data node.

    The error is

    “2010-09-08 10:00:57 [ndbd] INFO — Angel connected to ‘localhost
    2010-09-08 10:00:57 [ndbd] INFO — Angel allocated nodeid: 2”

    Please help!

  38. Nguyen Huu Tinh says:

    Dear admin, I had finish this lab, but when I implement on
    my website(Tomcat server), I don’t know how to connect to db using
    mysql cluster because in Connection config, i can set only db
    port.So,can you help me with an Web app demo with mysql clustering.
    Thank you so much and best regards nguyenhuutinh

    • admin says:

      Haven’t tried it myself yet but if there is no way for you to specify the IP Address in addition to the port number then you could always run it on the same server as one of your mysqlds

  39. Panagiotis says:

    Hi,

    thanks for your post for installing mysql cluster on a sinlge windows 7 pc. What i need is to install mysql cluster on two windows 7 pcs so as to show a small desmonstration of the data replication as part of my final year project.

    Is this possible? Is there any tutorial for this?

  40. Pradeep Sharam says:

    Hi,

    I want to install/configure mysql cluster on two nodes.

    Kindly tell me how can I install this .

    Kindly share the doc.

  41. bunty says:

    hey i followed the instructions but i am struck at

    C:mysqlcluster>ndb_mgmd -f config.ini

    it shows an error ‘ndb_mgmd’ is not recognised as an external or external command,operable program or batch file.

    PLEASE HELP ME OUT ASAP

    • andrew says:

      Hi bunty,

      you either need to include MySQL Cluster’s bin folder in your Windows path or provide the full path to ndb_mgmd.exe when you invoke it.

      Regards, Andrew.

  42. bunty says:

    sir

    i followed ur tutorial but when i type

    ndb_mgmd -f config.ini

    its showin an error

    ndb_mgmd is not recognized as an internal or external command,operable program or batch file.

    plzz help me out i m stuck

    i wz tryn to install it on win 7

  43. Anand says:

    Everything’s working fine.
    However, the ndbcluster engine is not being shown while exeucting ‘show engines’. Hence, i’m not able to create tables with ndbcluster engine support. Please help

    • andrew says:

      Anand – a couple of things to check:

      1) include the text “ndbcluster” in the config file for the mysqld
      2) Make sure that there are no firewall rules preventing the mysqld connecting with the management and data nodes
      3) make sure that you only use the mysqld that comes with the Cluster package.

      Andrew.

  44. Omar says:

    Hi sir,
    I followed your steps, but when I type command “show engines” Nbdcluster suppourt is “NO”
    I checked the firewalls and they are disabled and I specified in the configuration file default-storage-engine=NDBCLUSTER
    so what may be the cause of the problem

    PLEAS HELP ME ASAP

    • andrew says:

      Omar,

      Check what’s displayed when you start the mysqld process.

      Confirm that the management node and data nodes are running by executing ”ndb_mgm -e show”.

      Confirm that you’re running the mysqld that came with MySQL Cluster rather than another one that you already had installed on the system.

      Andrew.

  45. Omar says:

    Hi sir,
    Thank you very much for your response, I followed your steps and these where the results

    >Check what’s displayed when you start the >mysqld process.

    that was the result:-
    “welcome to MySQL monitor.
    your MySQL connection id is 11
    server version: 5.5.27-ndb-7.2.8-cluster-commercial-advanced MySQL Clusterserver – Advanced Edition”

    >Confirm that the management node and data >nodes are running by executing ”ndb_mgm -e >show”.

    I ran this command and it showed that all nodes are connected EXCEPT the SQL nodes

    >Confirm that you’re running the mysqld that >came with MySQL Cluster rather than another >one that you already had installed on the >system

    I confirm that the mysqld that came with MYSQL cluster is the one running.

    best regards,
    Omar

  46. Omar says:

    Thank you very much for your support!! highly appreciated, the problem has been solved, but another problem arised. I have two data nodes first one with nodeid=6 and the other one with nodeid=25, when I first started I typed the command “ndbd –initial” and the angle was connected and allocated correctly, then I typed the “show” command on the Managment node and the results where:
    id=6 @192.x.x.x (…, starting,nodegroup:0)
    id=6 @192.x.x.x (…, starting,nodegroup:0)
    then it shows a message:
    node 25:forced shutdown completed. occuring during startphase 0, Initiated by single 9
    and when I typed the “show command again this was the status:
    id=6 @192.x.x.x (…, starting,nodegroup:0)
    id=6 (not connected, accepting connect from 192.x.x.x)
    so how can I resolve this issue.
    thank you for your support

    best regards,
    omar

  47. Omar says:

    sorry correction: the output of the last “show” command is:
    id=6 @192.x.x.x (…, starting,nodegroup:0)
    id=25 (not connected, accepting connect from 192.x.x.x)

  48. Karen says:

    There is no .MSI file in the installation pacakge. just a zip package.

    Is there a way to install it using the MSI? I am just wondering if the MSI is missing

  49. Gaurav says:

    Hi Andrew
    I tried to create cluster but I am facing issue to run api node
    here is error log
    131201 3:44:10 [Note] Plugin ‘FEDERATED’ is disabled.
    131201 3:44:11 InnoDB: Started; log sequence number 0 44233
    131201 3:44:11 [ERROR] mysqld: unknown variable ‘ndb-nodeid=4’
    131201 3:44:11 [ERROR] Aborting

    —————————-
    ndb_mgm> show
    Cluster Configuration
    ———————
    [ndbd(NDB)] 2 node(s)
    id=2 @127.0.0.1 (mysql-5.1.72 ndb-7.1.29, Nodegroup: 0, *)
    id=3 @127.0.0.1 (mysql-5.1.72 ndb-7.1.29, Nodegroup: 0)

    [ndb_mgmd(MGM)] 1 node(s)
    id=1 @127.0.0.1 (mysql-5.1.72 ndb-7.1.29)

    [mysqld(API)] 3 node(s)
    id=4 (not connected, accepting connect from localhost)
    id=5 (not connected, accepting connect from localhost)
    id=6 (not connected, accepting connect from localhost)

    Thanks

    • andrew says:

      Gaurav,

      double check that the mysqld you’re using is one that came as part of a MySQL Cluster package – this error suggests that you’re using a “reguar” mysqld instead.

      Andrew.

  50. Gaurav says:

    Hi Andrew

    Thanks for your effort for explaining the cluster setup,
    I successfully configured mysql cluster with the help of you tutorial.

    Regards
    Gaurav

  51. saor says:

    why i can still cant find this directory from my instalation even i have folder alredy visible ??

    Copy the contents of “C:ProgramDataMySQLMySQL Server 7.0data” to “C:ProgramDataMySQLMySQL Server 7.0data4″, “C:ProgramDataMySQLMySQL Server 7.0data5″ and “C:ProgramDataMySQLMySQL Server 7.0data6″. Note that this assumes that you’ve already made hidden files visible. Each of these folders will be used by one of the mysqld processes.

    My Version Sql Cluster is 7.3.3

    thx for helping me.

  52. Kailas Gorane says:

    Hi Andrew,
    I am referring to this tutorial to setup mySql cluster. But, sqlserver node is not coming up. Below is output from mgmt console –

    [ndbd(NDB)] 2 node(s)
    id=2 @10.15.4.30 (mysql-5.7.17 ndb-7.5.5, Nodegroup: 0, *)
    id=3 @10.15.4.34 (mysql-5.7.17 ndb-7.5.5, Nodegroup: 0)

    [ndb_mgmd(MGM)] 1 node(s)
    id=1 @10.15.4.48 (mysql-5.7.17 ndb-7.5.5)

    [mysqld(API)] 2 node(s)
    id=4 (not connected, accepting connect from 10.15.4.36)
    id=5 (not connected, accepting connect from 10.15.4.47)

    My config.ini file is configured as below-

    [ndbd default]
    noofreplicas=2
    [ndbd]
    hostname=10.15.4.30
    NodeId=2
    [ndbd]
    hostname=10.15.4.34
    NodeId=3
    [ndb_mgmd]
    NodeId = 1
    hostname=10.15.4.48
    DataDir=E:/mysqlcluster/cluster-logs #Directory of the management node Log files
    [mysqld]
    NodeId=4
    hostname=10.15.4.36
    [mysqld]
    NodeId=5
    hostname=10.15.4.47

    Below is the my.cnf file on 10.15.4.36 –
    [mysqld]
    ndb-nodeid=4
    ndbcluster
    Ndb-connectstring=10.15.4.48
    port=3306
    server-id=3306

    Could you please reply to this issue?

Leave a Reply