MySQL复制停止同步

时间:2016-06-09 15:23:52

标签: mysql replication

所以我的MySQL服务器大约3周前就停止了同步。我有重新问题的问题。重要的是我不要将表锁定为重新同步,并且创建转储需要花费很多时间。

在我的SLAVE服务器上显示我的主数据库中的SHOW SLAVE STATUS \ G。

mysql> SHOW SLAVE STATUS \G
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    144527
Current database: *** NONE ***

*************************** 1. row ***************************
               Slave_IO_State: Connecting to master
                  Master_Host: 127.0.0.1
                  Master_User: repl
                  Master_Port: 3337
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000244
          Read_Master_Log_Pos: 618839200
               Relay_Log_File: mysqld-relay-bin.000692
                Relay_Log_Pos: 210
        Relay_Master_Log_File: mysql-bin.000244
             Slave_IO_Running: Connecting
            Slave_SQL_Running: Yes
              Replicate_Do_DB: hbjdb
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 1
          Exec_Master_Log_Pos: 618839200
              Relay_Log_Space: 367
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           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: No
                Last_IO_Errno: 2003
                Last_IO_Error: error connecting to master 'repl@127.0.0.1:3337' - retry-time: 60  retries: 86400
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 1
1 row in set (0.00 sec)

以下是我在MASTER服务器上显示SHOW SLAVE STATUS \ G的内容:

ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1478698
Current database: *** NONE ***

*************************** 1. row ***************************
               Slave_IO_State: Connecting to master
                  Master_Host: 127.0.0.1
                  Master_User: repl
                  Master_Port: 3337
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000171
          Read_Master_Log_Pos: 1012219985
               Relay_Log_File: mysqld-relay-bin.000031
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysql-bin.000171
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 1
          Exec_Master_Log_Pos: 1012219985
              Relay_Log_Space: 106
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           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: No
                Last_IO_Errno: 2013
                Last_IO_Error: error connecting to master 'repl@127.0.0.1:3337' - retry-time: 60  retries: 86400
               Last_SQL_Errno: 0
               Last_SQL_Error: 

我的slave mysql数据库在本地托管,而master数据库由服务器公司托管。

以下是

的输出
SELECT user,host FROM mysql.user WHERE Repl_slave_priv='Y';

在我的MASTER数据库

+------+---------------------------+
| user | host                      |
+------+---------------------------+
| root | localhost                 |
| root | c9.d.de.static.xlhost.com |
| root | 127.0.0.1                 |
| repl | 68.165.36.44              |
| repl | 127.0.0.1                 |
| root | 209.190.4.162             |
| root | 209.190.4.163             |
| root | 207.182.131.234           |
| root | %                         |
| root | 207.182.129.2             |
+------+---------------------------+
10 rows in set (0.01 sec)

和我的SLAVE数据库

+------------------+---------------+
| user             | host          |
+------------------+---------------+
| root             | localhost     |
| root             | %             |
| root             | 127.0.0.1     |
| debian-sys-maint | localhost     |
| repl             | 68.165.36.44  |
| repl             | 99.135.16.102 |
+------------------+---------------+
6 rows in set (0.02 sec)

以下是我的主错误日志文件:

160608 16:40:54 [ERROR] Slave I/O: error connecting to master 'repl@127.0.0.1:3337' - retry-time: 60  retries: 86400, Error_code: 2013
160608 16:40:54 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000171' at position 1012219985, relay log './mysqld-relay-bin.000031' position: 4

我感谢所有的帮助。

0 个答案:

没有答案