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

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:

Add the new bin folder to your path (in my case “C:mysqlbin”)

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:

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:

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

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

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?

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….

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?

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.”

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?

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 :

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.

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.

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.

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.

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.

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

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.

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.

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

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

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.