How To Set Up A Load-Balanced MySQL Cluster 127
hausmasta writes "This tutorial shows how to configure a MySQL 5 cluster with three nodes: two storage nodes and one management node. This cluster is load-balanced by a high-availability load balancer that in fact has two nodes that use the Ultra Monkey package which provides heartbeat (for checking if the other node is still alive) and ldirectord (to split up the requests to the nodes of the MySQL cluster)."
sounds cool, but MAJOR drawbacks! (Score:1, Interesting)
"All data is stored in RAM! Therefore you need lots of RAM on your cluster nodes. The formula how much RAM you need on ech node goes like this:
(SizeofDatabase × NumberOfReplicas × 1.1 ) / NumberOfDataNodes
So if you have a database that is 1 GB of size, you would need 1.1 GB RAM on each node!
- The cluster management node listens on port 1186, and anyone can connect. So that's definitely not secure"
Re:sounds cool, but MAJOR drawbacks! (Score:5, Interesting)
The RAM only bit will go away once MySQL 5.1 is released. It's currently in early beta. It doesn't mean you lose your data if there's a power failure; the data is backed up to disk regularly.
Re:sounds cool, but MAJOR drawbacks! (Score:2)
Re:sounds cool, but MAJOR drawbacks! (Score:4, Informative)
> mean you lose your data if there's a power failure; the data is backed up to disk regularly.
Seems backwards, but this is probably because mysql bought a product and has had to figure out how to bolt persistence onto it. A much simpler approach is to go the direction of most commercial databases: provide fine-tuned memory controls that easily ensure that the most-used data is kept in memory.
In this scenario (with a database like db2 or oracle) you simply organize tables into tablespaces, dedicate however much memory you want to each tablespace. If you want a table to live in memory - just give it enough memory and it will. If a different table is 100 GB in size, then give it as much memory as you want and the database will manage the memory cache accordingly.
With a solution like the above you don't need completely separate products, but instead see clustering, in-memory databases, and reliable persistence as all just different aspects of a robust and mature database.
Re:sounds cool, but MAJOR drawbacks! (Score:4, Informative)
You can get some of that by allocating data space to RAM on one server but that doesn't get you all of Cluster's properties. Cheaper if you can use the approach you gave, of course, just doesn't do the job for some situations. Same for the Memory engine approach I outlined - doesn't get you all Cluster provides, but is enough for some situations.
Like the other MySQL storage engines, you don't use the Cluster engine if you don't need its properties. It's a pick the right engine for the job situation.
Re:sounds cool, but MAJOR drawbacks! (Score:2)
'Ultra Monkey'? (Score:5, Insightful)
Re:'Ultra Monkey'? (Score:4, Insightful)
Problem solved.
Re:'Ultra Monkey'? (Score:2)
Is it just me or does it seem a bit bad idea in most cases where the data amount is small but traffic is high? The latencies created all over this ultra monkey setup will make it slow, if compared to one smtp box with 2 cpu's and a really good raid card in it, attached to 15k rpm scsi disks, i don't think there's much of a difference in
Re:'Ultra Monkey'? (Score:1)
*cough*karmawhore*cough*
Re:'Ultra Monkey'? (Score:2)
Is it just me or does it seem a bit bad idea in most cases where the data amount is small but traffic is high?
Yeah, you may as well partition your DB and be done with coordination.
Re:'Ultra Monkey'? (Score:5, Funny)
Re:'Ultra Monkey'? (Score:2, Funny)
Re:'Ultra Monkey'? (Score:1)
Re:'Ultra Monkey'? (Score:1)
Re:'Ultra Monkey'? (Score:1)
Re:'Ultra Monkey'? (Score:2)
Of course, since it's open source there's nothing to prevent you from renaming i
Re:'Ultra Monkey'? (Score:1)
Re:'Ultra Monkey'? (Score:5, Insightful)
You seem to be confusing "literal names" with "good names". What makes a good name isn't that it literally means what it does, it's that it 1) sounds good, and 2) doesn't have negative connotations, and 3) isn't hard to say. It's a bonus if it even vaguely resembles what it does. Lotus Notes, Oracle and Excel all have vague connotations of what they do, but more importantly, there is nothing offensive about them, and they're easy to say and remember.
Compare to some of the popular names in Open Source. GIMP. Gnu (Gah-nu, the absolutely STUPIDEST name and pronounciation ever invented, and that goes for all their programs with the 'g' prefix). Ultra Monkey is right in line with traditional stupid naming.
Re:'Ultra Monkey'? (Score:1, Troll)
But it wasn't invented [wikipedia.org], it's a wildebeest. What they did tack on, unbelievably, is the crappy pronunciation.
That's right, they found the worst word in the world, took a dump on its pronunciation, and then demanded that we prefix Linux with it. Ha! "Let me know how that works out for you".
Re:'Ultra Monkey'? (Score:1)
I take it you haven't heard "The gnu song" (I'm a gnu) by Flanders and Swann ?
They pronounce it "ger-noo" throughout.
And seeing as that was recored in 1959, it predates the Stallman Gnu effort somewhat.
In fact, I was 'brought up' thinking this was how "gnu" is pronounced, maybe due to hearing this song as a child.
google/p2p it.
Re:'Ultra Monkey'? (Score:2)
I didn't mean "invented" as in created the word from nothing, I just meant the name they picked. And yes, it would've been a stupid name even without the stupid pronunciation, but the added syllable just proves how brainless they are about P.R.
Re:'Ultra Monkey'? (Score:1)
Actually, Gnu is a good name. The recursive acronym isn't necessarily board member friendly, but it is not offensive, it's difficult to misinterpret, and it doesn't put anybody off anything.
Prepending other names with 'g' on the other hand works only when it's a good word (like Gopher, or Gnome).
Re:'Ultra Monkey'? (Score:1)
I don't want to nitpick but originally "documents" were called "notes" in Lotus Notes. Later on probably PR guys thought that "document" sounds better. There are still property names (like NoteID) and API functions (like SelectAllNotes) that mention "notes" in Lotus Notes.
Re:'Ultra Monkey'? (Score:3, Insightful)
What is all this shit whining about names of "open source" (bleurgh) projects?
I am the fucking CTO. I couldn't give a shit what the name of the product is. I want to know if it works.
"Professional name"?
Re:'Ultra Monkey'? (Score:1, Funny)
Re:'Ultra Monkey'? (Score:2, Troll)
Re:'Ultra Monkey'? (Score:2)
I, too, am the "CTO" of my company, but that is only to increase the chances that my quotes/sound-bytes will be used in marketing crap from Oracle, or anyone else who needs at least a "C" level officer listed in order to seem credible. In reality, I'm the Technical Architect, President, etc., of a 10-man shop.
That being said, I have a ton of large clients where CTO me
Re:'Ultra Monkey'? (Score:2)
"Does it work?" is a meaningless question asked by a great many CxO's.
Usually they really DON'T know if it "works" because they don't have any idea what the business needs are.
Does Windows "work"? Does that modem over there "work"? Does the shiny new laptop on your desk "work"? Nope.
They don't "work" unless a smart human makes them either a) Make the company revenue, or b) Save the company revenue.
The real question is:
a) Does it make the company money?
b) Does it save the com
Re:'Ultra Monkey'? (Score:2)
Re:'Ultra Monkey'? (Score:2)
Re:'Ultra Monkey'? (Score:2)
Nothing to do with names.
Re:'Ultra Monkey'? (Score:3, Interesting)
Re:'Ultra Monkey'? (Score:1, Troll)
Write a check? It's an open source program. Oh and when was the last time you wrote THE NAME OF THE PRODUCT on a check? You write the check out to the company, is the company named ultra monkey?
"and sometimes needs to be run by not-so-open-minded people who happen to write the check."
Just go download it. You don't need a check.
"At least those a my thoughts."
Well we now know why you are a CTO. You have cleary risen/flo
Re:'Ultra Monkey'? (Score:1)
Hmm... While one certainly does not need a check to use an open source software, one does need to get a permission to use company resources to implement the project (people, to be precise) which involves submitting certain documentation known as project charter, or project specs. For those of us who is not clear on what "write a check" means, let me be more specific - "write check" = "allow usage of company resources in a particular project". I am also not sure how familiar some people may be with the way
Re:'Ultra Monkey'? (Score:2)
OK let's see how this conversation might go...
"sir, we are going to implement a clustered failover database so that we don't have any downtime and our customers will be happy, the best part is that it's not going to cost anything!
Re:'Ultra Monkey'? (Score:1)
Hint: In the real world companies have internal budgets for resources.
For example: If it takes me a day to learn how to install & configure "Ultra Monkey" on a box, then that costs the company a day of my time not doing something else productive.
Re:'Ultra Monkey'? (Score:2)
Is it your position that implementing a clustering database using a better named product would not take of your time and the OP's time?
"For example: If it takes me a day to learn how to install & configure "Ultra Monkey" on a box, then that costs the company a day of my time not doing something else productive."
This presumes that the decision makers are considering factors
Re:'Ultra Monkey'? (Score:2)
"WHAT!!!!. I refuse to have something called ultra monkey in my company. How dare you install something called ultra monkey. Here is a check for 80 thousand dollars, now go and install an oracle cluster. Oh and you are fired for even saying ultra monkey in my presence"
If that happened in my company, I'd forward the issue to the CEO, get the manager canned for supidity and get my job back. Yeah, and Oracle clusters - not so hot. Clusters lead to failures and nd instability. Instability leads to outages.
Re:'Ultra Monkey'? (Score:2)
Suffering leads to the Dark Side.
No, Suffering is the end state. It's what keeps you on the wheel. Eliminate desire for that which you do not possess and you will be closer to leaving the wheel.
Re:'Ultra Monkey'? (Score:2)
The people who wrote switchtower (cool name) got sued and had to switch over to capistrano (a crappy name). This happens all the time. If you name your product something that's even remotely decent you will get sued by someone.
Let's also consider the fact that we may not want people who choose products based on name as the userbase for open source products. They are clearly not going to contribute anything at all and intead be BOFHs who are a
Re:'Ultra Monkey'? (Score:1)
Instead of 'Ultra Monkey' how about CARP? (Score:1)
Plus then you can say "Our machines handle failover at the IP level through Common Address Redundancy Protocol".
Re:'Ultra Monkey'? (Score:1)
Just show what's so perfect about your environment and show the benefit, cost ratio compared to what it is now, and do they drop the benefit just because it's got a monkey in the name? but can save them quite some $$$ if that's the case?
Seriously, if your boss drops the name over the benefit, change your job or your boss.
Re:'Ultra Monkey'? (Score:1)
Yeah, my CEO was disgusted with the name "Microsoft". Why the hell would we want any computer clicky icon things which are both small and soft??!!
YOU'RE FIRED!
It doesn't look easy (Score:2, Funny)
This is for the MySQL Cluster storage engine (Score:5, Informative)
If you want code to set up a MYSQL cluster (cluster of MYSQL servers NOT using the Cluster storage engine) you might do something like looking at the PHP code in MediaWiki, which does application-level load balancing for reads (not writes) and has so far been tested to 25,000 or so queries per second. Or you could use the same director tools and skip using them for writes, implementing failover for the master server getting the writes.
Re:This is for the MySQL Cluster storage engine (Score:2)
Re:This is for the MySQL Cluster storage engine (Score:2)
Don't forget - The MySQL Protocol is proprietary. (Score:4, Informative)
The MySQL Protocol is part of the MySQL Database Management System. As such, it falls under the provisions of the GNU Public License (GPL). A copy of the GNU Public License is available on MySQL's web site, and in the product download.
Because this is a GPL protocol, any product which uses it to connect to a MySQL server, or to emulate a MySQL server, or to interpose between any client and server which uses the protocol, or for any similar purpose, is also bound by the GPL. Therefore if you use this description to write a program, you must release your program as GPL. Contact MySQL AB if you need clarification of these terms or if you need to ask about alternative arrangements.
http://dev.mysql.com/doc/internals/en/licensing-n
Is that true? (Score:2)
Re:Is that true? (Score:2)
You can allways reverse engineer it. Or write an additional program to 'translate' between the MySQL protocol and your own chosen protocol, and use inter-process communication.
Probably nonsense (Score:2)
You can copyright source code, but not the rules of a protocol. You'd have to use a patent for that. Since the GPL is all about copyright and not patents (yet), what they say is probably nonsense.
The only construction that I can think of that would make the protocol governed by the GPL (though not for the reasons MySQL AB states) is if the protocol requires the transmission of some text that is itself copyrighted under the GPL *. I'm not f
Re:Is that true? (Score:3, Insightful)
However, the protocol itself still every bit as proprietary a format as an MS Word document. It just happens that they license their implementation to you under the GPL. You can reverse engineer it, just like the MS word doc format, but MySQL AB can always make subtle changes to break it (just like MS can do to the word format).
Re:Don't forget - The MySQL Protocol is proprietar (Score:2)
Re:Don't forget - The MySQL Protocol is proprietar (Score:2)
You can't copyright a protocol. You can copyright the literal words of their description of the protocol, but that in now way binds you in terms of the license. You can't copy their description into a book without permission, but I doubt that the description is licensed under the Gnu FDL.
If you lift their client app and use it to ta
Re:Don't forget - The MySQL Protocol is proprietar (Score:2)
Re:Don't forget - The MySQL Protocol is proprietar (Score:2, Insightful)
My understanding was that your obligation to release under GPL was based on your intended usage of said modifcation. For example, if I develop a hack to this, but intend only for internal/private use, then I'm under no obligation to hand this out publicly.
The only time I would be obligated to submit this under public GPL would be if I intended to redistribute it.
Is that not correct?
Right (Score:2)
Re:Don't forget - The MySQL Protocol is proprietar (Score:2)
You could use the reverse engineering argument for MS Word documents as well. However, Microsoft can make subtle changes to the format designed to break 3rd party implementations, or even break their own old versions. MySQL can do the same, because since there is no standard document for the protocol, nobody can file a bug report regarding a 3rd party implementation.
Re:Don't forget - The MySQL Protocol is proprietar (Score:2, Informative)
It isn't my fault that MySQL believe it.
Re:Don't forget - The MySQL Protocol is proprietar (Score:2)
An example of a truly open standard is:
http://www.oasis-open.org/committees/download.php/ 12572/OpenDocument-v1.0-os.pdf [oasis-open.org]
Or also, the PostgreSQL wire protocol:
http://www.postgresql.org/docs/8.1/static/protocol
The MySQL wire protocol is proprietary. You would have to reverse engineer the product to create code und
This isn't very elegant lb'ing MySQL cluster (Score:4, Interesting)
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.all.arp_ignore = 1
Should take care of all interface arp announce/ignore. Doesn't need to set net.ipv4.conf.eth0.arp_ seperately as the article provides. Or easier way to control it is to set ARP=no on
Personally I rather have Active/Active lb nodes in front and carry over sessions from failed node to active node transparently by using shared memory space to replicate all session info. OpenMosix comes to mind.
Re:This isn't very elegant lb'ing MySQL cluster (Score:1)
Question: which process would replicate sessions?
Re:This isn't very elegant lb'ing MySQL cluster (Score:2)
There are expensive solution to do just that. Many L4-7 switches on the market does this. Of course, the whole point of the article is to home-craft the solution, but I think, SQL Relay [sourceforge.net] does what application layer loadbalancer would but without the replicate session feature and with some what failover/loadbalance feature.
Of course, there is always Oracle... Believe me, I think, Postgresql is great open source product, but if I decide to go notch upward o
Without wishing to start a flamewar... (Score:3, Interesting)
Such capabilities are built in. (Score:2, Informative)
Re:No they aren't (Re:Such capabilities are built (Score:3, Informative)
It was designed for read-only telecom use, with real time writes from "upstream" propogated down. Basically, a cache. Local writes aren't super-critical in this case, because whatever causes a failure to write probably takes out the rest of the node anyway.
It's not really a general purpose SQL database, it just happens to let mysql provide some front-end services.
Re:No they aren't (Re:Such capabilities are built (Score:2)
You're right that the Cluster storage engine isn't a database. It's a storage engine and that's what it's supposed to be.
Re:No they aren't (Re:Such capabilities are built (Score:2)
Yea, I would love multi master replication or even replication over unreliable links. Too bad I can't have either with postgres. Master slave over a local LAN is all you get really. Good for failover but not much else. Having said that failover is better then nothing!
Re:No they aren't (Re:Such capabilities are built (Score:3, Informative)
Re:No they aren't (Re:Such capabilities are built (Score:1)
So even in case of "a catastrophic UPS failure" data will be there once your power is back.
2) In 5.1 the all data in RAM limitation is removed.
(Except for indexes which still has to reside in RAM)
Re:Without wishing to start a flamewar... (Score:2)
It seems... well, strange to me. Doesn't work in the way I expect.
Re:Without wishing to start a flamewar... (Score:2, Informative)
http://brianray.chipy.org/postgreSQL/cluster_vs_re plication.html [chipy.org].
Not much has changed since then. I do think there are some 3rd party commercial apps that handle master-master replication or even shared storage but thats about it.
Re:Without wishing to start a flamewar... (Score:1)
You do NOT get fault tolerance (on a process level) and YMMV
depending upon hardware and application requirements.
SSL + MySQL + Windows (Score:1, Offtopic)
Re:SSL + MySQL + Windows (Score:2)
Re:SSL + MySQL + Windows (Score:1)
Re:SSL + MySQL + Windows (Score:2)
MyPostgres? (Score:5, Interesting)
And while I'm getting everything in life I casually ask for, where's the SW that automatically swaps out a MySQL install and replaces it with Postgres, including revising source code that calls/queries the DB, or just uses a MySQL installation as a proxy replica for Postgres nodes in a mixed cluster?
Re:MyPostgres? (Score:2)
In theory, an app to glob a mysql server and recreate it in a postgresql server (or vice-versa) could be written, and I may even try, but revising source code? Maybe if everything you use uses one language, the same API version, and you're willing to let the app handle a
Re:MyPostgres? (Score:2)
Assemble the abstraction functions? Why not use the standard PEAR package [php.net]?
Re:MyPostgres? (Score:2)
Burried with Jimmy Hoffa.
Re:MyPostgres? (Score:2)
http://pgfoundry.org/projects/my2postgres/ [pgfoundry.org]
Monkey Management (Score:4, Funny)
Re:Monkey Management (Score:1)
I know cause i get management and monkey mixed up all the time
Re:Monkey Management (Score:1)
Re:Monkey Management (Score:2)
But a monitoring tool that actually and effectively rep
NDB and RAM (Score:3, Informative)
Re:NDB and RAM (Score:2)
The Cluster storage engine wasn't originally intended for really large data sizes but disk storage support is being added because it turned out that many people want to be able to use it to build clusters in this way instead of via replication, so want to handle larger data sizes. If that interests you the 5.1 manua
Sequoia/CJDBC (Score:1)
Re:Sequoia/CJDBC (Score:1)
Note that Sequoia now has a native implementation of the MySQL client library [continuent.org] to allow any other API besides JDBC.
For other databases, ODBC support [continuent.org] is also available in the Carob [continuent.org] project.
Sometimes it pays to pay... (Score:1)
Re:Other DBMS? (Score:1)
So, by your definition:
Microsoft = good, MySQL = bad
You must be Ballmer's son/daughter. Would you like to win a free iPod? I promiss not to tell your dad about it.....
Re:Other DBMS? (Score:2)
But anyway, how can MySQL's association with SCO put you off, if MS SQL's rather closer association with Microsoft doesn't? Beyond that, I concede your points: I know little beyond the four basic functions and phpMyAdmin, and I'm content in my ignorance.
Re:Other DBMS? (Score:2)
I find it funny that you don't want to use MySQL because of their business practices in partnership with SCO, Yet you inquire about MSFT which could have even shadier business practices with SCO, and even excluding SCO, has a track rec
Re:I like Monkeys (Score:1)
Re:I like Monkeys (Score:1)