内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

MySQL5.7復(fù)制延遲之sync_relay_log-創(chuàng)新互聯(lián)

一、描述
MySQL 5.7版本主從復(fù)制,批量時候顯示延遲上萬秒。

目前成都創(chuàng)新互聯(lián)已為上千家的企業(yè)提供了網(wǎng)站建設(shè)、域名、虛擬空間、網(wǎng)站托管、服務(wù)器租用、企業(yè)網(wǎng)站設(shè)計、巨野網(wǎng)站維護(hù)等服務(wù),公司將堅持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。

二、現(xiàn)象

1、io使用率高
#iostat -dxm 1 1000
Device:         rrqm/s   wrqm/s     r/s     w/s    rMB/s    wMB/s avgrq-sz avgqu-sz   await  svctm  %util
scd0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
vda               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
vdb               0.00    96.00    0.00 2596.00     0.00     8.54     6.74     1.33    0.51   0.37  95.30
vdc               0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
vdd               0.00     0.00    0.00   11.00     0.00     0.06    11.64     0.00    0.09   0.09   0.10
vde               0.00     0.00    0.00    7.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
vdf               0.00     0.00    0.00  511.00     0.00     0.00     0.00     0.05    0.09   0.09   4.60
vdg               0.00     0.00    0.00  511.00     0.00     0.00     0.00     0.05    0.09   0.09   4.80
dm-0              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-1              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-2              0.00     0.00    0.00   34.00     0.00     0.23    13.65     0.02    0.59   0.38   1.30
dm-3              0.00     0.00    0.00 2144.00     0.00     8.38     8.00     1.40    0.65   0.45  97.20
dm-4              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00
dm-5              0.00     0.00    0.00    0.00     0.00     0.00     0.00     0.00    0.00   0.00   0.00

2、dm3是relay log 和binlog分區(qū)
$ ls -l /dev/mapper
total 0
lrwxrwxrwx 1 root root      7 Jul 23 23:20 backup-backup -> ../dm-0
crw-rw---- 1 root root 10, 58 Jul 23 23:20 control
lrwxrwxrwx 1 root root      7 Jul 23 23:20 VG00-lv_root -> ../dm-4
lrwxrwxrwx 1 root root      7 Jul 23 23:20 zxmysql-zxdba -> ../dm-1
lrwxrwxrwx 1 root root      7 Jul 23 23:20 zxmysql-zxlog -> ../dm-3

3、slave狀態(tài)
mysql> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State: Queueing master event to the relay log
                略.........................................
                Connect_Retry: 60
              Master_Log_File: mysql-bin.011494
          Read_Master_Log_Pos: 21037034
               Relay_Log_File: relay-log.001904
                Relay_Log_Pos: 3154097
        Relay_Master_Log_File: mysql-bin.011494
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           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: 3153884
              Relay_Log_Space: 21037535
              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: 471
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: 400011
                  Master_UUID: 0f8507ea-6da1-11e8-8646-005056873c4a
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Reading event from the relay log
           Master_Retry_Count: 86400
                  Master_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 0f8507ea-6da1-11e8-8646-005056873c4a:14137114-19288497
            Executed_Gtid_Set: 0f8507ea-6da1-11e8-8646-005056873c4a:1-19288446
                Auto_Position: 1
         Replicate_Rewrite_DB: 
                 Channel_Name: 
           Master_TLS_Version: 
1 row in set (0.01 sec)

ERROR: 
No query specified

三、分析
通過以上現(xiàn)象發(fā)現(xiàn)備庫io使用率過高,超過90%。io過高的磁盤為日志盤,存放relay log和binlog。io thead一致在寫relay log,調(diào)用fdatasync寫磁盤。這里涉及到一個參數(shù)sync_relay_log,默認(rèn)值為10000,查看當(dāng)前系統(tǒng)參數(shù)值為1.

四、解決方案
優(yōu)化io thread線程和sql thread線程。sync_relay_log使用默認(rèn)值,使用mts優(yōu)化sql thread。

stop slave;
set global slave_parallel_type=logical_clock;
set global slave_parallel_workers=8;
set global sync_master_info=10000;
set global sync_relay_log=10000;
set global sync_relay_log_info=10000;
start slave;

網(wǎng)站標(biāo)題:MySQL5.7復(fù)制延遲之sync_relay_log-創(chuàng)新互聯(lián)
當(dāng)前地址:http://www.rwnh.cn/article18/ddcsgp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號、全網(wǎng)營銷推廣、網(wǎng)站營銷、用戶體驗、靜態(tài)網(wǎng)站網(wǎng)站設(shè)計公司

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

微信小程序開發(fā)
仪征市| 东乡| 修文县| 南雄市| 万盛区| 微博| 宜良县| 北安市| 古丈县| 黄梅县| 视频| 房产| 建湖县| 偏关县| 盖州市| 屯留县| 嵊州市| 新密市| 莆田市| 桂东县| 玛纳斯县| 凤城市| 黑河市| 北海市| 宝丰县| 嘉善县| 白朗县| 呼和浩特市| 灌阳县| 紫阳县| 柳河县| 遂溪县| 交口县| 宜兰县| 南京市| 合阳县| 田林县| 文山县| 文昌市| 隆化县| 夏邑县|