Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What's the point of adding units to MySQL? Why not just create a new service with relation to the master node?

MySQL doesn't support multi-master node so adding units to one MySQL service doesn't make any sense. If I create a second service as a slave and add units to that to act as multiple slaves still doesn't make sense because if the primary slave server dies all the unites attached to it become useless as well.

Can anyone explain why I should add units to MySQL?

share|improve this question
add comment

1 Answer

I will give it a try:

MySQL doesn't support multi-master node so adding units to one MySQL service doesn't make any sense.

That MySQL Community Server doesn't support multi-master node is correct. For multi-master node setup will you need MySQL Cluster or a fork. I can also confirm that at time of writing this answer did it not exist a Juju Charm for MySQL Cluster. But MySQL Community Serversupports other high-available opportunities thorough its replication. One of the most obvious one is Switching Masters During Failover.

If you have a closer look on the implementation of the MySQL Charm can we see under hooks\ha* something I might think is a switch of master. Tho, i have not dived so deep that I can confirm it is that.

Why not just create a new service with relation to the master node?

On the first hand, if we keep the master switch in mind from the answer above, does it make sense to add units to the master MySQL Charm as it will give it a pool of replicas that could be switched to become new Masters on a failure. On the other hand, defining a new service as slave and give it a relation to the master will make them stay as slaves.

if the primary slave server dies all the unites attached to it become useless as well

That is not exactly correct, as the slave servers will gladly be serving read requests. The MySQL replicas can also be 'forced' to serve write/update requests but that is strictly advise against as it comes with major complications for keeping semantics.

According to answer of this question, by a Dimiter Naydenov a member of Canonical Juju-core, is adding of more units to the MySQL Charm not creating replication slaves.

If the extra units nodes should be able to be promoted, to new master would that behavior be needed. So my best guess then, if his answer still hold ground, is that it is wasted units serving the purpose of inviting people to contribute on it.

A project that you might find of interest or inspiring, could be this one.

Improvements and corrections are welcomed.

share|improve this answer
    
Well in my test I added a unit the a single MySQL thing that it would take over if the unit0 fails. However it did not take over. It just sat there doing nothing. I then tested a MySQL master with a relation with MySQL slave the slave took over the reads just fine. The last thing I tried was adding units to the slave thinking that would add several read nodes however the added units again didn't do anything. –  user2291975 Dec 14 '13 at 23:40
    
Your comment fit best in a new question. added units again didn't do anything. But you should improve it, as it is extremely weak, you are now putting out a claim. Without giving us information of what your definition of didn't do anything is and how you inspected it or came to that conclusion. Is another charm connected to you database, do you use connection pools/load balancers? Didn't it start etc? Exactly what environment are you running? So summed up, what you did, what happen and what you expected to happen (in detail). :) –  Anders F. U. Kiær Dec 15 '13 at 22:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.