MySQLの主な問題は、モード(位置からレプリケーションを開始するには、クライアント要求マスター)が同期されていません

シーン

スタンバイモードでのMySQL、スレーブノードからの再引き込み後のマスターフックは、通常のマスタ・スレーブ同期しない発見されたマスタノード:同期位置が矛盾しているので、(Slave_IO_Runningいいえ)、位置からのオフセットを更新する必要があります。

操作の記録

从节点同步状态
のMySQL> スレーブステータス\ Gを示し
*************************** 1行********* ******************
               Slave_IO_State: 
                  MASTER_HOST:10.XX.XXX.80
                  Master_User:PRD
                  MASTER_PORT:6666
                Connect_Retry:60
              MASTER_LOG_FILEます。mysql-bin.000008
          Read_Master_Log_Pos:394862375
               RELAY_LOG_FILE: mysqldのリレー-bin.000009
                RELAY_LOG_POS:4
        のRelay_Master_Log_Fileます。mysql-bin.000008
             Slave_IO_Running:いいえ主从不同步
            Slave_SQL_Running:はい
              Replicate_Do_DB: 
          Replicate_Ignore_DB:INFORMATION_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:394862375
              Relay_Log_Space:120
              Until_Condition:なし
               Until_Log_File: 
                Until_Log_Pos:0
           Master_SSL_Allowed:いいえ
           Master_SSL_CA_File: 
           Master_SSL_CA_Path: 
              Master_SSL_Cert: 
            Master_SSL_Cipher: 
               Master_SSL_Key: 
        Seconds_Behind_Master:NULL
Master_SSL_Verify_Server_Cert:いいえ
                Last_IO_Errno:1236
               Last_IO_Error:ガット致命的なエラー1236マスタからのバイナリログからデータを読み込む:「クライアントが位置>ファイルサイズからレプリケーションを開始するには、マスターを要求しました。394862375の最初のイベント「のmysql-bin.000008」、最後のイベントが4で「./mysql-bin.000008'から読み、最後のバイトは「4.で」./mysql-bin.000008'から読み取ります 失败原因:同步的位置出现不一致
               Last_SQL_Errno:0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id:11480
                  Master_UUID:752385a1-c7af-11e9-b8f8-0050568d3919
             Master_Info_File:/home/XXXX/prd/mysql-5.6.45-linux-glibc2.12-x86_64/data/master.info
                    SQL_Delay:0
          SQL_Remaining_Delay:NULL
      Slave_SQL_Running_State:スレーブは、すべてのリレーログを読みました。それを更新するために、スレーブI / Oスレッドを待っ
           Master_Retry_Countを:86400
                  Master_Bind: 
      Last_IO_Error_Timestamp:200309 10時25分12秒
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 
            Executed_Gtid_Set: 
                Auto_Position:0
セット内の1行(0.00秒)

MySQLの> STOPスレーブ;#同期が正常でない、ストップ同期
クエリOK、0行が影響を受ける(0.00秒)

MySQLの> 


主节点状态
mysqlの>の方法をマスターステータス。
+ ------------------ + ---------- + -------------- + ---- -------------- + ------------------- +
| ファイル| 位置| Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+ ------------------ + ---------- + -------------- + ---- -------------- + ------------------- +
| mysqlの-bin.000011 | 52732 | | | |
+ ------------------ + ---------- + -------------- + ---- -------------- + ------------------- +
セットにおける1行(0.00秒)

MySQLの> フラッシュログ。
クエリOK、影響を受けた0行(0.03秒)
mysqlの> ショーマスターのステータス。
+ ------------------ + ---------- + -------------- + ---- -------------- + ------------------- +
| ファイル| 位置| Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+ ------------------ + ---------- + -------------- + ---- -------------- + ------------------- +
| mysqlの-bin.000014 | 120 | | | |
+ ------------------ + ---------- + -------------- + ---- -------------- + ------------------- +
セットにおける1行(0.00秒)
のMySQL> 


スレーブ节点
のMySQL> CHANGE MASTER TO MASTER_LOG_FILE = 'のMySQL-bin.000014'、MASTER_LOG_POS = 120。#修改偏移量、与主保持一致
クエリOK、0行(0.02秒)の影響を受ける
のMySQL>スレーブ開始。
クエリOK、影響を受けた0行(0.02秒)
のMySQL>スレーブステータス\ Gを示し
*************************** 1行*** ************************
               Slave_IO_State:待機送信イベントへのマスターのための
                  MASTER_HOST:10.XX.XXX.80
                  Master_User:PRD
                  MASTER_PORT:6666
                Connect_Retry:60
              MASTER_LOG_FILEます。mysql-bin.000014
          Read_Master_Log_Pos:5597
               RELAY_LOG_FILE:mysqldのリレー-bin.000002
                RELAY_LOG_POS:5760
        のRelay_Master_Log_File:MySQLの-bin.000014
             Slave_IO_Running:はい
            Slave_SQL_Running:はい正常同步、问题解决

              Replicate_Do_DB: 
          Replicate_Ignore_DB:INFORMATION_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:5597
              Relay_Log_Space:5934
              Until_Condition:なし
               Until_Log_File: 
                Until_Log_Pos:0
           Master_SSL_Allowed:いいえ
           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:いいえ
                Last_IO_Errno:0
                Last_IO_Error: 
               Last_SQL_Errno:0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id:11480
                  Master_UUID:752385a1-c7af-11e9-b8f8-0050568d3919
             Master_Info_File:/home/XXXX/prd/mysql-5.6.45-linux-glibc2.12-x86_64/data/master.info
                    SQL_Delay:0
          SQL_Remaining_Delay:NULL
      Slave_SQL_Running_State:スレーブは、すべてのリレーログを読みました。それ更新するスレーブI / Oスレッドを待っ
           86400:Master_Retry_Count
                  Master_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 
            Executed_Gtid_Set: 
                Auto_Position:0
1行セット内(0.00秒)
MySQLを> 

公開された60元の記事 ウォン称賛20 ビュー4592

おすすめ

転載: blog.csdn.net/zhaikaiyun/article/details/104747773