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.

I would like to have a MySQL separated on two servers with one being a master and the other a slave. Can juju detect if the master is down and promote the slave or would I have to do it manually?


OK after playing around with this a little more I realized that adding a MySQL unit is not the same as adding a MySQL slave. In the gui it shows multiple instances of MySQL not slaves with relationship with master.

What are these units that are being added? Backups or slaves? If they are slaves how can you tell which unit is the master? If the master reboots does one of the slaves become master?

share|improve this question

1 Answer 1

up vote 4 down vote accepted
+200

Adding more units of the mysql charm does not create slaves.

Take a look at MySQL charm documentation. If you need to have master/slave replication, you need to deploy 2 instances of the mysql charm, e.g. one named "mysql" and the other "mysql-slave", then you need to add a relation between them. Using the command line, you can do it like this:

# deploy second service
juju deploy mysql mysql-slave

# add master to slave relation
juju add-relation mysql:master mysql-slave:slave

In the Juju GUI, you can do the same visually.

share|improve this answer
    
So if I create a slave relationship and then add units to that then I am adding slave units. What if I don't have a slave and I am adding units the mysql? what are those units? They can't be masters since mysql doesn't support multimaster. I already played around with have a single mysql instance with multiple units if they main one goes down the whole thing goes down so the units aren't doing anything. –  user2291975 Oct 26 '13 at 18:45
1  
I am going to mark this as answered since the question I have about mysql is very specific so I will just create a new question for that. –  user2291975 Oct 31 '13 at 21:34

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.