MySQL主备复制搭建(使用mysqld(2)

--------------------------------------------------------------------------------
 当看到Slave_IO_Running: Yes 和 Slave_SQL_Running: Yes证明io通信线程和sql回放线程都已经启动。至此,主备复制结构配置完成


5.进行正常主从测试:
在mysql3308数据库停止复制

--------------------------------------------------------------------------------
mysql> stop slave;
Query OK, 0 rows affected (0.00 sec)

mysql> show slave status \G;         
*************************** 1. row ***************************
              Slave_IO_State:
                  Master_Host: localhost
                  Master_User: replication
                  Master_Port: 3307
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000005
          Read_Master_Log_Pos: 408
              Relay_Log_File: mysql-relay-bin.000012
                Relay_Log_Pos: 553
        Relay_Master_Log_File: mysql-bin.000005

--------------------------------------------------------------------------------


在mysql3309数据库停止复制

--------------------------------------------------------------------------------
mysql> stop slave;
Query OK, 0 rows affected (0.00 sec)

mysql> show slave status \G;
*************************** 1. row ***************************
              Slave_IO_State:
                  Master_Host: localhost
                  Master_User: replication
                  Master_Port: 3307
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000006
          Read_Master_Log_Pos: 316

--------------------------------------------------------------------------------


查看mysql日志情况:

--------------------------------------------------------------------------------
150510  1:33:39 [Note] Error reading relay log event: slave SQL thread was killed
150510  1:33:39 [Note] Slave I/O thread killed while reading event
150510  1:33:39 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000005', position 408

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/fe7e56f08aac91c485cc8aeda0f721c1.html