// shall I write some keywords here to boost search engine ranking?

Thursday, September 13, 2007

Solution to MySQL Replication Problems: Master DB crashed

It is commons that replication will hang after master database crashed. And the error message you will get when you show slave status is:


Client requested master to start replication from impossible position (server_errno=1236)

This happened because MySQL write to bin-log in batch basis. If every bit of your data is mission critical and any inconsistent between master and salve is not accectable, then you should redo you replication all over again.

Else, there is another way to resume the replication. The solution is illustrate in this article: Client asks master to start replication from impossible position

So far I do not found any way to prevent this replication failure. However, you may add the follwing line into you my.cnf to reduce the chances it happen:

sync_binlog=1


This means that MySQL will write to bin-log after each update instead of write in batch. As you may expect, this will reduce the performance of the database.

No comments: