您的位置:首页 > 编程语言 > Go语言

Got fatal error 1236 from master when reading data from binary log: 'A slave with the same server_uu

2017-08-25 14:50 876 查看
双slave第二个启动slave报错:

root@localhost [(none)]>root@slave status \G;

*************************** 1. row ***************************

               Slave_IO_State: 

                  Master_Host: 10.194.41.231

                  Master_User: repl

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000011

          Read_Master_Log_Pos: 1070

               Relay_Log_File: relay-bin.000002

                Relay_Log_Pos: 414

        Relay_Master_Log_File: mysql-bin.000011

             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: 0

          Exec_Master_Log_Pos: 1070

              Relay_Log_Space: 615

              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: 1236

                Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'A slave with the same server_uuid/server_id as this slave has connected to the master; the first event '' at
4, the last event read from '/data/mysql/mysql3306/logs/mysql-bin.000011' at 1070, the last byte read from '/data/mysql/mysql3306/logs/mysql-bin.000011' at 1070.'

               Last_SQL_Errno: 0

               Last_SQL_Error: 

  Replicate_Ignore_Server_Ids: 

             Master_Server_Id: 13306

                  Master_UUID: 8b3a2bfc-5ff9-11e7-a6aa-080027f004fe

             Master_Info_File: /data/mysql/mysql3306/data/master.info

                    SQL_Delay: 0

          SQL_Remaining_Delay: NULL

      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates

           Master_Retry_Count: 86400

                  Master_Bind: 

      Last_IO_Error_Timestamp: 170825 14:00:06

     Last_SQL_Error_Timestamp: 

               Master_SSL_Crl: 

           Master_SSL_Crlpath: 

           Retrieved_Gtid_Set: 

            Executed_Gtid_Set: 8b3a2bfc-5ff9-11e7-a6aa-080027f004fe:1-164

                Auto_Position: 1

         Replicate_Rewrite_DB: 

                 Channel_Name: 

           Master_TLS_Version: 

1 row in set (0.00 sec)

ERROR: 

No query specified

root@localhost [(none)]>

说的很清楚 备库的server_uuid一样:

root@localhost [(none)]>show variables like '%id%';

+---------------------------------------+--------------------------------------------+

| Variable_name                         | Value                                      |

+---------------------------------------+--------------------------------------------+

| avoid_temporal_upgrade                | OFF                                        |

| binlog_gtid_simple_recovery           | ON                                         |

| enforce_gtid_consistency              | ON                                         |

| gtid_executed_compression_period      | 1000                                       |

| gtid_mode                             | ON                                         |

| gtid_next                             | AUTOMATIC                                  |

| gtid_owned                            |                                            |

| gtid_purged                           | 8b3a2bfc-5ff9-11e7-a6aa-080027f004fe:1-164 |

| identity                              | 0                                          |

| insert_id                             | 0                                          |

| last_insert_id                        | 0                                          |

| log_builtin_as_identified_by_password | OFF                                        |

| log_syslog_include_pid                | ON                                         |

| pid_file                              | mysql.pid                                  |

| pseudo_thread_id                      | 5                                          |

| query_cache_wlock_invalidate          | OFF                                        |

| server_id                             | 23306  
                                   |

| server_id_bits                        | 32                                         |

| server_uuid                           | 16f9c082-4e57-11e7-bb52-0800278c53b0       |

| session_track_gtids                   | OFF                                        |

+---------------------------------------+--------------------------------------------+

20 rows in set (0.01 sec)

root@localhost [(none)]>

root@localhost [(none)]>show variables like '%id%';

+---------------------------------------+--------------------------------------------+

| Variable_name                         | Value                                      |

+---------------------------------------+--------------------------------------------+

| avoid_temporal_upgrade                | OFF                                        |

| binlog_gtid_simple_recovery           | ON                                         |

| enforce_gtid_consistency              | ON                                         |

| gtid_executed_compression_period      | 1000                                       |

| gtid_mode                             | ON                                         |

| gtid_next                             | AUTOMATIC                                  |

| gtid_owned                            |                                            |

| gtid_purged                           | 8b3a2bfc-5ff9-11e7-a6aa-080027f004fe:1-164 |

| identity                              | 0                                          |

| insert_id                             | 0                                          |

| last_insert_id                        | 0                                          |

| log_builtin_as_identified_by_password | OFF                                        |

| log_syslog_include_pid                | ON                                         |

| pid_file                              | mysql.pid                                  |

| pseudo_thread_id                      | 7                                          |

| query_cache_wlock_invalidate          | OFF                                        |

| server_id                             | 33306
                                     |

| server_id_bits                        | 32                                         |
| server_uuid                           | 16f9c082-4e57-11e7-bb52-0800278c53b0       |

| session_track_gtids                   | OFF                                        |

+---------------------------------------+--------------------------------------------+

20 rows in set (0.00 sec)

root@localhost [(none)]>

解决办法:

修改第二个节点上的

vi /data/mysql/mysql3306/data/auto.cnf

为:

[auto]

server-uuid=16f9c082-4e57-11e7-bb52-0800278c90b0

重启:

root@localhost [mysql]>start slave;

Query OK, 0 rows affected (0.00 sec)

root@localhost [mysql]>show slave status \G;

*************************** 1. row ***************************

               Slave_IO_State: Waiting for master to send event

                  Master_Host: 10.194.41.231

                  Master_User: repl

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000011

          Read_Master_Log_Pos: 1070

               Relay_Log_File: relay-bin.000002

                Relay_Log_Pos: 414

        Relay_Master_Log_File: mysql-bin.000011

             Slave_IO_Running: Yes

            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: 0

          Exec_Master_Log_Pos: 1070

              Relay_Log_Space: 655

              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: 0

Master_SSL_Verify_Server_Cert: No

                Last_IO_Errno: 0

                Last_IO_Error: 

               Last_SQL_Errno: 0

               Last_SQL_Error: 

  Replicate_Ignore_Server_Ids: 

             Master_Server_Id: 13306

                  Master_UUID: 8b3a2bfc-5ff9-11e7-a6aa-080027f004fe

             Master_Info_File: /data/mysql/mysql3306/data/master.info

                    SQL_Delay: 0

          SQL_Remaining_Delay: NULL

      Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates

           Master_Retry_Count: 86400

                  Master_Bind: 

      Last_IO_Error_Timestamp: 

     Last_SQL_Error_Timestamp: 

               Master_SSL_Crl: 

           Master_SSL_Crlpath: 

           Retrieved_Gtid_Set: 

            Executed_Gtid_Set: 8b3a2bfc-5ff9-11e7-a6aa-080027f004fe:1-164

                Auto_Position: 1

         Replicate_Rewrite_DB: 

                 Channel_Name: 

           Master_TLS_Version: 

1 row in set (0.00 sec)

ERROR: 

No query specified

root@localhost [mysql]>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐