31.07.2013 Views

MySQL Cluster Tutorial - cdn.oreillystatic.com

MySQL Cluster Tutorial - cdn.oreillystatic.com

MySQL Cluster Tutorial - cdn.oreillystatic.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

You can, however, have a more readable output using the --verbose option:<br />

shell> mysqlbinlog -vv master_A_binlog.00001<br />

BINLOG '<br />

Xz/CSxMBAAAAMwAAAO8DAAAAACUAAAAAAAEABHRlc3QACWF0dGVuZGVlcwACAw8CyAAC<br />

Xz/CSxMBAAAAPgAAAC0EAAAAABAAAAAAAAEABW15c3FsABBuZGJfYXBwbHlfc3RhdHVzAAUDCA8I<br />

CAL/AAA=<br />

Xz/CSxcBAAAAOwAAAGgEAAAAABAAAAAAAAAABR/gAQAAAA8AAACiAAAAAAAAAAAAAAAAAAAAAAAA<br />

AAA=<br />

### INSERT INTO mysql.ndb_apply_status<br />

### SET<br />

### @1=1 /* INT meta=0 nullable=0 is_null=0 */<br />

### @2=695784701967 /* LONGINT meta=0 nullable=0 is_null=0 */<br />

### @3='' /* VARSTRING(255) meta=255 nullable=0 is_null=0 */<br />

### @4=0 /* LONGINT meta=0 nullable=0 is_null=0 */<br />

### @5=0 /* LONGINT meta=0 nullable=0 is_null=0 */<br />

Xz/CSxcBAAAAMgAAAJoEAAAQACUAAAAAAAEAAgP8AQAAAA9nZWVydEBsb2NhbGhvc3Q=<br />

'/*!*/;<br />

### INSERT INTO test.attendees<br />

### SET<br />

### @1=1 /* INT meta=0 nullable=0 is_null=0 */<br />

### @2='geert@localhost' /* VARSTRING(200) meta=200 nullable=1 is_null=0 */<br />

The mysqlbinlog tool will try to make a more readable SQL statement out of the data that<br />

was logged.<br />

The LOST_EVENT incident & solution<br />

We saw previously a setup which had one <strong>MySQL</strong> Server (or SQL Node) doing binary<br />

logging. This is a problem. Imagine that the machine where this node writing the binlogs is<br />

suddenly failing. All other SQL and API nodes still continue to do changes, but there is no<br />

<strong>MySQL</strong> Server able record them.<br />

When a <strong>MySQL</strong> Server starts and it finds out it did do binary logging earlier, it will report<br />

the LOST_EVENTS incident in the binary logs. Slaves reading from this binary log will<br />

stop replicating and show an error. They will report that the Master was down and might<br />

miss data. If a Slave would continue, your data will probably be inconsistent. You do not<br />

want that.<br />

shell> mysqlbinlog master_A_binlog.00001<br />

..<br />

#020411 22:48:47 server id 1 end_log_pos 143<br />

# Incident: LOST_EVENTS<br />

RELOAD DATABASE; # Shall generate syntax error<br />

..<br />

Copyright © 2010, Oracle and/or its affiliates. All rights reserved. 75/81

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!