Sunday, June 20, 2010

Running MySQL Cluster as a Service on Windows

The MySQL Cluster daemon for MySQL Cluster (ndbd and ndb_mgmd) doesn't by themselves yet let them run as a service (apparently ndb_mgmd does, but I haven't seen it documented anywhere on how to do that). But there are ways to fix this, using some simple Windows tools and some registry hacking.

What you need to find is the Windows Resource Kit from some version of Windows that includes instsrv.exe and srvany.exe. It is not too picky with the actual version of Windows you run it seems, I used the Windows NT 32-bit versions of these on a 64-bit Windows 7 box, and it works just fine.

These two programs are simple and are easy to use:
  • instsrv allows you to install a service, it's real simple, just run the program and it will show the options (and these are few).
  • srvany allows you to run any odd program, that is not intended run as a service, do do this anyway.
Now, Google a bit and download these two puppies and open a DOS Window and change directory to where you installed these guys. Now we are realy to install three services (1 for the mgm and two datanodes), so they will run the srvany program:
F:>ResKit> instsrv mgm1 F:\ResKit\srvany.exe
F:>ResKit> instsrv ndbd1 F:\ResKit\srvany.exe
F:>ResKit> instsrv ndbd2 F:\ResKit\srvany.exe

These three services are rather boring now, they do not do anything, really. To fix this, open the registry editor (regedit) and open:
Now, we need to define what srvany.exe should run. In the key above, create a new key called Parameters. In this key then, create two values of the type REG_SZ:
  • Application - The full path to the program srvany should run.
  • AppParameters - The parameters to pass to the program srvany will run.
In my case, I set these to, for the mgm service:
Application: F:\MySQL714\bin\ndb_mgmd.exe
AppParams: --config-file=F:\MySQL714\mgm1\config.ini --configdir=F:\MySQL714\mgm1

I think you see where I'm going with this, but just to be sure, this is what I set for the ndbd1 service:
Application: F:\MySQL714\bin\ndbd.exe
AppParams: --ndb_connectstring=nodeid=2;host=localhost:1186

And that's it, folks! Well, one more thing I guess, we want to install the MySQL Server as a serive also, but this knows how to install itself as a service and can also run nicely as a service, so this is easy:
F:\ResKit>F:\MySQL714\bin\mysqld --install MySQL714 --defaults-file=F:\MySQL714\my.ini

Make sure that the ini-file for the MySQL server is configured to access the cluster we just set up, and to have the ndbcluster engine enabled (for some reason, the latter is not enabled by default). Do this by editing the my.ini file used by the server (and referenced above) and add the following two lines to the [mysqld] section:

Now we have created and configured a bunch of services for a MySQL Cluster setup, and to try it out, lets start them using the NET command line program (the SC command may also be used):
F:\ResKit> net start mgm1
F:\ResKit> net start ndbd1
F:\ResKit> net start ndbd2
F:\ResKit> net start MySQL714

Have fun! And just a word of caution: Although this works just fine for testing, note that shutdown of the ndbd and mgm services isnt really graceful here, so this is just for fun and testing. Also, ndbd and ndb_mgmd will sure be possible to run as a Windows service in their own right, in some future version of MySQL Cluster.



Jan said...


you should check the "sc" (Service Control) command, as it can be used to create, delete and control service on Windows Systems out of the box.


Karlsson said...

True, but this still assumes that the prograns are services enabled. So the SC command could do away with instsrv and net, but not, as far as I can tell, srvany.

James said...

I would like to say that you really made my day, it's wonderful when you just look around the web
and find something like this, reminds me of that ''How to make a dinner for a romantic...'' by Elsa Thomas,
you're a wonderful writer let me tell you!!! ñ_ñ

Buy Viagra
James Maverick (
3453 Rardin Drive
San Mateo, CA 94403
Project Manager

Alex said...

I like to use MySQL Cluster daemon for MySQL Cluster service. I heard about this service that it is very good. Thanks a lot for sharing this information.


online viagra

Penis Enlargement Pills said... is an all-natural Penis Enlargement, safe, and guaranteed alternative to painful and dangerous Penis enlargement methods such as surgery, straps, or rings.
penis enlargement pills or male enhancement pills will immediately boost your performance, improve your orgasms, and increase the penis size within just a few weeks!


Best Penis Enlargement Pills said...

We just wanted to share information about best penis enlargement that are busy talking about people who want a bigger penis size, stronger and able to increase stamina.
Penis Enlargement Pills
Top Penis Enlargement Pills
Method Penis Enlargement Pills

Dissertation Writing Help said...

your post is nice . . let me tell u one thing that Blogs have become latest and important source of quality free information on net people enjoying for hours together. . .nice blog keep sharing;)
Dissertation Writing Services

Suraj45 said...

I have wanted to learn more about particular topics, but not many websites would help me out in informing me the way I expected. This left me with many question, but after reading your article, I got an answer to all my questions. You are too cool dude!!!

valentines day ideas

Generic Viagra

jackanderson said...
This comment has been removed by the author.
Raffay said...

Wow Impressive! Your blog is very informative. However, it is pretty hard task but your post and experience serve and teach me how to handle and make it more simple and manageable.Thanks for the tips… Best regards.

cheap reseller hosting |
cpanel reseller

Josh said...

Vimax is reliable stuff to accomplish your sexual dysfunction. It has been proven by many men to augment virility and genital.

Jason Smith said...
This comment has been removed by the author.
Joshua said...

hey thanks for the information.. it has been of great use .. it updating more post..thanks..


Sinan said...

Thanks so much for this! This is exactly what I was looking for bedava chat - islami chat - islami sohbet - sohbet siteleri - dini sohbet - mynet sohbet - sohbet odaları - garanti arkadas - sohbet kanallari - mirc sohbet - chat siteleri - mirc script indir - sohbet odaları - cinsel muhabbet - cinsel sohbet - Sex chat - seviyeli sohbet - kameralı sohbet - sohbet et - cinsel sohbet - sex sohbet - mirc - mirc indir - kameralı mirc - turkce mirc - sohbet siteleri - cet - chat kanali - chat kanalları - sohbet kanali - sohbet kanalları - Video izle - izmir sohbet - kaliteli sohbet - seviyeli chat - sesli sohbet

buy vicodin online said...

I have been looking for sites like this for a long time. Thank you! buy vicodin online

buy codeine online said...

I wanted to thank you for this great read.I am very pleased to find this site.
Thanks for sharing!
buy codeine online

mark said...

best organic seo servicesVery interesting thanks. I believe there's even more that could be on there! keep it up

jenifer said...

Cool blog I loved reading your info..
buy xanax online

Natasha said...

i am also loving your blog for sharing fantastic topic thanks for sharing keep it up.

Free Classified Ads

savsuns said...

Before reading this I was totally unaware of the topic. Thanks for Explaining in such a nice way. As per my knowledge there some buy lasix which are effective and good. I always prefer them only.

saim said...

I like the valuable information you provide in your articles. I’ll bookmark your weblog and check again here frequently. I am quite sure I will learn many new stuff right here! Best of luck for the next!

best over the counter sleep aid

amhash said...

Thanks for sharing such a useful information.Business Logo Design I was just surfing on internet and found your blog after reading this i realize that i should come here often.

Loraine Karins MLB BLOG said...

True, but this still assumes that the prograns are services enabled. So the SC command could do away with instsrv and net, but not, as far as I can tell, nfl jerseys
cheap mlb jerseys

Jack Harry said...

I am hoping that by my next post here, I will have the links up to Book Locker, as well as Amazon, where this new novel will be available for sale.
Dissertation Samples

Hammad Aamir said...

In 1989 I was guest curator the State of California History Museum in Sacramento for a show I created called “California Doll Artists Making History”. This show was to be the springboard for me to open my own gallery of toy makers and artisans work. This was before the internet and the concept that toys could be art was alien but I was determined. Life stepped in… toys

Usama Faisal said...

A really love to read interesting news on the internet. But sometimes it can be difficult to find top news quite easily on the internet. But this article and news rule have provided me with some great and fascinating world news and I am now really bookmarking this article.

Usama Faisal said...

This article is really good and one of the best I've ever read in my whole career of Article writing. I was also an article writer but I retired from the profession long ago. Thank you for reminding me again how beautiful articles are. I really appreciate it. land to buy in bali

Usama Faisal said...

ruTorrent is a great torrent application that allows you to control torrents on your VPS via a WebGUI that is similar looking to utorrent and variants that use that layout.Turning you VPS into a seedbox. install rutorrent

Usama Faisal said...

Wow, you are a pretty depressed man. I know this because only a depressed man can write a article with such great emotion. I don't know who depressed you, it is most probably your wife or girl-friend. But this article has been written with great emotion and you deserve a like from anyone. adwokat

Usama Faisal said...

This is a very good article, my friend. You've pulled off a total awesome article here and you should be rewarded with a lot of positive comments. That's why I am writing this comment and I hope you read this and appreciate my truthfulness. swell promo code february 2014

Usama Faisal said...

I am not disappointed but I am not very happy either with this article. Your previous articles had shine, they were sparking with information and many other things. But, frankly, this one is not up to their mark. I hope you right your wrongs. And publish good articles in the future. shutterfly

john beeter said...

I like to use MySQL Cluster daemon for MySQL Cluster service. I heard about this service that it is very good. Thanks a lot for sharing this information.

Tatjana Cvetko said...

True, but this still assumes that the prograns are services enabled. So the SC command could do away with instsrv and net, but not, as far as I can tell, srvany
izdelava spletnih strani
Izdelava spletne trgovine
optimizacija in izdelava spletnih strani
gostovanje in izdelava spletnih strani

Hieu Nguyen said...

you'd have time to look these kids active. Please visit our website and let us play the game interesting.
Thanks for sharing !
Friv 10
Kizi 10
Yepi 2

Nicolas Dutch said...

If it does thesis writing expresses readers, then the whole purpose of writing will be entirely in vain. However, we will have a team of professional thesis writers help you create a wonderful and successful thesis through their proven. We offer Cheap Dissertation Writing Service for students.

RoxyMedilton said...

Students who work in professions in their studies, it is very difficult for them to write anything in the extra time and to take time. If you are a student, and at the same time you are working in a place, it will be very difficult for you to face all things as study and work together. It 'really hard to manage time to make the data and write a thesis.

Cheap Dissertation Writing Service |
Dissertation Writing Service

RoxyMedilton said...
This comment has been removed by the author.
Nicolas Dutch said...

Many students who are not competent enough to write a thesis strive to hide his graduation and not continue studying. But it leaves a lot because of his reason is not acceptable, because if you do not have enough resources to write a thesis then there are many ways to get help.

Cheap Dissertation Writing Service

Hieu Nguyen said...

You need to kill time, you need entertainment. Refer to our website. hope you get the most comfort.
Thanks for sharing !
Friv 5
Kizi 1
Yepi 3

Deepak Negi said...

Hey thanks for sharing this post, I really appricate your work. Check here Holi stuff

Holi 2016 Speech

Holi 2016 Essay

Holika Dahan 2016 Wishes

Holika Dahan 2016 Muhurat

Holika Dahan 2016 Images

Holika Dahan 2016

Happy Friday 2016 Images

Happy Friday 2016 Wishes

Happy Friday 2016 Pictures

Happy Friday 2016 Quotes

Happy Friday 2016 Speech

Hieu Nguyen said...

When you're tired, you want to relax after a stressful working hours, you need to have time to take care of the kids active.
Please visit our website and play exciting flash games.Thanks you for sharing!
Friv 4

Chris Greenwalt said...

Thank you very much for sharing information to be used to run MySQL Cluster in Windows. Can we follow these commands in each version of Windows or there may be some change? Cheap dissertation writing services

Ashley Sewell said...

I am thinking to use my PC as host for my website. Will I be able to use MySQL Cluster as MySQL storage for my website? Dissertation writing service