.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .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. \*(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- .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" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SAVE_BINARY_LOGS 1p" .TH SAVE_BINARY_LOGS 1p "2023-10-03" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" save_binary_logs \- Concatenating binary or relay logs from the specified file/position to the end of the log. This command is automatically executed from MHA Manager on failover, and manual execution should not be needed normally. .SH "SYNOPSIS" .IX Header "SYNOPSIS" # Test .PP $ save_binary_logs \-\-command=test \-\-binlog_dir=/var/lib/mysql \-\-start_file=mysqld\-bin.000002 .PP # Saving binary logs .PP $ save_binary_logs \-\-command=save \-\-binlog_dir=/var/lib/mysql \-\-start_file=mysqld\-bin.000002 \-\-start_pos=312 \-\-output_file=/var/tmp/aggregate.binlog .PP # Saving relay logs .PP $ save_binary_logs \-\-command=save \-\-start_file=mysqld\-relay\-bin.000002 \-\-start_pos=312 \-\-relay_log_info=/var/lib/mysql/relay\-log.info \-\-output_file=/var/tmp/aggregate.binlog .PP save_binary_logs concatenates binary or relay logs from the specified log file/position to the end of the log. This tool is intended to be invoked from the master failover script(\s-1MHA\s0 Manager), and manual execution is normally not needed. .SH "DESCRIPTION" .IX Header "DESCRIPTION" Suppose that master is crashed and the latest slave server has received binary logs up to mysqld\-bin.000002:312. It is likely that master has more binary logs. If it is not sent to the slave, slaves will lose all binlogs from mysqld\-bin.000002:312. The purpose of the save_binary_logs is to save binary logs that are not replicated to slaves. If master is reachable through \s-1SSH\s0 and binary logs are readable, saving binary logs is possible. .PP Here is an example: .PP $ save_binary_logs \-\-command=save \-\-start_file=mysqld\-bin.000002 \-\-start_pos=312 \-\-output_file=/var/tmp/aggregate.binlog .PP Then all binary logs starting from mysqld\-bin.000002:312 are concatenated and stored into /var/tmp/aggregate.binlog. If you have binary logs up to mysqld\-bin.000004, the following mysqlbinlog outputs are written. .PP mysqld\-bin.000002:Format Description Event(\s-1FDE\s0), plus from 312 to the tail mysqld\-bin.000003:from 0 to the tail, excluding \s-1FDE\s0 mysqld\-bin.000004:from 0 to the tail, excluding \s-1FDE\s0