- 论坛徽章:
- 8
|
本人在虚拟机上做实验,主从IP如下:Master:192.168.1.107
Slave1:192.168.1.111
Slave2:192.168.1.112
每台虚拟机分配的磁盘空间仅仅有20G,由于在Master上执行sysbench进行基准测试,自动产生了大量数据和binlog,磁盘满了,结果导致了slave上的I/O线程断开了。
在从库上执行show slave status\G显示:
- mysql> show slave status\G
- *************************** 1. row ***************************
- Slave_IO_State:
- Master_Host: 192.168.1.107
- Master_User: repl
- Master_Port: 3306
- Connect_Retry: 60
- Master_Log_File:
- Read_Master_Log_Pos: 4
- Relay_Log_File: mysqld-relay-bin.000001
- Relay_Log_Pos: 4
- Relay_Master_Log_File:
- Slave_IO_Running: No
- Slave_SQL_Running: Yes
- Replicate_Do_DB:
- Replicate_Ignore_DB: mysql,information_schema,performance_schema
- Replicate_Do_Table:
- Replicate_Ignore_Table:
- Replicate_Wild_Do_Table:
- Replicate_Wild_Ignore_Table:
- Last_Errno: 0
- Last_Error:
- Skip_Counter: 0
- Exec_Master_Log_Pos: 0
- Relay_Log_Space: 151
- Until_Condition: None
- Until_Log_File:
- Until_Log_Pos: 0
- Master_SSL_Allowed: No
- Master_SSL_CA_File:
- Master_SSL_CA_Path:
- Master_SSL_Cert:
- Master_SSL_Cipher:
- Master_SSL_Key:
- Seconds_Behind_Master: 0
- Master_SSL_Verify_Server_Cert: No
- Last_IO_Errno: 1236
- Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Slave has more GTIDs than the master has, using the master's SERVER_UUID. This may indicate that the end of the binary log was truncated or that the last binary log file was lost, e.g., after a power or disk failure when sync_binlog != 1. The master may or may not have rolled back transactions that were already replica'
- Last_SQL_Errno: 0
- Last_SQL_Error:
- Replicate_Ignore_Server_Ids:
- Master_Server_Id: 107
- Master_UUID: 6a2a620f-736c-11e6-8384-000c299dda36
- Master_Info_File: mysql.slave_master_info
- SQL_Delay: 0
- SQL_Remaining_Delay: NULL
- Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
- Master_Retry_Count: 86400
- Master_Bind:
- Last_IO_Error_Timestamp: 160916 22:50:59
- Last_SQL_Error_Timestamp:
- Master_SSL_Crl:
- Master_SSL_Crlpath:
- Retrieved_Gtid_Set:
- Executed_Gtid_Set: 6a2a620f-736c-11e6-8384-000c299dda36:1-500046,
- 90bced3c-736e-11e6-8392-000c291db4ba:1-12
- Auto_Position: 1
- 1 row in set (0.00 sec)
复制代码 在从库(192.168.1.111)查看错误日志:
tail -n200 var/log/mysqld.log
- 2016-09-16 22:35:11 2283 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Slave has more GTIDs than the master has, using the master's SERVER_UUID. This may indicate that the end of the binary log was truncated or that the last binary log file was lost, e.g., after a power or disk failure when sync_binlog != 1. The master may or may not have rolled back transactions that were already replica', Error_code: 1236
- 2016-09-16 22:35:11 2283 [Note] Slave I/O thread exiting, read up to log 'FIRST', position 4
- 2016-09-16 22:35:24 2283 [Note] Error reading relay log event: slave SQL thread was killed
- 2016-09-16 22:36:01 2283 [Note] 'CHANGE MASTER TO executed'. Previous state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='192.168.1.107', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''.
- 2016-09-16 22:36:05 2283 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
- 2016-09-16 22:36:05 2283 [Note] Slave I/O thread: connected to master 'repl@192.168.1.107:3306',replication started in log 'FIRST' at position 4
- 2016-09-16 22:36:05 2283 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log './mysqld-relay-bin.000001' position: 4
- 2016-09-16 22:36:05 2283 [ERROR] Error reading packet from server: Slave has more GTIDs than the master has, using the master's SERVER_UUID. This may indicate that the end of the binary log was truncated or that the last binary log file was lost, e.g., after a power or disk failure when sync_binlog != 1. The master may or may not have rolled back transactions that were already replicated to the slave. Suggest to replicate any transactions that master has rolled back from slave to master, and/or commit empty transactions on master to account for transactions that have been (server_errno=1236)
- 2016-09-16 22:36:05 2283 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Slave has more GTIDs than the master has, using the master's SERVER_UUID. This may indicate that the end of the binary log was truncated or that the last binary log file was lost, e.g., after a power or disk failure when sync_binlog != 1. The master may or may not have rolled back transactions that were already replica', Error_code: 1236
- 2016-09-16 22:36:05 2283 [Note] Slave I/O thread exiting, read up to log 'FIRST', position 4
- 2016-09-16 22:38:20 2283 [Note] Error reading relay log event: slave SQL thread was killed
- 2016-09-16 22:50:54 2283 [Note] 'CHANGE MASTER TO executed'. Previous state master_host='', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''. New state master_host='192.168.1.107', master_port= 3306, master_log_file='', master_log_pos= 4, master_bind=''.
- 2016-09-16 22:50:59 2283 [Warning] Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
- 2016-09-16 22:50:59 2283 [Note] Slave I/O thread: connected to master 'repl@192.168.1.107:3306',replication started in log 'FIRST' at position 4
- 2016-09-16 22:50:59 2283 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log './mysqld-relay-bin.000001' position: 4
- 2016-09-16 22:50:59 2283 [ERROR] Error reading packet from server: Slave has more GTIDs than the master has, using the master's SERVER_UUID. This may indicate that the end of the binary log was truncated or that the last binary log file was lost, e.g., after a power or disk failure when sync_binlog != 1. The master may or may not have rolled back transactions that were already replicated to the slave. Suggest to replicate any transactions that master has rolled back from slave to master, and/or commit empty transactions on master to account for transactions that have been (server_errno=1236)
- 2016-09-16 22:50:59 2283 [ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'Slave has more GTIDs than the master has, using the master's SERVER_UUID. This may indicate that the end of the binary log was truncated or that the last binary log file was lost, e.g., after a power or disk failure when sync_binlog != 1. The master may or may not have rolled back transactions that were already replica', Error_code: 1236
- 2016-09-16 22:50:59 2283 [Note] Slave I/O thread exiting, read up to log 'FIRST', position 4
复制代码
针对以上种种错误提示,百度了一下 没有找到合适解决办法。在slave上重新stop slave并且change master也不行。
哪位高人遇到过这种问题,并且知道如何解决?谢谢!
|
|