tag:blogger.com,1999:blog-7344264656347739323.post5757079381908907926..comments2010-08-22T19:54:15.724-07:00Comments on The Fake Amelia: backup by slave, oh yes!FakeAmeliahttp://www.blogger.com/profile/00742481289622978099noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-7344264656347739323.post-51553665922867137612008-05-04T13:39:00.000-07:002008-05-04T13:39:00.000-07:00Frank,Thanks. I am glad to be here.I am mostly run...Frank,<BR/>Thanks. I am glad to be here.<BR/>I am mostly running a Linux shop.<BR/>No need to change right now. Just looking around. If Solaris turns out to be good I may reconsider. Have you seen my <A HREF="http://fakeamelia.blogspot.com/2008/05/mysql-and-ubuntu-perfect-match.html" REL="nofollow">request for a Solaris equivalent to apt</A>?<BR/><BR/>AmeliaFakeAmeliahttps://www.blogger.com/profile/00742481289622978099noreply@blogger.comtag:blogger.com,1999:blog-7344264656347739323.post-19122990870802409632008-05-03T20:58:00.000-07:002008-05-03T20:58:00.000-07:00Amelia, welcome to Planet MYSQL. I am excited to s...Amelia, welcome to Planet MYSQL. I am excited to see you writing about Sun. Is your shop primarily a Sun shop, Linux shop or do you use both?<BR/><BR/><BR/>And you can use M**tkit. Lol, I am just kidding :)<BR/><BR/>FrankFrankhttps://www.blogger.com/profile/04086666898806120300noreply@blogger.comtag:blogger.com,1999:blog-7344264656347739323.post-11259167652232541452008-05-03T03:07:00.000-07:002008-05-03T03:07:00.000-07:00benefit, but anyone else's too.It's good to hear t...benefit, but anyone else's too.<BR/><BR/>It's good to hear that it's being monitored properly. Out of interest, how often do they go out of sync, and what is the typical cause?Mark Robsonhttps://www.blogger.com/profile/15864507044869250062noreply@blogger.comtag:blogger.com,1999:blog-7344264656347739323.post-14650400217836024202008-04-30T08:23:00.000-07:002008-04-30T08:23:00.000-07:00Thanks for everyone's concern. There is no need to...Thanks for everyone's concern. There is no need to assume that I am not monitoring my slaves. I am, actually, although I am not using Maatkit for it. I have a customized monitor that has been keeping an eye on my replicas for almost three years now. There was no Maatkit available then, and so I have been using something less elegant but effective.<BR/>My slaves, especially the backup slave, are in sync.<BR/><BR/>AmeliaFakeAmeliahttps://www.blogger.com/profile/00742481289622978099noreply@blogger.comtag:blogger.com,1999:blog-7344264656347739323.post-15077217930246485012008-04-30T03:07:00.000-07:002008-04-30T03:07:00.000-07:00Having slaves for backups is only any use if you'r...Having slaves for backups is only any use if you're monitoring them for replication errors AND checking that they're really in sync with the master (e.g. with maatkit's table-checksum).<BR/><BR/>If you're not doing both of those things, your slaves are almost guaranteed to either fail and go unnoticed, or become gradually further and further out of sync with the master (again unnoticed).<BR/><BR/>Slaves can get out of sync for various reasons - either hardware (power, duff ram, etc, particularly if you're using MyISAM) or software (Master issues update queries which don't replicate correctly). Both have happened to us in production but don't happen often (and not always to all slaves, so we have good backups)<BR/><BR/>MarkMark Robsonhttps://www.blogger.com/profile/15864507044869250062noreply@blogger.comtag:blogger.com,1999:blog-7344264656347739323.post-36525172947511761982008-04-29T14:41:00.000-07:002008-04-29T14:41:00.000-07:00You could wrap maatkit's (great toolset) parallel-...You could wrap maatkit's (great toolset) parallel-dump around 'mysqladmin stop-slave'. <BR/><BR/>It also creates a file containing bin log data too - handy for ref, should you need to change the master log pos on slaves.Unknownhttps://www.blogger.com/profile/09521972775084755756noreply@blogger.comtag:blogger.com,1999:blog-7344264656347739323.post-13176144357542567022008-04-29T12:40:00.000-07:002008-04-29T12:40:00.000-07:00Mike,you don't need to worry about the position.Th...Mike,<BR/>you don't need to worry about the position.<BR/>The backup script does <BR/><BR/>call_sql('SLAVE STOP');<BR/># dump database using mysqldump<BR/>call_sql('SLAVE START');<BR/><BR/>Replication is asynchronous. When you restart the slave, it picks up from the last position, without any manual intervention from the DBA.<BR/><BR/>AmeliaFakeAmeliahttps://www.blogger.com/profile/00742481289622978099noreply@blogger.comtag:blogger.com,1999:blog-7344264656347739323.post-19788713913333978312008-04-29T11:52:00.000-07:002008-04-29T11:52:00.000-07:00Would you mind posting the portion of your script ...Would you mind posting the portion of your script which takes the slave down, and auto restarts it at the right position?<BR/><BR/>That would help me so much to see a working example.mikehttps://www.blogger.com/profile/01713580792922427144noreply@blogger.comtag:blogger.com,1999:blog-7344264656347739323.post-26646813231949955182008-04-29T07:42:00.000-07:002008-04-29T07:42:00.000-07:00This assumes that the slave has the same data as t...This assumes that the slave has the same data as the master, which is often not the case in practice.<BR/><BR/>But fortunately there's Maatkit :-)Baronhttps://www.blogger.com/profile/01621441847303652718noreply@blogger.comtag:blogger.com,1999:blog-7344264656347739323.post-66969258253355814142008-04-29T07:09:00.000-07:002008-04-29T07:09:00.000-07:00That's the way to go.By the way, take a look at "r...That's the way to go.<BR/><BR/>By the way, take a look at "rsnapshot" which can efficiently (using rsync and hard links) do daily/weekly/monthly backups. It also has all the hooks to run commands pre/post the backup, to deal with MySQL, etc.Vitaliyhttps://www.blogger.com/profile/14765926313717625525noreply@blogger.com