mysql i o开启_MySQL從屬I/O線程不運行。

1

我面臨着同樣的問題,並采取了以下步驟。完整的線程鏈接是http://www.percona.com/forums/questions-discussions/percona-xtrabackup/11842- backupstop - worksla-sql -run -no。

Steps are same as mentioned by @Luxknight007 except his step 2. However this thread contains more detail which is very helpful. Following is solution which i used and it worked.

步驟和@Luxknight007所提到的步驟是一樣的,除了他的第2步。然而,這個線程包含了更多的細節,這是非常有用的。下面是我使用過的解決方案。

"The first issue is that you changed the replication position instead of fixing the error, and used an incorrect binlog file name format (you likely just used the one from that post you linked I'd guess). To get back to where you started, you need to find the binlog file and position that the slave sql_thread stopped at. Based on your slave status output, it looks like the slave is reading from a new binlog file (you can see that the Read_Master_Log_Pos value is smaller than the Exec_Master_Log_Pos value, which means it has to be reading a newer binlog file than where the slave sql_thread stopped at), so you need to find the binlog file that the slave sql_thread actually failed on. So look in the error log for something like the below:

第一個問題是,您更改了復制位置,而不是修復錯誤,並使用了不正確的binlog文件名稱格式(您可能只是使用了鏈接我猜的那個post中的一個)。要回到開始的地方,您需要找到binlog文件和從服務器sql_thread停止的位置。基於你的奴隸狀態輸出,它看起來像奴隸是閱讀從一個新的binlog文件(您可以看到Read_Master_Log_Pos值小於Exec_Master_Log_Pos值,這意味着它必須閱讀新binlog文件比奴隸sql_thread停下車),所以你需要找到奴隸sql_thread binlog文件失敗。因此,在錯誤日志中查找如下內容:

Code:

代碼:

2013-10-08 12:48:51 37545 [ERROR] Slave SQL: Error 'Table 'testdb.test2' doesn't exist' on query. Default database: 'testdb'. Query: 'insert into test1 select * from test2', Error_code: 1146

2013-10-08 12:48:51 37545 [Warning] Slave: Table 'testdb.test2' doesn't exist Error_code: 1146

2013-10-08 12:48:51 37545 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000001' position 3427

This is a sample I re-created, so yours will be a bit different. Note the ERROR is similar to what you see in your slave status. So find your specific error message in the error log file, and then locate the end part where is gives you the file name and position ("We stopped at log 'mysql-bin.000001' position 3427" in my example). The position should be 315098143 based on your show slave status, as that is when it the slave sql_thread stopped executing events (Exec_Master_Log_Pos ) but the io_thread kept reading in new ones (Read_Master_Log_Pos).

這是我重新創建的一個示例,所以您的將會有一點不同。注意,錯誤與您在從屬狀態中看到的類似。因此,在錯誤日志文件中找到您的特定錯誤消息,然后找到將文件名稱和位置提供給您的結束部分(“我們在日志”mysql-bin中停止)。在我的例子中,000001的位置是3427。這個位置應該是315098143,基於您的顯示從屬狀態,就像當從從sql_thread停止執行事件(Exec_Master_Log_Pos)時那樣,但是io_thread繼續讀取新的事件(Read_Master_Log_Pos)。

Once you find the correct binlog file name and position, re-run your change master statement on your slave using the information you located in the error log. Note that your file name should be something like "newcrmdb1-bin.XXXXXX", not mysql-bin.XXXXXX (you can see this naming convention your show slave status above).

一旦找到正確的binlog文件名稱和位置,就可以使用位於錯誤日志中的信息重新運行更改主語句。注意,您的文件名應該類似於“newcrmdb1-bin”。XXXXXX”,而不是mysql-bin。XXXXXX(您可以在上面看到這個命名約定,您的show slave狀態)。

Code:

代碼:

mysql> change master to MASTER_LOG_FILE='newcrmdb1-bin.XXXXXX', Master_Log_Pos=315098143;

change master to MASTER_LOG_FILE='mysql-bin.000082' , Master_Log_Pos=47914844;

Once you get pointed back to the original replication location where the slave sql_thread failed, you need to then fix the error that it was complaining about to start with.

一旦您指向了原來的復制位置,在那里,從sql_thread失敗了,您就需要修復它所抱怨的錯誤。

The initial replication error appears to be telling you that the table asteriskcdr.bpleadcf does not exist on the slave, so the insert statement is failing when it attempts to select the data from that table. So the problem there is that your slave appears to be already out of sync with your master. If the table in question on the master is static or mostly static, you could likely solve this by exporting the data from just that table on the master using mysqldump and loading it into the slave. If that is not possible, or you do not care about that data, you could always just skip the replication statement with sql_slave_skip_counter, but then the slave would be further out of sync with the master.

最初的復制錯誤似乎是告訴您表星號(asteriskcdr)。bpleadcf不存在於從屬服務器上,因此當它嘗試從該表中選擇數據時,insert語句就失敗了。所以問題是你的奴隸似乎已經和你的主人不同步了。如果主服務器上的表是靜態的,或者大部分是靜態的,那么您很可能通過將數據從表上的數據導出來解決這個問題,使用mysqldump並將其加載到這個服務器中。如果這是不可能的,或者您不關心這些數據,您可以始終使用sql_slave_skip_counter跳過復制語句,但是之后,這個奴隸將與主服務器進一步失去同步。

And if all else fails, you can always rebuild the slave from the master as a last resort as well. =)"

如果其他方法都失敗了,你也可以把主人的奴隸作為最后的手段來重建。=)”

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值