1 |
Mick wrote: |
2 |
> On Wednesday 17 December 2008, kashani wrote: |
3 |
>> Momesso Andrea wrote: |
4 |
> |
5 |
>>> So there is no way if I want to keep the databases runnung? |
6 |
>> If your database isn't terribly busy I'd setup a second Mysql instance |
7 |
>> on the same machines and make it a slave of your primary. Then when it's |
8 |
>> time to backup you can stop the slave and make a backup without |
9 |
>> disturbing the master instance. |
10 |
> |
11 |
> Aha! Never done this. How would you go about it? |
12 |
|
13 |
To be honest I've never attempted it. Most of my recent installations |
14 |
have been large enough where having an actual backup server was a |
15 |
requirement. However Gentoo does include the /etc/init.d/mysqlmanager |
16 |
startup script. You'd need to muddle through it and figure out how to |
17 |
separate the pid files, suffixes, conf file enough to make it work. |
18 |
|
19 |
When finished you'd want you slave instance running only on localhost |
20 |
and say port 4306. Then you tell it your master is localhost port 3306. |
21 |
Mysql likes to assume localhost is always a socket so you might want to |
22 |
add an entry into /etc/hosts to trick it into connecting via tcp, but |
23 |
I'm not sure if it matters. |
24 |
|
25 |
something like |
26 |
127.0.0.1 localhost mastermysql.yourdomain.com |
27 |
|
28 |
Additionally be careful with the conf setting in your Mysql |
29 |
installation. I think the standard Gentoo conf uses 64MB of RAM. If |
30 |
you've modified your production copy make sure you keep the slave copy |
31 |
small. You might need to raise the keybuffer in your slave if you have |
32 |
large indexes. I suspect you can ignore most of this in a web |
33 |
application environment, but it's good stuff to keep in mind later on. |
34 |
|
35 |
I'm moving this week and with the holidays I've got no time to try it, |
36 |
but if you have question after the first I'd be happy to help you sort |
37 |
it out. |
38 |
|
39 |
kashani |