.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "MYSQL-SLAVE-DELAY 1" .TH MYSQL-SLAVE-DELAY 1 "2007-10-15" "perl v5.8.8" "User Contributed Perl Documentation" .SH "NAME" mysql\-slave\-delay \- Make a MySQL slave server lag behind its master. .SH "SYNOPSIS" .IX Header "SYNOPSIS" To hold slavehost one minute behind its master for ten minutes: .PP .Vb 1 \& mysql-slave-delay --delay 1m --interval 15s --time 10m slavehost .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" MySQL Slave Delay watches a slave and starts and stops its replication \s-1SQL\s0 thread as necessary to hold it at least as far behind the master as you request. In practice, it will typically cause the slave to lag between \&\*(L"\-\-delay\*(R" and \*(L"\-\-delay\*(R"+\*(L"\-\-interval\*(R" behind the master. .PP It bases the delay on binlog positions in the slave's relay logs by default, so there is no need to connect to the master. This works well if the \s-1IO\s0 thread doesn't lag the master much, which is typical in most replication setups; the \s-1IO\s0 thread lag is usually milliseconds on a fast network. If your \&\s-1IO\s0 thread's lag is too large for your purposes, MySQL Slave Delay can also connect to the master for information about binlog positions. .PP Note that since MySQL Slave Delay starts and stops the \s-1SQL\s0 thread, monitoring systems may think the slave is having trouble when it's just being held back intentionally. .PP There is a special syntax for connecting to MySQL servers. Each server name on the command line can be either just a hostname, or a key=value,key=value string. Keys are a single letter: .PP .Vb 8 \& KEY MEANING \& === ======= \& h Connect to host \& P Port number to use for connection \& S Socket file to use for connection \& u User for login if not current user \& p Password to use when connecting \& F Only read default options from the given file .Ve .PP If you omit any values in \s-1MASTER\-HOST\s0, they are filled in with defaults from \&\s-1SLAVE\-HOST\s0, so you don't need to specify them in both places. MySQL Slave Delay reads all normal MySQL option files, such as ~/.my.cnf, so you may not need to specify username, password and other common options at all. .PP MySQL Slave Delay tries to exit gracefully by trapping signals such as Ctrl\-C. You cannot bypass \*(L"\-\-continue\*(R" with a trappable signal. .SH "OPTIONS" .IX Header "OPTIONS" Some options are negatable by specifying them in their long form with a \-\-no prefix. .PP Some options have a special suffix syntax. These options accept a number suffixed with s, m, h, or d. The suffixes mean seconds, minutes, hours and days respectively. .IP "\-\-askpass" 4 .IX Item "--askpass" Prompts the user for a password when connecting to MySQL. .IP "\-\-continue" 4 .IX Item "--continue" After exiting, restart the slave's \s-1SQL\s0 thread with no \s-1UNTIL\s0 condition, so it will run as usual and catch up to the master. This is enabled by default and works even if you terminate MySQL Slave Delay with Control\-C. .IP "\-\-daemonize" 4 .IX Item "--daemonize" Fork to the background and detach from the shell. This probably doesn't work on Microsoft Windows. .IP "\-\-delay" 4 .IX Item "--delay" How far the slave should lag its master. This value is a number with a suffix; see above for suffix syntax. .IP "\-\-help" 4 .IX Item "--help" Displays a help message. .IP "\-\-interval" 4 .IX Item "--interval" How frequently MySQL Slave Delay should check whether the slave needs to be started or stopped. See above for suffix syntax. .IP "\-\-quiet" 4 .IX Item "--quiet" Do not output regular status messages. .IP "\-\-time" 4 .IX Item "--time" How long MySQL Slave Delay should run before exiting. Default is to run forever. See above for suffix syntax. .IP "\-\-usemaster" 4 .IX Item "--usemaster" Don't trust the binlog positions in the slave's relay log. Connect to the master and get binlog positions instead. If you specify this option without giving a MASTER-HOST on the command line, MySQL Slave Delay examines the slave's \s-1SHOW\s0 \s-1SLAVE\s0 \s-1STATUS\s0 to determine the hostname and port for connecting to the master. .Sp MySQL Slave Delay only uses the \s-1MASTER_HOST\s0 and \s-1MASTER_PORT\s0 values from \s-1SHOW\s0 \&\s-1SLAVE\s0 \s-1STATUS\s0 for the master connection. It does not use the \s-1MASTER_USER\s0 value. If you want to specify a different username for the master than the one you use to connect to the slave, you should specify the MASTER-HOST option explicitly on the command line. .IP "\-\-version" 4 .IX Item "--version" Output version information and exit. .SH "SYSTEM REQUIREMENTS" .IX Header "SYSTEM REQUIREMENTS" You need Perl, \s-1DBI\s0, DBD::mysql, and some core packages that ought to be installed in any reasonably new version of Perl. .SH "OUTPUT" .IX Header "OUTPUT" If you specify \*(L"\-\-quiet\*(R", there is no output. Otherwise, the normal output is a status message consisting of a timestamp and information about what MySQL Slave Delay is doing: starting the slave, stopping the slave, or just observing. .SH "BUGS" .IX Header "BUGS" Please use the Sourceforge bug tracker, forums, and mailing lists to request support or report bugs: . .SH "COPYRIGHT, LICENSE AND WARRANTY" .IX Header "COPYRIGHT, LICENSE AND WARRANTY" This program is copyright (c) 2007 Sergey Zhuravlev and Baron Schwartz. Feedback and improvements are welcome. .PP \&\s-1THIS\s0 \s-1PROGRAM\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 \&\s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \&\s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0. .PP This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation, version 2; \s-1OR\s0 the Perl Artistic License. On \s-1UNIX\s0 and similar systems, you can issue `man perlgpl' or `man perlartistic' to read these licenses. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, \s-1MA\s0 02111\-1307 \s-1USA\s0. .SH "AUTHOR" .IX Header "AUTHOR" Sergey Zhuravlev and Baron Schwartz. .SH "VERSION" .IX Header "VERSION" This manual page documents Ver 1.0.1 Distrib 1053 \f(CW$Revision:\fR 864 $.