I’d like to announce the first release of mysqlslavesync.
This is a script to perform unattended cloning of MySQL slave servers (or masters) to put a new slave online with minimal interaction.
It connects to the source node, performs a mysqldump or mysqlhotcopy, transfers the data, restores the data, and then sets up all replication parameters, on the target machine.
It then starts the slave which then begins to catch up to the master.
This little script has saved me a massive amount of time and eliminated a LOT of stress and hassle when setting up new slaves. Now I just launch screen, run mysqlslavesync, and forget about it. An hour or so later I have a new slave up and running.
A few caveats. This is the first release. The code needs to be cleaned up a bit. Your mileage may vary, and feedback is appreciated.
http://code.google.com/p/mysqlslavesync/