【MySQL】錯誤資訊寫入slave_relay_log.index 案例一則
第一次遇到MySQL 將錯誤資訊寫入 slave-relay-log.index 中,slave io thread 啟動成功,而sql thread 失敗的案例,記錄下來。
【現象】
生產環境突然報警,slave sql程式停止,登陸伺服器檢查,master-error.log 包含如下資訊:
關於 mysqld got signal 11 的錯誤案例 請見 《mysqld got signal 11 案例一則 》 ,這裡遇到Error counting relay log space 報錯,於是檢查 slave-relay-log.index 檔案
由於MySQL slave 在啟動時需要檢查relay log index 檔案中的relay log資訊,並進行applay到本地,由於該檔案包含無誤資訊導致MySQL無法識別讀取不到relay log ,sql thread 啟動報錯。
【解決】
檢查發現錯誤資訊寫入relay-log.index檔案中,清理slave-relay-log.index 中的異常資訊,MySQL 會自動將slave sql thread起來 ,除非剛剛開始問題定位不準導致誤判。
(none)@3008 21:24:19>
(none)@3008 21:24:51>show slave status \G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
.........
Master_Log_File: mysql-bin.001221
Read_Master_Log_Pos: 319331681
Relay_Log_File: slave-relay.023504
Relay_Log_Pos: 319331826
Relay_Master_Log_File: mysql-bin.001221
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
.....
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)
【現象】
生產環境突然報警,slave sql程式停止,登陸伺服器檢查,master-error.log 包含如下資訊:
-
#tail -f /home/mysql/data3008/mysql/master-error.log
-
140507 20:59:29 [ERROR] log 10:44:23 UTC - mysqld got signal 11 ; listed in the index, but failed to stat
-
140507 20:59:29 [ERROR] Error counting relay log space
-
140507 21:04:29 [ERROR] log 10:44:23 UTC - mysqld got signal 11 ; listed in the index, but failed to stat
-
140507 21:04:29 [ERROR] Error counting relay log space
-
140507 21:09:29 [ERROR] log 10:44:23 UTC - mysqld got signal 11 ; listed in the index, but failed to stat
-
140507 21:09:29 [ERROR] Error counting relay log space
-
140507 21:14:29 [ERROR] log 10:44:23 UTC - mysqld got signal 11 ; listed in the index, but failed to stat
-
140507 21:14:29 [ERROR] Error counting relay log space
-
140507 21:15:29 [ERROR] log 10:44:23 UTC - mysqld got signal 11 ; listed in the index, but failed to stat
- 140507 21:15:29 [ERROR] Error counting relay log space
-
#more slave-relay-log.index
-
/home/mysql/data3008/mysql/slave-relay.023481
-
/home/mysql/data3008/mysql/slave-relay.023482
-
10:44:23 UTC - mysqld got signal 11 ;
-
This could be because you hit a bug. It is also possible that this binary
-
or one of the libraries it was linked against is corrupt, improperly built,
-
or misconfigured. This error can also beay fail.
-
key_buffer_size=16777216
-
read_buffer_size=262144
-
max_used_connections=10
-
max_threads=230
-
thread_count=8
-
connection_count=7
-
It is possible that mysqld could use up to
-
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 136546 K bytes of memory
- Hope that's ok; if not, decrease some variables in the equation.
-
Thread pointer: 0x5580000
-
Attempting backtrace. You can use the following information to find out
-
where mysqld died. If you see no messages after this, something went
-
terribly wrong...
-
stack_bottom = 2b74017d3e58 thread_stack 0x40000
-
/u01/mysql/bin/mysqld(my_print_stacktrace+0x29) [0x903c24]
-
/u01/mysql/bin/mysqld(handle_fatal_signal+0x3f6) [0x703916]
-
/lib64/libpthread.so.0() [0x313f80f4a0]
-
/u01/mysql/bin/mysqld(Query_cache::free_memory_block(Query_cache_block*)+0x58) [0x73c5e0]
-
/u01/mysql/bin/mysqld(Query_cache::free_query_internal(Query_cache_block*)+0x164) [0x73ca8a]
-
/u01/mysql/bin/mysqld() [0x73db00]
-
/u01/mysql/bin/mysqld(query_cache_insert(st_net*, char const*, unsigned long)+0x1e7) [0x740b2b]
-
/u01/mysql/bin/mysqld(net_real_write+0x39) [0x5e2531]
-
/u01/mysql/bin/mysqld() [0x5e29a3]
-
/u01/mysql/bin/mysqld(my_net_write+0xda) [0x5e2f91]
-
/u01/mysql/bin/mysqld(Protocol::write()+0x1e) [0x5e4192]
-
/u01/mysql/bin/mysqld(select_send::send_data(List
- &)+0x17c) [0x5dd204]
- &)+0x17c) [0x5dd204]
-
/u01/mysql/bin/mysqld() [0x652f13]
-
/u01/mysql/bin/mysqld() [0x654a73]
-
/u01/mysql/bin/mysqld(sub_select(JOIN*, st_join_table*, bool)+0x81) [0x65a2c3]
-
/u01/mysql/bin/mysqld() [0x65f5ed]
-
/u01/mysql/bin/mysqld(JOIN::exec()+0x466) [0x675e58]
-
/u01/mysql/bin/mysqld(mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List
- &, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long lon
- &, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long lon
-
g, select_result*, st_select_lex_unit*, st_select_lex*)+0x700) [0x671ff7]
-
/u01/mysql/bin/mysqld(handle_select(THD*, st_lex*, select_result*, unsigned long)+0x18b) [0x677f22]
-
/u01/mysql/bin/mysqld() [0x601685]
-
/u01/mysql/bin/mysqld(mysql_execute_command(THD*)+0x18ee) [0x6066a4]
-
/u01/mysql/bin/mysqld(mysql_parse(THD*, char*, unsigned int, char const**)+0x419) [0x60a81c]
-
/u01/mysql/bin/mysqld(dispatch_command(enum_server_command, THD*, char*, unsigned int)+0xe94) [0x60b6c5]
-
/u01/mysql/bin/mysqld(do_command(THD*)+0x107) [0x60c16c]
-
/u01/mysql/bin/mysqld(handle_one_connection+0x237) [0x5fe1de]
-
/lib64/libpthread.so.0() [0x313f8077f1]
- /lib64/libc.so.6(clone+0x6d) [0x313f4e570d]
【解決】
檢查發現錯誤資訊寫入relay-log.index檔案中,清理slave-relay-log.index 中的異常資訊,MySQL 會自動將slave sql thread起來 ,除非剛剛開始問題定位不準導致誤判。
(none)@3008 21:24:19>
(none)@3008 21:24:51>show slave status \G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
.........
Master_Log_File: mysql-bin.001221
Read_Master_Log_Pos: 319331681
Relay_Log_File: slave-relay.023504
Relay_Log_Pos: 319331826
Relay_Master_Log_File: mysql-bin.001221
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
.....
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)
【疑問】
什麼導致MySQL 將錯誤日誌寫入relay_log.index 中的?
什麼導致MySQL 將錯誤日誌寫入relay_log.index 中的?
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-1175855/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- mysql匯入資料亂碼錯誤一則MySql
- mysql innobackupex 的一則錯誤MySql
- 執行指令碼寫入中間表錯誤返回錯誤資訊指令碼
- 【案例】MySQL count操作優化案例一則MySql優化
- 【拖雷】一則ORA-12500錯誤的解決案例
- MySQL 狂寫錯誤日誌MySql
- 複製錯誤案例分享(一)
- mysql 一個錯誤MySql
- 【MySQL】Too many connections 案例一則MySql
- 【MySQL】mysqldgotsignal11案例一則MySqlGo
- VBScript 錯誤資訊一覽 (轉)
- steam磁碟寫入錯誤怎麼解決 steam磁碟寫入錯誤解決方法大全
- 【MySQL】 DB 回滾崩潰案例一則MySql
- 【MySQL】mysqld got signal 11 案例一則MySqlGo
- MySQL5.6執行計劃錯誤案例分析MySql
- ruby2.2安裝錯誤一則
- 關於”kccrsz“錯誤處理一則
- 記錄一次根據錯誤資訊無法定位錯誤的錯誤
- JavaScript錯誤資訊JavaScript
- Mysql增量寫入Hdfs(一) --將Mysql資料寫入Kafka TopicMySqlKafka
- Python檔案讀寫--錯誤一Python
- MySQL入門學習之——MySQL錯誤解決彙總MySql
- Sqlserver Try Catch時Catch捕獲到錯誤則重試一次的寫法SQLServer
- Mysql錯誤集MySql
- 複製錯誤案例分享(二)
- go fiber: 把異常資訊寫到錯誤日誌中Go
- HTTP錯誤提示資訊表HTTP
- Oracle 11.2.0.2 exp匯出錯誤處理一則Oracle
- 技術分享 | MySQL 覆蓋索引最佳化案例一則MySql索引
- 一個備庫中ORA錯誤資訊的分析
- MySQL 資料庫“十宗罪”(十大經典錯誤案例)MySql資料庫
- MySQL 錯誤程式碼MySql
- MySQL 常見錯誤MySql
- MySQL error 錯 誤 碼MySqlError
- mysql slave錯誤skipMySql
- mysql 啟動錯誤MySql
- oracle啟動案例一則Oracle
- IO優化案例一則優化