ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 今天担心了一下,change master会将relay-log重置的

今天担心了一下,change master会将relay-log重置的

原创 Linux操作系统 作者:bulletming 时间:2019-01-08 08:33:05 0 删除 编辑

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博客 ” ,链接:https://blog.itpub.net/82392/viewspace-242543/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2004-05-31

  • 博文量
    121
  • 访问量
    106598