生活随笔
收集整理的這篇文章主要介紹了
设置mysql从库延迟主库一小时
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
便于數(shù)據(jù)恢復(fù),設(shè)置從庫(kù)延遲主庫(kù)1個(gè)小時(shí)
此圖借用李磊的 直接上圖了 非本人筆記
?CHANGE?MASTER?TO?MASTER_DELAY?=?1800;單位為秒
[root@backup?~]#?mysql?-uroot?-p123456??-e?"show?slave?status?\G"|grep??-i?sql
mysql:?[Warning]?Using?a?password?on?the?command?line?interface?can?be?insecure.Master_Log_File:?mysql-bin.000008Relay_Master_Log_File:?mysql-bin.000008Slave_SQL_Running:?YesLast_SQL_Errno:?0Last_SQL_Error:?Master_Info_File:?/home/nflow/data/backup/mysql/data/master.infoSQL_Delay:?0SQL_Remaining_Delay:?NULLSlave_SQL_Running_State:?Slave?has?read?all?relay?log;?waiting?for?more?updatesLast_SQL_Error_Timestamp:
[root@backup?~]#?mysql?-uroot?-p123456??-e?"show?slave?status?\G"|grep??-i?sql
mysql:?[Warning]?Using?a?password?on?the?command?line?interface?can?be?insecure.Master_Log_File:?mysql-bin.000008Relay_Master_Log_File:?mysql-bin.000008Slave_SQL_Running:?YesLast_SQL_Errno:?0Last_SQL_Error:?Master_Info_File:?/home/nflow/data/backup/mysql/data/master.infoSQL_Delay:?1800???????#代表延遲同步1800s??????SQL_Remaining_Delay:?1775????????????#從1800?每秒減一個(gè)Slave_SQL_Running_State:?Waiting?until?MASTER_DELAY?seconds?after?master?executed?eventLast_SQL_Error_Timestamp:?
[root@backup?~]#
SQL_Delay:正數(shù)表明slave有延遲了。
SQL_Remaining_Delay:整數(shù)表明延遲時(shí)間。
Slave_SQL_Running_State:表明sql線程狀態(tài)。
轉(zhuǎn)載于:https://blog.51cto.com/wsxxsl/2313907
總結(jié)
以上是生活随笔為你收集整理的设置mysql从库延迟主库一小时的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。