close x

How to fix problems in the replications dataservers infrastructure

When you get an error like this:

[ERROR] Got fatal error 1236: ‘Could not find first log file name in binary log index file’ from master when reading data from binary log
[Note] Slave I/O thread exiting, read up to log ‘mysql_binary_log.000004′, position 465
The solutions is simple…let’s see:

In server1:

FLUSH TABLES WITH READ LOCK;

SHOW MASTER STATUS; (remember the result)

In other console:

mysqldump -u root -p –extended-insert –all-databases > /tmp/backup.sql

and again in the MySQL promt:

unlock tables

On the server2 we copy the backup, and :

stop slave ;

mysql -u root -p-h localhost< backup.sql

CHANGE MASTER TO MASTER_HOST=’ip_server1′, MASTER_USER=’replica_user’, MASTER_PASSWORD=’password_replica_user’, MASTER_LOG_FILE=’log_file_showned_in_the_status_of_the_server1′, MASTER_LOG_POS=’position_showned_in_the_status_of_the_server1′;

start slave;

And the problem is solved. You need to to the same but in viceversa.

References:

http://forums.mysql.com/read.php?26,223923,224042#msg-224042

Cloud Computing0 comments

Leave a Reply