Documentation update for maxbinlogcheck utility
New options related to encryption: -K and -A. Binlog event header is printed with -H option
This commit is contained in:
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Massimiliano Pinto
|
Massimiliano Pinto
|
||||||
|
|
||||||
Last Updated: 08th September 2015
|
Last Updated: 07th December 2016
|
||||||
|
|
||||||
# Overview
|
# Overview
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ Maxbinlogcheck supports
|
|||||||
|
|
||||||
* MariaDB 5.5 and MySQL 5.6
|
* MariaDB 5.5 and MySQL 5.6
|
||||||
|
|
||||||
* MariaDB 10.0 with a command line option
|
* MariaDB 10.0 and 10.1 with a command line option
|
||||||
|
|
||||||
# Running maxbinlogcheck
|
# Running maxbinlogcheck
|
||||||
```
|
```
|
||||||
@ -58,6 +58,21 @@ The maxbinlogcheck command accepts a number of switches
|
|||||||
<td>--version</td>
|
<td>--version</td>
|
||||||
<td>Print the maxbinlogcheck version information</td>
|
<td>Print the maxbinlogcheck version information</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>-K</td>
|
||||||
|
<td>--key_file</td>
|
||||||
|
<td>AES Key file for MariaDB 10.1 binlog file decryption</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>-A</td>
|
||||||
|
<td>--aes_algo</td>
|
||||||
|
<td>AES Algorithm for MariaDB 10.1 binlog file decryption (default=AES_CBC, AES_CTR)</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>-H</td>
|
||||||
|
<td>--header</td>
|
||||||
|
<td>Print the binlog event header</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
## Example without debug:
|
## Example without debug:
|
||||||
@ -327,4 +342,61 @@ Check result:
|
|||||||
No. of Bytes 1.2M 1.2M 1.2M
|
No. of Bytes 1.2M 1.2M 1.2M
|
||||||
2015-09-08 12:49:18 Check retcode: 0, Binlog Pos = 1215327
|
2015-09-08 12:49:18 Check retcode: 0, Binlog Pos = 1215327
|
||||||
```
|
```
|
||||||
|
### MariaDB 10.1 encrypted binlogs
|
||||||
|
|
||||||
|
```
|
||||||
|
[root@maxscale-02 build]# /usr/local/bin/maxbinlogcheck -M -d /mariadb-10.1.16/data/mysql-bin.000008 -K /var/binlogs/key_file.txt -A AES_CTR
|
||||||
|
2016-12-07 16:18:35 notice : maxbinlogcheck 2.1.0
|
||||||
|
2016-12-07 16:18:35 notice : Decrypting binlog file with algorithm: aes_cbc, KEY len 256 bits
|
||||||
|
2016-12-07 16:18:35 notice : Checking /mariadb-10.1.16/data/mysql-bin.000008 (mysql-bin.000008), size 418 bytes
|
||||||
|
2016-12-07 16:18:35 debug : - Format Description event FDE @ 4, size 245, time 1481044895 (Tue Dec 6 18:21:35 2016)
|
||||||
|
2016-12-07 16:18:35 debug : FDE ServerVersion [ 10.1.16-MariaDB]
|
||||||
|
2016-12-07 16:18:35 debug : FDE Header EventLength 19, N. of supported MySQL/MariaDB events 164
|
||||||
|
2016-12-07 16:18:35 debug : FDE Checksum alg desc 1, alg type BINLOG_CHECKSUM_ALG_CRC32
|
||||||
|
2016-12-07 16:18:35 debug : - START_ENCRYPTION event @ 249, size 40, next pos is @ 289, flags 0
|
||||||
|
2016-12-07 16:18:35 debug : Encryption scheme: 1, key_version: 1, nonce: 6732673744475A1F5852575C
|
||||||
|
2016-12-07 16:18:35 debug : End of binlog file [mysql-bin.000003] at 418.
|
||||||
|
2016-12-07 16:18:35 notice : 1481044895 @ 249, Start Encryption Event, (Tue Dec 6 18:21:35 2016), First EventTime
|
||||||
|
2016-12-07 16:18:35 notice : 0 @ 375, Binlog Checkpoint Event, (Thu Jan 1 01:00:00 1970), Last EventTime
|
||||||
|
2016-12-07 16:18:35 notice : Check retcode: 0, Binlog Pos = 418
|
||||||
|
```
|
||||||
|
Key File content example: /var/binlogs/key_file.txt
|
||||||
|
|
||||||
|
First two bytes are: the encryption scheme, it must be 1, and the ';' separator.
|
||||||
|
Following bytes are the HEX representation of the key (length must be 16, 24 or 32).
|
||||||
|
The example shows a 32 bytes key in HEX format (64 bytes):
|
||||||
|
|
||||||
|
```
|
||||||
|
1;666f6f62617220676f657320746f207468652062617220666f7220636f66666565
|
||||||
|
```
|
||||||
|
|
||||||
|
### Binlog event header
|
||||||
|
|
||||||
|
```
|
||||||
|
[root@maxscale-02 build]# /usr/local/bin/maxbinlogcheck -M -d /mysql.5.6.17/data/mysql-bin.000001 -H
|
||||||
|
2016-12-07 16:23:02 notice : maxbinlogcheck 2.1.0
|
||||||
|
2016-12-07 16:23:02 notice : Checking /mysql.5.6.17/data/mysql-bin.000001 (mysql-bin.000001), size 173 bytes
|
||||||
|
2016-12-07 16:23:02 debug : - Format Description event FDE @ 4, size 116, time 1455024737 (Tue Feb 9 14:32:17 2016)
|
||||||
|
2016-12-07 16:23:02 debug : FDE ServerVersion [ 5.6.17-log]
|
||||||
|
2016-12-07 16:23:02 debug : FDE Header EventLength 19, N. of supported MySQL/MariaDB events 35
|
||||||
|
2016-12-07 16:23:02 debug : FDE Checksum alg desc 1, alg type BINLOG_CHECKSUM_ALG_CRC32
|
||||||
|
2016-12-07 16:23:02 debug : ==== Event Header ====
|
||||||
|
Event time 1455024737
|
||||||
|
Event Type 15 (Format Description Event)
|
||||||
|
Server Id 1
|
||||||
|
NextPos 120
|
||||||
|
Flags 0
|
||||||
|
2016-12-07 16:23:02 debug : CRC32 0xdc0879e8
|
||||||
|
2016-12-07 16:23:02 debug : ==== Event Header ====
|
||||||
|
Event time 1455025495
|
||||||
|
Event Type 4 (Rotate Event)
|
||||||
|
Server Id 1
|
||||||
|
NextPos 173
|
||||||
|
Flags 0
|
||||||
|
2016-12-07 16:23:02 debug : CRC32 0xfff32f78
|
||||||
|
2016-12-07 16:23:02 debug : - Rotate event @ 120, next file is [mysql-bin.000002] @ 4
|
||||||
|
2016-12-07 16:23:02 debug : End of binlog file [mysql-bin.000001] at 173.
|
||||||
|
2016-12-07 16:23:02 notice : 1455025495 @ 120, Rotate Event, (Tue Feb 9 14:44:55 2016), First EventTime
|
||||||
|
2016-12-07 16:23:02 notice : 1455025495 @ 120, Rotate Event, (Tue Feb 9 14:44:55 2016), Last EventTime
|
||||||
|
2016-12-07 16:23:02 notice : Check retcode: 0, Binlog Pos = 173
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user