Mick wrote:
On Wednesday 17 December 2008, kashani wrote:
Momesso Andrea wrote:

So there is no way if I want to keep the databases runnung?
        If your database isn't terribly busy I'd setup a second Mysql instance
on the same machines and make it a slave of your primary. Then when it's
time to backup you can stop the slave and make a backup without
disturbing the master instance.

Aha! Never done this.  How would you go about it?

To be honest I've never attempted it. Most of my recent installations have been large enough where having an actual backup server was a requirement. However Gentoo does include the /etc/init.d/mysqlmanager startup script. You'd need to muddle through it and figure out how to separate the pid files, suffixes, conf file enough to make it work.

When finished you'd want you slave instance running only on localhost and say port 4306. Then you tell it your master is localhost port 3306. Mysql likes to assume localhost is always a socket so you might want to add an entry into /etc/hosts to trick it into connecting via tcp, but I'm not sure if it matters.

something like
127.0.0.1 localhost mastermysql.yourdomain.com

Additionally be careful with the conf setting in your Mysql installation. I think the standard Gentoo conf uses 64MB of RAM. If you've modified your production copy make sure you keep the slave copy small. You might need to raise the keybuffer in your slave if you have large indexes. I suspect you can ignore most of this in a web application environment, but it's good stuff to keep in mind later on.

I'm moving this week and with the holidays I've got no time to try it, but if you have question after the first I'd be happy to help you sort it out.

kashani

Reply via email to