国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

中關(guān)村在線官方網(wǎng)站電腦首頁關(guān)鍵詞排名

中關(guān)村在線官方網(wǎng)站電腦,首頁關(guān)鍵詞排名,wordpress超好看主題,5080電影電視劇大全目錄 查看主從是否同步 詳解Slave_IO、Slave_SQL 判斷主從完全同步 各個(gè) Log_File 和 Log_Pos的關(guān)系 修復(fù)命令 查看主從是否同步 show slave status; Slave_IO_Running、Slave_SQL_Running,這兩個(gè)值是Yes表示正常,No是異常 使用豎排顯示&#xf…

目錄

查看主從是否同步

詳解Slave_IO、Slave_SQL?

判斷主從完全同步

各個(gè) Log_File 和 Log_Pos的關(guān)系

修復(fù)命令


查看主從是否同步

show slave status;

Slave_IO_Running、Slave_SQL_Running,這兩個(gè)值是Yes表示正常,No是異常

使用豎排顯示:

Name                         |Value                                                 |
-----------------------------+------------------------------------------------------+
Slave_IO_State               |Waiting for master to send event                      |
Master_Host                  |192.168.20.161                                        |
Master_User                  |root                                                  |
Master_Port                  |3306                                                  |
Connect_Retry                |60                                                    |
Master_Log_File              |mysql-bin.004651                                      |
Read_Master_Log_Pos          |300004719                                             |
Relay_Log_File               |xxxx-relay-bin.002999                                 |
Relay_Log_Pos                |300004932                                             |
Relay_Master_Log_File        |mysql-bin.004651                                      |
Slave_IO_Running             |Yes                                                   |
Slave_SQL_Running            |Yes                                                   |
Replicate_Do_DB              |alisaas                                               |
Replicate_Ignore_DB          |mysql,information_schema,performation_schema,sys      |
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          |300004719                                             |
Relay_Log_Space              |300005190                                             |
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             |161                                                   |
Master_UUID                  |000fe6d4-25cd-21eb-a102-1111efa99c99                  |
Master_Info_File             |/sata01/data/mysql/master.info                        |
SQL_Delay                    |0                                                     |
SQL_Remaining_Delay          |                                                      |
Slave_SQL_Running_State      |Slave has read all relay log; waiting for more updates|
Master_Retry_Count           |86400                                                 |
Master_Bind                  |                                                      |
Last_IO_Error_Timestamp      |                                                      |
Last_SQL_Error_Timestamp     |                                                      |
Master_SSL_Crl               |                                                      |
Master_SSL_Crlpath           |                                                      |
Retrieved_Gtid_Set           |                                                      |
Executed_Gtid_Set            |                                                      |
Auto_Position                |0                                                     |
Replicate_Rewrite_DB         |                                                      |
Channel_Name                 |                                                      |
Master_TLS_Version           |                                                      |

詳解Slave_IO、Slave_SQL?

Slave_IO線程負(fù)責(zé)把主庫的bin日志(Master_Log)內(nèi)容,抄寫到從庫的中繼日志上(Relay_Log)。
Slave_SQL線程負(fù)責(zé)把中繼日志上的語句在從庫上執(zhí)行一遍。
?

Slave_IO線程相對(duì)比較簡(jiǎn)單,一般不容易出錯(cuò)。如果Slave_IO_Running顯示為No,多為網(wǎng)絡(luò)連接不上權(quán)限不夠等環(huán)境問題。

Slave_SQL線程相對(duì)容易出錯(cuò),例如人為手動(dòng)的在從庫插入一條數(shù)據(jù),造成主從不一致。但此時(shí)兩個(gè)線程的狀態(tài)仍然是正常的。等到主庫也插入一條同樣的數(shù)據(jù)時(shí),通知從庫做相同操作,從庫會(huì)出現(xiàn)主鍵重復(fù)的錯(cuò)誤。此時(shí)Slave_SQL_Running的狀態(tài)會(huì)變?yōu)镹o,而Last_SQL_ErrorLast_SQL_Error_Timestamp會(huì)記錄錯(cuò)誤的原因和發(fā)生時(shí)間。

Slave_SQL線程會(huì)停止后續(xù)的SQL語句執(zhí)行,因?yàn)樗庾R(shí)到往后執(zhí)行會(huì)導(dǎo)致錯(cuò)誤修復(fù)的難度增加。但Slave_IO線程不會(huì)停止,會(huì)繼續(xù)抄log的工作。所以中繼log依然是最新的。

這時(shí)候Master_Log_File: mysql-bin.000002?和 ?Relay_Master_Log_File: mysql-bin.000001之間就產(chǎn)生了偏差。

以上面為例,主庫的日志已經(jīng)寫到了 mysql-bin.000001,而從庫依然停留在 mysql-bin.000002等待人工修復(fù)錯(cuò)誤。

那么當(dāng)錯(cuò)誤修復(fù)后,只需用stop slavestart slave重啟下同步。Slave_SQL線程會(huì)重新的嘗試工作。

如果沒有問題,那么Slave_SQL的狀態(tài)會(huì)變回Yes。但此時(shí)主從并沒有完全同步,需要一點(diǎn)時(shí)間。

判斷主從完全同步

若完全同步,可通過以下幾條判斷:

1. 首先 Master_Log_FileRelay_Master_Log_File 所指向的文件必須一致。

例如本案例中是mysql-bin.004651

2.?Read_Master_Log_Pos = Exec_Master_Log_Pos 時(shí),則表明 slave 和 master 處于完全同步的狀態(tài)。例如本案例中是:300004719

Read_Master_Log_Pos 是io讀到的位置,Exec_Master_Log_Pos 是sql執(zhí)行到的位置。

1和2合并即:

Relay_Master_Log_File = Master_Log_File

Read_Master_Log_Pos = Exec_Master_Log_Pos

3. 此時(shí),有幾個(gè)字段值如下:

Slave_IO_State: Waiting for master to send event。意思是等待主庫送事件過來

Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it。意思是從庫已經(jīng)讀完所有的relay log,等待從庫的IO線程繼續(xù)更新。

各個(gè) Log_File 和 Log_Pos的關(guān)系

1) The position, ON THE MASTER, from which the I/O thread is reading:

Master_Log_File/Read_Master_Log_Pos. -----相對(duì)于主庫,從庫讀取主庫的二進(jìn)制日志的位置,是IO線程

2) The position, IN THE RELAY LOGS, at which the SQL thread is executing:

Relay_Log_File/Relay_Log_Pos?----相對(duì)于從庫,是從庫的sql線程執(zhí)行到的位置

3) The position, ON THE MASTER, at which the SQL thread is executing:

Relay_Master_Log_File/Exec_Master_Log_Pos?----相對(duì)于主庫,是從庫的sql線程執(zhí)行到的位置

show slave status\G中的Read_Master_Log_Pos和Relay_Log_Pos的(大小)關(guān)系_lovely可愛歐辰的博客-CSDN博客

修復(fù)命令

執(zhí)行以下3條命令??梢栽趎avicat、dbeaver、或者cmd窗口,都行。

stop slave;
set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
start slave;
 

一次不行,多執(zhí)行幾次?;蛘咝薷臄?shù)值1,改成2,或者3。前提是你知道怎么玩,不會(huì)玩的話,就用1,多執(zhí)行幾次。

Mysql主從錯(cuò)誤之Slave_SQL_Running No - 簡(jiǎn)書

關(guān)于set global sql_slave_skip_counter=N 命令的解釋_Mr. Sun_的博客-CSDN博客

Mysql主從同步時(shí)Slave_IO_Running:Connecting ; Slave_SQL_Running:Yes的情況故障排除_MegaBytes的博客-CSDN博客

Mysql主從同步時(shí)Slave_IO_Running:Connecting ; Slave_SQL_Running:Yes的情況故障排除_爽姐想退休的博客-CSDN博客

show slave status判斷主從同步狀態(tài)_chagaostu的博客-CSDN博客

mysql查看主從同步狀態(tài)的方法_mysql_Full Stack Developme-華為云開發(fā)者聯(lián)盟

MySQL :: MySQL 5.7 Reference Manual :: 16.1.2 Setting Up Binary Log File Position Based Replication

=========================分割線============================?

文章到此已經(jīng)結(jié)束,以下是紫薯布丁

show slave status;

stop slave;
set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
start slave;

Name ? ? ? ? ? ? ? ? ? ? ? ? |Value ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
-----------------------------+------------------------------------------------------+
Slave_IO_State ? ? ? ? ? ? ? |Waiting for master to send event ? ? ? ? ? ? ? ? ? ? ?|
Master_Host ? ? ? ? ? ? ? ? ?|192.168.20.161 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Master_User ? ? ? ? ? ? ? ? ?|root ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Master_Port ? ? ? ? ? ? ? ? ?|3306 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Connect_Retry ? ? ? ? ? ? ? ?|60 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Master_Log_File ? ? ? ? ? ? ?|mysql-bin.004651 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Read_Master_Log_Pos ? ? ? ? ?|300004719 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Relay_Log_File ? ? ? ? ? ? ? |xxxx-relay-bin.002999 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Relay_Log_Pos ? ? ? ? ? ? ? ?|300004932 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Relay_Master_Log_File ? ? ? ?|mysql-bin.004651 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Slave_IO_Running ? ? ? ? ? ? |Yes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Slave_SQL_Running ? ? ? ? ? ?|Yes ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Replicate_Do_DB ? ? ? ? ? ? ?|alisaas ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Replicate_Ignore_DB ? ? ? ? ?|mysql,information_schema,performation_schema,sys ? ? ?|
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 ? ? ? ? ?|300004719 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Relay_Log_Space ? ? ? ? ? ? ?|300005190 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
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 ? ? ? ? ? ? |161 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Master_UUID ? ? ? ? ? ? ? ? ?|000fe6d4-25cd-21eb-a102-1111efa99c99 ? ? ? ? ? ? ? ? ?|
Master_Info_File ? ? ? ? ? ? |/sata01/data/mysql/master.info ? ? ? ? ? ? ? ? ? ? ? ?|
SQL_Delay ? ? ? ? ? ? ? ? ? ?|0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
SQL_Remaining_Delay ? ? ? ? ?| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Slave_SQL_Running_State ? ? ?|Slave has read all relay log; waiting for more updates|
Master_Retry_Count ? ? ? ? ? |86400 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Master_Bind ? ? ? ? ? ? ? ? ?| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Last_IO_Error_Timestamp ? ? ?| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Last_SQL_Error_Timestamp ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Master_SSL_Crl ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Master_SSL_Crlpath ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Retrieved_Gtid_Set ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Executed_Gtid_Set ? ? ? ? ? ?| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Auto_Position ? ? ? ? ? ? ? ?|0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
Replicate_Rewrite_DB ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Channel_Name ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|
Master_TLS_Version ? ? ? ? ? | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?|

http://aloenet.com.cn/news/43693.html

相關(guān)文章:

  • 愛站網(wǎng)排行榜武漢抖音seo搜索
  • 網(wǎng)站設(shè)計(jì)app微信推廣方式有哪些
  • sf網(wǎng)站怎么建設(shè)網(wǎng)站被禁用如何解決
  • 佛山網(wǎng)站建設(shè)策劃網(wǎng)站推廣模式
  • 自動(dòng)化培訓(xùn)網(wǎng)站建設(shè)網(wǎng)絡(luò)營(yíng)銷到底是干嘛的
  • 網(wǎng)站建設(shè)大概費(fèi)用怎么建網(wǎng)站賺錢
  • 做h5頁面有哪些好網(wǎng)站廣州競(jìng)價(jià)外包
  • 網(wǎng)站的運(yùn)行與維護(hù)艾滋病阻斷藥有哪些
  • 建站寶盒開通百度seo培訓(xùn)班
  • 網(wǎng)頁游戲傳奇霸業(yè)攻略搜索引擎優(yōu)化的英語簡(jiǎn)稱
  • 微商軟件商城24小時(shí)整站排名優(yōu)化品牌
  • 政務(wù)網(wǎng)站隊(duì)伍建設(shè)情況匯報(bào)怎么免費(fèi)創(chuàng)建個(gè)人網(wǎng)站
  • 阿里云 多域名解析 到不同的網(wǎng)站網(wǎng)站的友情鏈接是什么意思
  • 建筑公司網(wǎng)站廣告宣傳語重慶 seo
  • 鎮(zhèn)江網(wǎng)站優(yōu)化哪家好百度推廣要自己建站嗎
  • 手機(jī)怎樣設(shè)計(jì)網(wǎng)站建設(shè)seo關(guān)鍵詞推廣
  • WordPress插件后天怎么編寫青島谷歌seo
  • 大型電子商務(wù)網(wǎng)站建設(shè)郴州網(wǎng)站定制
  • 番禺人才網(wǎng)官網(wǎng)單位招考關(guān)鍵詞優(yōu)化公司推薦
  • 網(wǎng)站頁面設(shè)計(jì)需求網(wǎng)絡(luò)推廣官網(wǎng)首頁
  • 網(wǎng)頁與網(wǎng)站的關(guān)系互聯(lián)網(wǎng)廣告代理可靠嗎
  • 做網(wǎng)站江門天津百度seo排名優(yōu)化
  • wordpress5.2.2下載seo有哪些經(jīng)典的案例
  • 鎮(zhèn)江百度競(jìng)價(jià)南昌seo管理
  • 門戶網(wǎng)站開發(fā)要多久深圳seo優(yōu)化推廣公司
  • 如何做新聞源網(wǎng)站如何讓新網(wǎng)站被收錄
  • 網(wǎng)站建設(shè)的方法學(xué)生網(wǎng)頁制作成品
  • 專業(yè)網(wǎng)站建設(shè)服務(wù)公司哪家好廣州今日頭條新聞最新
  • 云南新建設(shè)國(guó)際小學(xué)網(wǎng)站百度手機(jī)下載安裝
  • app展示網(wǎng)站網(wǎng)絡(luò)seo首頁