【Mysql】mysql主鍵的缺少導(dǎo)致備庫(kù)hang-創(chuàng)新互聯(lián)

最近線上頻繁的出現(xiàn)slave延時(shí)的情況,經(jīng)排查發(fā)現(xiàn)為用戶(hù)在刪除數(shù)據(jù)的時(shí)候,由于表主鍵的缺少,同時(shí)刪除條件沒(méi)有索引,或或者刪除的條件過(guò)濾性極差,導(dǎo)致slave出現(xiàn)hang住,嚴(yán)重的影響了生產(chǎn)環(huán)境的穩(wěn)定性,也希望通過(guò)這篇博客,來(lái)加深主鍵在innodb引擎中的重要性,希望用戶(hù)在使用RDS,設(shè)計(jì)自己的表的時(shí)候,一定要為表加上主鍵,主鍵可以認(rèn)為是innodb存儲(chǔ)引擎的生命,下面我們就來(lái)分析一下這個(gè)案例(本案例的生產(chǎn)環(huán)境的binlog為row模式,對(duì)于myisam存儲(chǔ)引擎也有同樣的問(wèn)題):
  1. (1).現(xiàn)象slave:
  1. mysql> show slave status\G;
  2. *************************** 1. row ***************************
  3. Slave_IO_State: Waiting for master to send event
  4. Master_Host: xxx.xx.xx.xx
  5. Master_User: replicator
  6. Master_Port: 3006
  7. Connect_Retry: 60
  8. Master_Log_File: mysql-bin.000006
  9. Read_Master_Log_Pos: 47465657
  10. Relay_Log_File: slave-relay.100383
  11. Relay_Log_Pos: 251
  12. Relay_Master_Log_File: mysql-bin.000006
  13. Slave_IO_Running: Yes
  14. Slave_SQL_Running: Yes
  15. Replicate_Do_DB:
  16. Replicate_Ignore_DB:
  17. Replicate_Do_Table:
  18. Replicate_Ignore_Table:
  19. Replicate_Wild_Do_Table:
  20. Replicate_Wild_Ignore_Table:
  21. Last_Errno: 0
  22. Last_Error:
  23. Skip_Counter: 0
  24. Exec_Master_Log_Pos: 18057461
  25. Relay_Log_Space: 29409335
  26. Until_Condition: None
  27. Until_Log_File:
  28. Until_Log_Pos: 0
  29. Master_SSL_Allowed: No
  30. Master_SSL_CA_File:
  31. Master_SSL_CA_Path:
  32. Master_SSL_Cert:
  33. Master_SSL_Cipher:
  34. Master_SSL_Key:
  35. Seconds_Behind_Master: 1339
  36. Master_SSL_Verify_Server_Cert: No
  37. Last_IO_Errno: 0
  38. Last_IO_Error:
  39. Last_SQL_Errno: 0
  40. Last_SQL_Error:
  41. slave的Seconds_Behind_Master一直在增加,slave出現(xiàn)hang住。

當(dāng)前標(biāo)題:【Mysql】mysql主鍵的缺少導(dǎo)致備庫(kù)hang-創(chuàng)新互聯(lián)
標(biāo)題鏈接:http://muchs.cn/article10/dpedgo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、動(dòng)態(tài)網(wǎng)站網(wǎng)站設(shè)計(jì)用戶(hù)體驗(yàn)、面包屑導(dǎo)航Google

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司