Advertisement
Guest User

Untitled

a guest
Jul 14th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1. change master to master_log_file='<Relay_Master_Log_File>',
  2. master_log_pos=<Exec_Master_Log_Pos>;
  3.  
  4. mysql> show slave status G
  5. *************************** 1. row ***************************
  6. Slave_IO_State: Waiting for master to send event
  7. Master_Host: the-master-host
  8. Master_User: replication
  9. Master_Port: 3306
  10. Connect_Retry: 60
  11. Master_Log_File: mysql-bin.000021
  12. Read_Master_Log_Pos: 33639968
  13. Relay_Log_File: mysql-relay-bin.000271
  14. Relay_Log_Pos: 2031587
  15. Relay_Master_Log_File: mysql-bin.000020
  16. Slave_IO_Running: Yes
  17. Slave_SQL_Running: No
  18. Replicate_Do_DB: the_database
  19. Replicate_Ignore_DB:
  20. Replicate_Do_Table:
  21. Replicate_Ignore_Table:
  22. Replicate_Wild_Do_Table:
  23. Replicate_Wild_Ignore_Table:
  24. Last_Errno: 1594
  25. Last_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
  26. Skip_Counter: 0
  27. Exec_Master_Log_Pos: 66395191
  28. Relay_Log_Space: 36559177
  29. Until_Condition: None
  30. Until_Log_File:
  31. Until_Log_Pos: 0
  32. Master_SSL_Allowed: No
  33. Master_SSL_CA_File:
  34. Master_SSL_CA_Path:
  35. Master_SSL_Cert:
  36. Master_SSL_Cipher:
  37. Master_SSL_Key:
  38. Seconds_Behind_Master: NULL
  39. Master_SSL_Verify_Server_Cert: No
  40. Last_IO_Errno: 0
  41. Last_IO_Error:
  42. Last_SQL_Errno: 1594
  43. Last_SQL_Error: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
  44.  
  45. mysql> stop slave;
  46. mysql> reset slave;
  47. mysql> change master to master_host='the-master-host', master_user='replication', master_password='the-password', master_log_file='mysql-bin.000020', master_log_pos=66395191;
  48. mysql> start slave;
  49.  
  50. 131122 15:17:29 [Note] Slave I/O thread: connected to master 'replication@the-master-host:3306',replication started in log 'mysql-bin.000020' at position 66395191
  51. 131122 15:17:29 [ERROR] Slave SQL: Error 'Duplicate entry '71373' for key 'PRIMARY'' on query. Default database: 'the_database'. Query: 'insert into ... values ...', Error_code: 1062
  52. 131122 15:17:29 [Warning] Slave: Data truncated for column 'date' at row 1 Error_code: 1265
  53. 131122 15:17:29 [Warning] Slave: Duplicate entry '71373' for key 'PRIMARY' Error_code: 1062
  54.  
  55. Master_Log_File: mysql-bin.000026
  56. Read_Master_Log_Pos: 2377104
  57. Relay_Log_File: mysqld-relay-bin.000056
  58. Relay_Log_Pos: 1097303
  59. Relay_Master_Log_File: mysql-bin.000026
  60. Exec_Master_Log_Pos: 1097157
  61.  
  62. mysqlbinlog mysql-bin.000026
  63.  
  64. mysqlbinlog mysqld-relay-bin.000056
  65.  
  66. ERROR: Error in Log_event::read_log_event(): 'read error', data_len: 336, event_type: 2
  67. ERROR: Could not read entry at offset 1097414: Error in log format or read error.
  68. DELIMITER ;
  69. # End of log file
  70. ROLLBACK /* added by mysqlbinlog */;
  71. /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
  72. /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
  73. root@db:/var/lib/mysql#
  74.  
  75. mysql> stop slave;
  76. Query OK, 0 rows affected (0.14 sec)
  77.  
  78. mysql> reset slave all;
  79. Query OK, 0 rows affected (0.43 sec)
  80.  
  81. mysql> CHANGE MASTER TO MASTER_HOST='master.host.com', MASTER_USER='masteruser', MASTER_PASSWORD='masterpass', MASTER_LOG_FILE='mysql-bin.000026', MASTER_LOG_POS=1097157;
  82. Query OK, 0 rows affected (0.93 sec)
  83.  
  84. mysql> start slave;
  85. Query OK, 0 rows affected (0.00 sec)
  86.  
  87. mysql> stop slave;
  88. mysql> reset slave;
  89. mysql> change master to master_host='the-master-host', master_user='replication', master_password='the-password', master_log_file='mysql-bin.000020', master_log_pos=66395191;
  90. mysql> start slave;
  91.  
  92. INSERT INTO tablname (column,column) VALUES (value,value,...)
  93.  
  94. STOP SLAVE;
  95. SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
  96. START SLAVE;
  97. SET @sleepnumber = SLEEP(3);
  98. SHOW SLAVE STATUSG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement