欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

slave的中繼日志relay-log損壞

  當(dāng)slave意外宕機(jī)時(shí),有可能會(huì)損壞中繼日志relay-log,再次開(kāi)啟同步復(fù)制時(shí),會(huì)出現(xiàn)報(bào)錯(cuò)。
  解決方法:找到同步的binlog日志和POS點(diǎn),然后重新進(jìn)行同步,這樣就可以有新的中繼日志了。
  下邊看個(gè)案例,模擬了中繼日志損壞的情況,查看到的信息如下:

點(diǎn)擊(此處)折疊或打開(kāi)

公司主營(yíng)業(yè)務(wù):成都網(wǎng)站制作、網(wǎng)站建設(shè)、外貿(mào)網(wǎng)站建設(shè)、移動(dòng)網(wǎng)站開(kāi)發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實(shí)現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競(jìng)爭(zhēng)能力。創(chuàng)新互聯(lián)是一支青春激揚(yáng)、勤奮敬業(yè)、活力青春激揚(yáng)、勤奮敬業(yè)、活力澎湃、和諧高效的團(tuán)隊(duì)。公司秉承以“開(kāi)放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對(duì)我們的高要求,感謝他們從不同領(lǐng)域給我們帶來(lái)的挑戰(zhàn),讓我們激情的團(tuán)隊(duì)有機(jī)會(huì)用頭腦與智慧不斷的給客戶帶來(lái)驚喜。創(chuàng)新互聯(lián)推出革吉免費(fèi)做網(wǎng)站回饋大家。

  1. MySQL> show slave status \G
  2. ERROR 2006 (HY000): MySQL server has gone away
  3. No connection. Trying to reconnect...
  4. Connection id: 4
  5. Current database: test

  6. *************************** 1. row ***************************
  7.                Slave_IO_State: Waiting for master to send event
  8.                   Master_Host: 10.10.10.200
  9.                   Master_User: repl
  10.                   Master_Port: 3306
  11.                 Connect_Retry: 60
  12.               Master_Log_File: mysql-bin.000005
  13.           Read_Master_Log_Pos: 220
  14.                Relay_Log_File: mysql-relay-bin.000010
  15.                 Relay_Log_Pos: 283
  16.         Relay_Master_Log_File: mysql-bin.000004
  17.              Slave_IO_Running: Yes
  18.             Slave_SQL_Running: No
  19.               Replicate_Do_DB:
  20.           Replicate_Ignore_DB:
  21.            Replicate_Do_Table:
  22.        Replicate_Ignore_Table:
  23.       Replicate_Wild_Do_Table:
  24.   Replicate_Wild_Ignore_Table:
  25.                    Last_Errno: 1032
  26.                    Last_Error: Could not execute Update_rows event on table test.test01; Can't find record in 'test01', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log mysql-bin.000004, end_log_pos 310
  27.                  Skip_Counter: 0
  28.           Exec_Master_Log_Pos: 120
  29.               Relay_Log_Space: 2251
  30.               Until_Condition: None
  31.                Until_Log_File:
  32.                 Until_Log_Pos: 0
  33.            Master_SSL_Allowed: No
  34.            Master_SSL_CA_File:
  35.            Master_SSL_CA_Path:
  36.               Master_SSL_Cert:
  37.             Master_SSL_Cipher:
  38.                Master_SSL_Key:
  39.         Seconds_Behind_Master: NULL
  40. Master_SSL_Verify_Server_Cert: No
  41.                 Last_IO_Errno: 0
  42.                 Last_IO_Error:
  43.                Last_SQL_Errno: 1032
  44.                Last_SQL_Error: Could not execute Update_rows event on table test.test01; Can't find record in 'test01', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log mysql-bin.000004, end_log_pos 310
  45.   Replicate_Ignore_Server_Ids:
  46.              Master_Server_Id: 1
  47.                   Master_UUID: 4adfcd1d-4059-11e7-9532-080027d597f9
  48.              Master_Info_File: mysql.slave_master_info
  49.                     SQL_Delay: 0
  50.           SQL_Remaining_Delay: NULL
  51.       Slave_SQL_Running_State:
  52.            Master_Retry_Count: 86400
  53.                   Master_Bind:
  54.       Last_IO_Error_Timestamp:
  55.      Last_SQL_Error_Timestamp: 170808 11:45:26
  56.                Master_SSL_Crl:
  57.            Master_SSL_Crlpath:
  58.            Retrieved_Gtid_Set:
  59.             Executed_Gtid_Set:
  60.                 Auto_Position: 0
  其中,涉及幾個(gè)重要的參數(shù):
slave_IO_Running:接受master的binlog的信息
master_Log_file:正在讀取master上binlog日志名
Read_master_Log_Pos:正在讀取master上當(dāng)前binlog日志POS點(diǎn)。
slave_SQL_Running:執(zhí)行寫操作
Relay_master_Log_File:正在同步master上的binlog日志名。
Exec_master_Log_Pos:正在同步當(dāng)前binlog日志的POS點(diǎn)。
 以Relay_master_Log_File參數(shù)值和Exec_master_Log_Pos參數(shù)值為基準(zhǔn)。
Relay_Log_File: mysql-relay-bin.000010
Relay_Log_Pos: 283
  接下來(lái)開(kāi)始重置主從復(fù)制:

點(diǎn)擊(此處)折疊或打開(kāi)

  1. mysql> stop slave;
  2. Query OK, 0 rows affected (0.04 sec)

  3. mysql> change master to master_log_file='mysql-relay-bin.000010',master_log_pos=283;
  4. Query OK, 0 rows affected (0.06 sec)

  5. mysql> start slave;
  6. Query OK, 0 rows affected (0.12 sec)
  通過(guò)這種方法可以修復(fù)中繼日志,但是在MySQL5.5版本之后,在slave的my.cnf配置文件中加入relay_log_recovery=1就可以了。

標(biāo)題名稱:slave的中繼日志relay-log損壞
本文網(wǎng)址:http://chinadenli.net/article10/gehpdo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營(yíng)銷、手機(jī)網(wǎng)站建設(shè)、靜態(tài)網(wǎng)站、搜索引擎優(yōu)化、、軟件開(kāi)發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(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)

綿陽(yáng)服務(wù)器托管