Has anyone built a script to add a new slave into a MySQL replication
setup which can operate (for the most part) unattended?

The set of operations is pretty straight forward but right now it's
mostly a manual step which ends up taking a LONG time.

The script would need to:

* connect to a master or a slave
* FLUSH TABLES WITH READ LOCK
* record master replication position
* take snapshot of myisam via mysqlhotcopy or simply CP the files into
a temp directly
* UNLOCK TABLES
* SCP the files to the target slave
* update replication positions on this box
* setup correct permissions
* startup replication
* assert that the box is functioning correctly

The transfer could be done unattended with SSH and ssh-agent.  The CPU
would be the bottleneck on gigabit ethernet but since it's unattended
it shouldn't matter as much.

One could even setup rsync with authentication if crypto was really
the bottleneck.

Thoughts?

I don't want to have to write anything because I'm amazingly lazy ;)

Kevin

--
Founder/CEO Tailrank.com
Location: San Francisco, CA
AIM/YIM: sfburtonator
Skype: burtonator
Blog: feedblog.org
Cell: 415-637-8078

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to