Replication

從站未獲得複制的 SERVER_UUID 錯誤

  • June 19, 2016

無法啟動複製主從,我為此搜尋了很多但無法獲取Server-UUID兩個伺服器的。我們對此有什麼解決方案嗎?

場景:我創建了新的從站,它沒有被複製,我們得到了錯誤Last_IO_Error: Fatal error: The slave I/O thread stops because a fatal error is encountered when it tries to get the value of SERVER_UUID variable from master

在我的奴隸身上,我有auto.cnfSERVER_UUID但主人沒有。我認為如果因此我們面臨問題。如果我能夠在 Master 上生成它,我的複制將開始。

Centos 6.7

Master Version MySQL-server-5.5.41-1.el6.x86_64

Slave1 Version Mysql-community-server-5.7.10-2.el6.x86_64

Slave2 上都執行得非常好MySQL-server-5.6.25-1.el6.x86_64

mysql> show slave status\G
*************************** 1. row ***************************
              Slave_IO_State:
                 Master_Host: 10.10.2.12
                 Master_User: slave_user
                 Master_Port: 3306
               Connect_Retry: 60
             Master_Log_File: mysql-bin.000089
         Read_Master_Log_Pos: 18646782
              Relay_Log_File: GACRMDATA2-relay-bin.000002
               Relay_Log_Pos: 4
       Relay_Master_Log_File: mysql-bin.000089
            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: 18646782
             Relay_Log_Space: 150
             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: 1593
               Last_IO_Error: Fatal error: The slave I/O thread stops because a fatal error is encountered when it tries to get the value of SERVER_UUID variable from master.
              Last_SQL_Errno: 0
              Last_SQL_Error:
 Replicate_Ignore_Server_Ids:
            Master_Server_Id: 212
                 Master_UUID:
            Master_Info_File: /var/lib/mysql/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: 160201 09:41:40
    Last_SQL_Error_Timestamp:
              Master_SSL_Crl:
          Master_SSL_Crlpath:
          Retrieved_Gtid_Set:
           Executed_Gtid_Set:
               Auto_Position: 0
        Replicate_Rewrite_DB:
                Channel_Name:
          Master_TLS_Version:
1 row in set (0.00 sec)

輸出my.cnf供參考

[mysqld]
user = mysql
innodb_file_per_table=0
innodb_checksum_algorithm=INNODB
binlog_checksum=NONE
server-id = 216
tmpdir=/tmp/mysqltemp

datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

log-bin=/var/log/mysql/mysql-bin.log
general_log=1
slow_query_log=1
general_log_file=/var/log/mysql/mysqld-gen.log
slow_query_log_file=/var/log/mysql/mysql-slow.log
log_bin_trust_function_creators=1
binlog_format=MIXED
long_query_time=3

#INNODB SETTINGS
innodb_file_per_table
innodb_buffer_pool_size = 107G
innodb_buffer_pool_instances=50
#innodb_additional_mem_pool_size = 1G  (Initially this gave an error) 
innodb_thread_concurrency=0
innodb_flush_method=O_DIRECT
innodb_log_buffer_size = 100M
innodb_log_files_in_group = 2
innodb_lock_wait_timeout=400
innodb_max_dirty_pages_pct=10
innodb_open_files=1000

bulk_insert_buffer_size=512M
thread_cache_size=128M
#table_cache = 2000
table_open_cache = 4096
interactive_timeout = 600
wait_timeout=1000
join_buffer_size = 3M
sort_buffer_size = 8M
max_connections = 600
key_buffer_size = 1G
read_buffer_size = 2M
read_rnd_buffer_size = 16M
lock_wait_timeout=500
transaction-isolation = READ-COMMITTED
max_allowed_packet=512M
tmp_table_size=32M
event_scheduler=1
open_files_limit=20000
default_storage_engine=innodb
group_concat_max_len=1M
preload_buffer_size=33554432
net_buffer_length=1048576
symbolic-links=0
sync_binlog=1

# Recommended in standard MySQL setup

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

從機 2 輸出show slave status\G

[(none)]> show slave status\G
*************************** 1. row ***************************
              Slave_IO_State: Waiting for master to send event
                 Master_Host: 10.10.2.12
                 Master_User: slave_user
                 Master_Port: 3306
               Connect_Retry: 60
             Master_Log_File: mysql-bin.000093
         Read_Master_Log_Pos: 8641342
              Relay_Log_File: relay-bin.000008
               Relay_Log_Pos: 8641501
       Relay_Master_Log_File: mysql-bin.000093
            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: 8641342
             Relay_Log_Space: 8643392
             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: 212
                 Master_UUID:
            Master_Info_File: /var/lib/mysql/master.info
                   SQL_Delay: 0
         SQL_Remaining_Delay: NULL
     Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave                                                     I/O thread to update it
          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:
               Auto_Position: 0
1 row in set (0.00 sec)

您可能想查看以下連結:

https://bugs.mysql.com/bug.php?id=79272

https://www.percona.com/forums/questions-discussions/mysql-and-percona-server/43922-fatal-error-trying-to-sync-percona-5-7-slave-to-mysql-5-5-master

似乎您需要先升級到 5.6,然後才能從 5.5 複製到 5.7。太糟糕了,文件太神秘了

“ MySQL 支持從一個版本系列複製到下一個更高版本系列。例如,您可以從執行 MySQL 5.5 的主伺服器複製到執行 MySQL 5.6 的從伺服器,從執行 MySQL 5.6 的主伺服器複製到執行 MySQL 5.7 的從伺服器,等等.

但是,在從較舊的 master 複製到較新的 slave 時,您可能會遇到困難……"

引用自:https://dba.stackexchange.com/questions/127935