MySQL 5.6 master-slave replication Part 2 [restore an slave server]

Source: Internet
Author: User

The second part was intended to test whether the master server was suspended and the slave server was upgraded. However, an accident occurred. Instead, it was used to test how to recover a slave server when it was suspended.

Put the failure of the master server in the third part.

Continue to test with mysql: sandbox.

The master server (alias black) (server-id: 1) is installed on/home/modify/sandboxes/msb_5_6_10/with port 5610.

The slave server (alias blue) (server-id: 2) is installed on/home/modify/sandboxes/msb_5_6_10_a/and port 5611 is used.

Install the slave server (alias green) (server-id: 3) on/home/modify/sandboxes/msb_5_6_10_ B/and use port 5612.

Follow the methods described in the previous article to set up a master-slave replication.

MySQL 5.6 master-slave replication Part 1 [Introduction and configuration]

MySQL 5.6 master-slave replication Part 2 [restore an slave server]

MySQL 5.6 master-slave replication Part 3 [upgrade slave server to master server]

MySQL 5.6 master-slave replication Part 4 [some ignored Operation Details]

MySQL master-slave Replication Event validation MySQL Replication Event Checksum

Use pt-table-checksum to check whether master-slave replication is normal

---------------------------------------- Split line ----------------------------------------

Assume that blue on the slave server directly changes the data in the database due to dba misoperations,

Blue:

Mysql [localhost] {msandbox} (test)> truncate table t; Query OK, 0 ROWS affected (0.01 sec) mysql [localhost] {msandbox} (test)> mysql [localhost] {msandbox} (test)> SHOW slave STATUS \ G ***************************** 1. ROW ************************** Slave_IO_State: Waiting FOR master TO send event Master_Host: wagner. 0.0.1 Master_User: repl_user Master_Port: 5610 Connect_Retry: 60 Master_Log_File: bl Ack-bin.000002 Read_Master_Log_Pos: 2048 Relay_Log_File: mysql_sandbox5611-relay-bin.000004 Relay_Log_Pos: 2218 runtime: black-bin.000002 runtime: Yes runtime: Last_Errno: 0 Last_Error: Skip_Counter: 0 Exec_Master_Log_Pos: 2048 Relay_Log_Space: 2481 Until_Condition: NONE Until_Log_File: Failed: 0 failed: No failed: Failed: Master_SSL_Cert: Failed: Master_SSL_Key: Failed: No failed: 0 failed: Failed: 0 Last_ SQL _Error: replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_UUID: 05b47d41-7b10-11e2-9f Ff-00241db92e69 Master_Info_File: mysql. slave_master_info SQL _Delay: 0 rows: NULL rows: Slave has read all relay log; waiting FOR the slave I/O thread TO UPDATE it Master_Retry_Count: 86400 Master_Bind: rows: Master_SSL_Crl: rows: retrieved_Gtid_Set: 05b47d41-7b10-11e2-9fff-00241db92e69: 16-19 Executed_Gtid _ Set: duplicate: 1-19, 4f65e570-7b32-11e2-a0de-00241db92e69: 1 Auto_Position: 11 row in set (0.00 sec) # You can stop copying. Mysql [localhost] {msandbox} (test)> stop slave; Query OK, 0 ROWS affected( 1.36 sec)
  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.