Home > Database > Mysql Tutorial > MySQL 5.6主从复制第二部分[恢复某一台从服务器]

MySQL 5.6主从复制第二部分[恢复某一台从服务器]

WBOY
Release: 2016-06-07 17:28:08
Original
1083 people have browsed it

MySQL 5.6主从复制第二部分[恢复某一台从服务器],本来第二部分是想测试主服务器挂掉,提升从服务器的情况,可是出了点点意外,改

本来第二部分是想测试主服务器挂掉,提升从服务器的情况,可是出了点点意外,改为测试某一台从服务器挂掉的时候,如何恢复。

主服务器挂掉的情况放到第三部分吧。

继续用mysql::sandbox来测试。

主服务器(别名black)(server-id:1)安装在 /home/modify/sandboxes/msb_5_6_10/ 使用5610端口。

从服务器(别名blue)(server-id:2)安装在 /home/modify/sandboxes/msb_5_6_10_a/ 使用5611端口。

从服务器(别名green)(server-id:3)安装在 /home/modify/sandboxes/msb_5_6_10_b/ 使用5612端口。

按照前一篇文章介绍的方法设置好一主二从的复制。

相关阅读:

MySQL 5.6主从复制第一部分[简介及配置]

MySQL 5.6主从复制第二部分[恢复某一台从服务器]

MySQL 5.6主从复制第三部分[把从服务器提升为主服务器]

MySQL 5.6主从复制第四部分[一些被忽视的操作细节]

MySQL 主从复制事件校验 MySQL Replication Event Checksum

使用pt-table-checksum检查主从复制是否正常

----------------------------------------分割线----------------------------------------

假设从服务器blue由于dba误操作,直接更改了数据库里面的数据,,

blue:

mysql testt; Query OKaffected (0.01 sec) mysql test) > mysql testslave STATUS \G Slave_IO_State: Waiting FOR master TO send event Master_Host: 127.0.0.1 Master_User: repl_user Master_Port: 5610 Connect_Retry: 60 Master_Log_File: black-bin.000002 Read_Master_Log_Pos: 2048 Relay_Log_File: mysql_sandbox5611-relay-bin.000004 Relay_Log_Pos: 2218 Relay_Master_Log_File: black-bin.000002 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: 2048 Relay_Log_Space: 2481 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: 1 Master_UUID: 05b47d41-7b10-11e2-9fff-00241db92e69 Master_Info_File: mysql.slave_master_info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave has it Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: 05b47d41Executed_Gtid_Set: 05b47d414f65e570-7b32-11e2-a0de-00241db92e69:1 Auto_Position: sec) ##可以停止复制了。 mysql test) > stop slave; Query OKaffected (1.36 sec)

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template