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