Re: [gentoo-user] Best website backup practice
On Friday 19 December 2008, kashani wrote: Mick wrote: 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. This sounds difficult . . . would hate to trash what is currently working. 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. Thanks, good luck with your move! -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Best website backup practice
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? -- Regards, Mick signature.asc Description: This is a digitally signed message part.
Re: [gentoo-user] Best website backup practice
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
Re: [gentoo-user] Best website backup practice
This is a great method that I utilize: http://www.mikerubel.org/computers/rsync_snapshots/ On Wed, Dec 17, 2008 at 9:02 AM, Momesso Andrea momesso.and...@gmail.comwrote: I run on an old laptop a website (Joomla + MediaWiki + Moodle + a couple of other things). The site now is offline and I'm ok with my automated backups of all the hard drive, but it's going to go online in a few weeks and I'd like to add some more security. What I'd like to have is periodic snapshots of the site, so when the hardware will fail (I'm pretty sure it will, just a matter of time) I can easily transfer the latest snapshot on another machine running a web server and a databse. My idea is to cp (or rsync) the /var/www/host/ directory and, at the same time to mysqldump the related databases. Then I'd create an archive with this data together and transfer it via nfs on another disk. Cron will do it every twelve hours. Any advice or suggestions will be appreciated. === http://topperh.blogspot.com === -- kyle.ba...@gmail.com
Re: [gentoo-user] Best website backup practice
On Wed, Dec 17, 2008 at 10:55:36AM -0800, Kyle Bader wrote: This is a great method that I utilize: http://www.mikerubel.org/computers/rsync_snapshots/ And what about the database? === http://topperh.blogspot.com === pgpP5H7h5icch.pgp Description: PGP signature
Re: [gentoo-user] Best website backup practice
Momesso Andrea wrote: On Wed, Dec 17, 2008 at 10:55:36AM -0800, Kyle Bader wrote: This is a great method that I utilize: http://www.mikerubel.org/computers/rsync_snapshots/ And what about the database? I like LVM snapshotting for databases, but that takes some planning and you have to stop the database. However your mysqlbackup are actually very unsafe because I know for certain that Mediawiki uses Innodb tables. mysqlbackup does not guarantee a lock (I forget the actual details of the issue) for Innodb so your backup could be crap. Chances are you'd be fine on a database that isn't very busy, but don't get in the habit of doing it that way. kashani
Re: [gentoo-user] Best website backup practice
On Wed, Dec 17, 2008 at 01:03:46PM -0800, kashani wrote: I like LVM snapshotting for databases, but that takes some planning and you have to stop the database. However your mysqlbackup are actually very unsafe because I know for certain that Mediawiki uses Innodb tables. mysqlbackup does not guarantee a lock (I forget the actual details of the issue) for Innodb so your backup could be crap. Chances are you'd be fine on a database that isn't very busy, but don't get in the habit of doing it that way. kashani So there is no way if I want to keep the databases runnung? === http://topperh.blogspot.com === pgpBprx4wMKni.pgp Description: PGP signature
Re: [gentoo-user] Best website backup practice
Momesso Andrea wrote: On Wed, Dec 17, 2008 at 01:03:46PM -0800, kashani wrote: I like LVM snapshotting for databases, but that takes some planning and you have to stop the database. However your mysqlbackup are actually very unsafe because I know for certain that Mediawiki uses Innodb tables. mysqlbackup does not guarantee a lock (I forget the actual details of the issue) for Innodb so your backup could be crap. Chances are you'd be fine on a database that isn't very busy, but don't get in the habit of doing it that way. kashani 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. kashani