Add a slave?

5 views
Skip to first unread message

Phil Smy

unread,
May 19, 2017, 1:51:09 AM5/19/17
to rubber
Hi...we want to add a slave mysql instance to our setup. I'm a bit concerned about how this would be done 'blind' through rubber. Has anyone done this and if so, what exactly do we do?

Kevin Menard

unread,
May 25, 2017, 11:30:18 PM5/25/17
to rubbe...@googlegroups.com
Hi Phil,

Are you currently using the vanilla "mysql" role or are you using the "mysql_cluster" role. If the former, you should just be able to add a new machine with the "mysql_slave" role. I'll admit it's been quite some time since I've done this, having really only run PostgreSQL in my last few production deployments. But, reading through the source that seems to be it.

If you already have a slave present, you'll need to update the generated rubber config to account for the new slave's server_id. If this is your first slave, the generated Rubber config should be sufficient (master gets server_id 1 and the slave gets server_id 2).

Bootstrapping the machine with the mysql_slave role should take care of configuring replication:


So, the steps would be (from memory -- I don't have a MySQL cluster to test against at the moment):

$ ALIAS=new_machine cap rubber:create
$ ALIAS=new_machine ROLES=mysql_slave cap rubber:roles:add
$ ALIAS=new_machine cap rubber:bootstrap
$ cap deploy

Please let me know if you have any other questions.

--
Kevin


On Fri, May 19, 2017, at 01:51, Phil Smy wrote:
Hi...we want to add a slave mysql instance to our setup. I'm a bit concerned about how this would be done 'blind' through rubber. Has anyone done this and if so, what exactly do we do?


--
You received this message because you are subscribed to the Google Groups "rubber" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubber-ec2+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Menard

unread,
May 26, 2017, 8:35:44 AM5/26/17
to rubbe...@googlegroups.com
Oops. That should be:

$ FILTER=new_machine cap rubber:bootstrap

--
Kevin
Reply all
Reply to author
Forward
0 new messages