master ip
Closed this issue · 6 comments
This isn't really an issue I'm just wanting to fully understand the cookbook before I attempt to use it. How is the slaves getting the ip, log name, and log pos to set up the change master to statement? I can see the new_resource.master_ip but i don't see where it gets set. there are a couple ways of getting log info for slave but i don't see anything like that happening in the cookbook.
Hello,
The master IP is set via an attribute in the example recipes provided with the cookbook. If you just use the resources you can set it any way you like (such as attribute or variable from data bag etc). The way a slave is sync'd to a master via this cookbook is by using the provider 'mysqlm_slave_sync' there is a sample of this at the bottom of the mysql_slave.rb recipe.
The 'mysqlm_slave_sync' provider logs into the master mysql server using an account setup in the 'mysqlm_slave_grants' provider (so the master must be configured first). It is then is able to pull the log info from master and set it on the slave.
Let us know if you have any other questions or concerns we can address.
So you have to know the ip address ranges in advance to running the cookbook? We are going to be doing runs using scalr and I may not be able to know the in advance due to just providing a ip range.
We recommend setting the IP's in advance, otherwise it will take multiple converges of master and slave so they can find each other. We do provide an example find_master and find_slave recipes with the cookbook based off tagging but mileage may vary, would require some additional testing and maybe a wrapper cookbook with additional logic to ensure it works as expected with any type of auto scaling setup.
Yeah I have a wrapper that sets up my full mysql environment from OS to mysql configs. I want to integrate the portion for replication from your cookbook just trying to figure the logic correctly. I'm at the part where you said additional logic for scaling.
I have not worked with scalr so not sure what the best approach would be. I would try to setup the server orchestration piece first to build the servers then return the IP address you need. If that is possible you could then feed them in as attributes before the master/slave chef convergence. This would be the cleanest way I could image but again not sure of scalr's capabilities
going to close this issue, let me know if we can further assist you in any way.