- 论坛徽章:
- 2
|
关于--master-data与--dump-slave参数做的测试
该参数有0,1,2三个值,如果设置为0,与不加该参数效果一样.
增加dump-slave参数时,会在数据执行FLUSH TABLES WITH READ LOCK命令,锁住全库.
测试(Percona 5.5.20)如下:
情况1 --master-data=2(当前备份脚本中使用的)
-- Position to start replication or point-in-time recovery from
--
-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000010', MASTER_LOG_POS=4006402;
情况2 --master-data=1 (等同于 --master-data,默认值为1)
-- Position to start replication or point-in-time recovery from
--
CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000010', MASTER_LOG_POS=4006402;
情况3 --dump-slave=2
-- Position to start replication or point-in-time recovery from (the master of this slave)
--
-- CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000007', MASTER_LOG_POS=24968891;
情况4 --dump-slave=1 (等同于 --master-data,默认值为1)
-- Position to start replication or point-in-time recovery from (the master of this slave)
--
CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000007', MASTER_LOG_POS=24968891;
复制状态信息
mysql> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000010
Position: 4029298
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Queueing master event to the relay log
Master_Host: 192.168.250.242
Master_User: replication
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000007
Read_Master_Log_Pos: 24968891
Relay_Log_File: relay-bin.017623
Relay_Log_Pos: 244
Relay_Master_Log_File: mysql-bin.000007
Slave_IO_Running: Yes
Slave_SQL_Running: Yes |
|