今天擔心了一下,change master會將relay-log重置的

bulletming發表於2019-01-08

mysql> show slave status;
+--------------+-------------+-------------+---------------+------------------+---------------------+-----------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+------------+------------+--------------+---------------------+-----------------+
| Master_Host  | Master_User | Master_Port | Connect_retry | Master_Log_File  | Read_Master_Log_Pos | Relay_Log_File  | Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running | Slave_SQL_Running | Replicate_do_db | Replicate_ignore_db | Last_errno | Last_error | Skip_counter | Exec_master_log_pos | Relay_log_space |
+--------------+-------------+-------------+---------------+------------------+---------------------+-----------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+------------+------------+--------------+---------------------+-----------------+
| 172.24.68.87 | repl        | 3306        | 60            | update-bin.13876 | 19468891            | relay-log.13733 | 12102838      | update-bin.13876      | No               | No                |                 | mysql,test          | 0          |            | 0            | 19468891            | 12102842        |
+--------------+-------------+-------------+---------------+------------------+---------------------+-----------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+------------+------------+--------------+---------------------+-----------------+
1 row in set (0.00 sec)

mysql> change master to master_Log_file='update-bin.13829',master_log_pos=17868622;
Query OK, 0 rows affected (0.01 sec)

mysql> show slave status;
+--------------+-------------+-------------+---------------+------------------+---------------------+----------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+------------+------------+--------------+---------------------+-----------------+
| Master_Host  | Master_User | Master_Port | Connect_retry | Master_Log_File  | Read_Master_Log_Pos | Relay_Log_File | Relay_Log_Pos | Relay_Master_Log_File | Slave_IO_Running | Slave_SQL_Running | Replicate_do_db | Replicate_ignore_db | Last_errno | Last_error | Skip_counter | Exec_master_log_pos | Relay_log_space |
+--------------+-------------+-------------+---------------+------------------+---------------------+----------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+------------+------------+--------------+---------------------+-----------------+
| 172.24.68.87 | repl        | 3306        | 60            | update-bin.13829 | 17868622            | relay-log.001  | 4             | update-bin.13829      | No               | No                |                 | mysql,test          | 0          |            | 0            | 17868622            | 4               |
+--------------+-------------+-------------+---------------+------------------+---------------------+----------------+---------------+-----------------------+------------------+-------------------+-----------------+---------------------+------------+------------+--------------+---------------------+-----------------+
1 row in set (0.00 sec)

今天有點擔心change master後,dr還會去執行原來沒有執行完的relaylog,仔細看了一下不會放聲這樣的情況。change master會自動的reset slave

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/82392/viewspace-242543/,如需轉載,請註明出處,否則將追究法律責任。

相關文章