MySQL Forums
Forum List  »  NDB clusters

Re: Real World Experience
Posted by: Harrison Fisk
Date: December 01, 2004 09:02PM

Warren Konkel wrote:
> I am looking to speak with somebody over the
> telephone regarding their failure/success at
> setting up and maintaining a MySQL cluster. We're
> looking to upgrade a 1 master 1 slave MySQL setup
> to a 4 machine cluster in an attempt to handle
> scaling as well as fault tolerance. I have a 2
> machine cluster setup and working and so far I am
> impressed, but there's still a lot of questions
> that need answering before we can move to MySQL
> clusters. Here are a few questions to get
> started:
>
> 1. I have two NDB nodes setup with NoRepliacs=2.
> This means that both contain a full copy of the DB
> (correct?). When I do a "SHOW" within ndb_mgm,
> why does one show up as a master? What is the
> significance of being a "master"? Do clusters use
> the master-slaves replication that exists in
> non-clustered MySQL? Does this mean writes can
> only happen on the master and not the slaves? If
> that's the case, then I assume that this is all
> handled automatically?

No, it is a completely different replication setup. One important difference is the fact that MySQL Cluster using synchronous replication compared the other replication being asynchronous. The term 'Master' in this case, just says which node is currently in charge of keeping which fragment active. A master coordinates all of the data changes and other such things of the fragment it is master of. Even if the master of a fragment dies another node will automatically take over this load, so it isn't at all similar to normal MySQL replication. This is all transparent to you, of course.

>
> 2. If this is an in-memory database, when I
> shutdown the cluster, does all data get wiped?

No. The data is written to disk, just not in a synchronous fashion. You can configure the checkpoint times to control when the data and logs are actually written to the disk based on transaction rate/disk speed/etc...

> 3. If the ndb_mgmd goes down and comes back up,
> when/how do the MYSQLD/NDB nodes rejoin?

I don't understand this question. The ndb_mgmd is only required to be running when a new node is started up. So the ndbd/mysqld processes will continue to be part of the cluster, just like normal. The ndb_mgmd is only used for node startup/monitoring/backup starting.

> 4. Is it possible to "grow" or "shrink" the
> cluster over time? How does this work? Adding
> extra API nodes seems like it shouldn't cause
> problems, but what If I add more ndbd nodes
> allowing for further fragmentation? Does the
> cluster automatically redistribute all the data so
> the hash algorithm continues to work? Do I have
> to bring down the full cluster to do this? Is
> this even possible?

As you expected it isn't too hard to add API nodes. The easiest way to do so is to add extra ones into the config.ini when you set up the cluster initially to allow for growth room. Even if you don't do that, you can do a rolling configuration upgrade (similar to what you described in #5 below) in order to add new API nodes.

You currently can't, however, do an online addition of data nodes. In order to add new nodes you need to do the following:

1. Take a online backup
2. Reconfigure cluster
3. Restart data nodes with --initial
4. Load in back to get back schema/data

> 5. How will the cluster respond to upgrading to
> newer versions of MySQL as they are released? Can
> I upgrade node by node, allowing the cluster to
> stay active or do I need to bring the whole
> cluster down and upgrade it all at once?

Yes, you can normally do a rolling software upgrade like that for minor versions. However there are sometimes major changes in the protocol which can't be upgraded like that, but those should only occur in major MySQL version upgrades (ie. 4.1 to 5.0).

> 6. Is MySQL cluster really stable and ready for
> production?

While keeping in mind MySQL Cluster is currently labelled a gamma release, there are definitely some people using it in production today. As long as you have read the issues at http://dev.mysql.com/doc/mysql/en/MySQL_Cluster_Limitations_in_4.1.html and are familar with them, then there should be no issues using it.

>
> To summarize my concerns, I have a working cluster
> for testing and I am very impressed with how it
> works so far. However I am concerned about long
> term maintenance. If you have a few minutes and
> wouldn't mind describing your experiences with
> MySQL cluster I would be very appreciative. Feel
> free to e-mail or call me.
>
> Warren Konkel
> wkonkel @ mindshare . net
> 202-654-0800

I hope I have answered most of your questions, but I will send someone your way to talk to you as well. Good luck!

Harrison Fisk, Trainer and Consultant
MySQL AB, www.mysql.com

Options: ReplyQuote


Subject
Views
Written By
Posted
3380
December 01, 2004 10:21AM
Re: Real World Experience
2752
December 01, 2004 09:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.