中文字幕第五页-中文字幕第页-中文字幕韩国-中文字幕最新-国产尤物二区三区在线观看-国产尤物福利视频一区二区

redis重做從庫時報Connectionwithmasterlost錯誤

背景:之前同事初始化redis實例的時候把monitor命令給rename了,今天剛好這組實例有問題需要通過monitor命令來幫助分析問題,結(jié)果發(fā)現(xiàn)monitor命令用不了,因為redis命令重命名不支持動態(tài)修改,于是就想刪除monitor命令后趕快重啟redis從庫。重啟完后,發(fā)現(xiàn)主從復制狀態(tài)一直處于down的狀態(tài),于是開始排查問題

站在用戶的角度思考問題,與客戶深入溝通,找到南豐網(wǎng)站設計與南豐網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗,讓設計與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個性化、用戶體驗好的作品,建站類型包括:成都做網(wǎng)站、網(wǎng)站建設、外貿(mào)營銷網(wǎng)站建設、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣、域名注冊網(wǎng)站空間、企業(yè)郵箱。業(yè)務覆蓋南豐地區(qū)。

先看redis從庫的日志:

43037:S 20 Apr 06:12:38.047 MASTER <-> SLAVE sync started
43037:S 20 Apr 06:12:38.047
Non blocking connect for SYNC fired the event.
43037:S 20 Apr 06:12:38.048 Master replied to PING, replication can continue...
43037:S 20 Apr 06:12:38.048
Partial resynchronization not possible (no cached master)
43037:S 20 Apr 06:12:39.112 Full resync from master: 96f2ae75d50e1f8b69737509d5b32b2da660e7c0:885061114038
43037:S 20 Apr 06:19:16.258
MASTER <-> SLAVE sync: receiving 20819568576 bytes from master
43037:S 20 Apr 06:20:08.203 MASTER <-> SLAVE sync: Flushing old data
43037:S 20 Apr 06:24:36.036
MASTER <-> SLAVE sync: Loading DB in memory
43037:S 20 Apr 06:28:18.538 MASTER <-> SLAVE sync: Finished with success
43037:S 20 Apr 06:28:19.782
Background append only file rewriting started by pid 173002
43037:S 20 Apr 06:28:19.982 # Connection with master lost.
43037:S 20 Apr 06:28:19.982 Caching the disconnected master state.
43037:S 20 Apr 06:28:20.984
Connecting to MASTER 10.93.157.52:6385
43037:S 20 Apr 06:28:20.985 MASTER <-> SLAVE sync started
43037:S 20 Apr 06:28:20.985
Non blocking connect for SYNC fired the event.
43037:S 20 Apr 06:28:20.985 Master replied to PING, replication can continue...
43037:S 20 Apr 06:28:20.986
Trying a partial resynchronization (request 96f2ae75d50e1f8b69737509d5b32b2da660e7c0:885062375607).
43037:S 20 Apr 06:28:22.073 Full resync from master: 96f2ae75d50e1f8b69737509d5b32b2da660e7c0:885240485270
43037:S 20 Apr 06:28:22.073
Discarding previously cached master state.
43037:S 20 Apr 06:33:30.800 # Timeout receiving bulk data from MASTER... If the problem persists try to set the 'repl-timeout' parameter in redis.conf to a larger value.
43037:S 20 Apr 06:33:30.801 Connecting to MASTER 10.93.157.52:6385
43037:S 20 Apr 06:33:30.802
MASTER <-> SLAVE sync started
43037:S 20 Apr 06:33:30.802 Non blocking connect for SYNC fired the event.
43037:S 20 Apr 06:33:30.802
Master replied to PING, replication can continue...
43037:S 20 Apr 06:33:30.803 Partial resynchronization not possible (no cached master)
43037:S 20 Apr 06:34:27.458
AOF rewrite child asks to stop sending diffs.
173002:C 20 Apr 06:34:27.470 Parent agreed to stop sending diffs. Finalizing AOF...
173002:C 20 Apr 06:34:27.470
Concatenating 1.19 MB of AOF diff received from parent.
173002:C 20 Apr 06:34:27.477 SYNC append only file rewrite performed
173002:C 20 Apr 06:34:28.757
AOF rewrite: 119 MB of memory used by copy-on-write
43037:S 20 Apr 06:34:29.961 Background AOF rewrite terminated with success
43037:S 20 Apr 06:34:29.961
Residual parent diff successfully flushed to the rewritten AOF (0.00 MB)
43037:S 20 Apr 06:34:29.961 Background AOF rewrite finished successfully
43037:S 20 Apr 06:35:08.471
Full resync from master: 96f2ae75d50e1f8b69737509d5b32b2da660e7c0:885393456775
43037:S 20 Apr 06:41:49.489 MASTER <-> SLAVE sync: receiving 20821399746 bytes from master
43037:S 20 Apr 06:42:28.911 # I/O error trying to sync with MASTER: connection lost
43037:S 20 Apr 06:42:32.642
Connecting to MASTER 10.93.157.52:6385
43037:S 20 Apr 06:42:32.646 MASTER <-> SLAVE sync started
43037:S 20 Apr 06:42:32.646
Non blocking connect for SYNC fired the event.
43037:S 20 Apr 06:42:32.647 Master replied to PING, replication can continue...
43037:S 20 Apr 06:42:32.647
Partial resynchronization not possible (no cached master)
43037:S 20 Apr 06:42:33.755 Full resync from master: 96f2ae75d50e1f8b69737509d5b32b2da660e7c0:885541422071
43037:S 20 Apr 06:49:15.956
MASTER <-> SLAVE sync: receiving 20821403571 bytes from master
43037:S 20 Apr 06:50:16.781 MASTER <-> SLAVE sync: Flushing old data
43037:S 20 Apr 06:54:23.078
MASTER <-> SLAVE sync: Loading DB in memory
43037:S 20 Apr 06:58:10.123 MASTER <-> SLAVE sync: Finished with success
43037:S 20 Apr 06:58:11.317
Background append only file rewriting started by pid 223387
43037:S 20 Apr 06:58:11.536 # Connection with master lost.
43037:S 20 Apr 06:58:11.536 * Caching the disconnected master state.

再來看一下redis主庫的日志:

304369:M 20 Apr 05:13:00.197 Slave 10.93.157.16:6383 asks for synchronization
304369:M 20 Apr 05:13:00.197
Full resync requested by slave 10.93.157.16:6383
304369:M 20 Apr 05:13:00.197 Starting BGSAVE for SYNC with target: disk
304369:M 20 Apr 05:13:00.902
Background saving started by pid 366254
366254:C 20 Apr 05:19:14.460 DB saved on disk
366254:C 20 Apr 05:19:14.961
RDB: 4613 MB of memory used by copy-on-write
304369:M 20 Apr 05:19:15.579 Background saving terminated with success
304369:M 20 Apr 05:20:18.303
Synchronization with slave 10.93.157.16:6383 succeeded
304369:M 20 Apr 05:22:32.216 # Client id=1768461 addr=10.93.157.16:26912 fd=10 name= age=572 idle=0 flags=S db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=11450 omem=278945640 events=rw cmd=psync scheduled to
be closed ASAP for overcoming of output buffer limits.
304369:M 20 Apr 05:22:32.216 # Connection with slave 10.93.157.16:6383 lost.
304369:M 20 Apr 05:28:27.651 Slave 10.93.157.16:6383 asks for synchronization
304369:M 20 Apr 05:28:27.651
Unable to partial resync with slave 10.93.157.16:6383 for lack of backlog (Slave request was: 884116305579).
304369:M 20 Apr 05:28:27.651 Starting BGSAVE for SYNC with target: disk
304369:M 20 Apr 05:28:28.356
Background saving started by pid 396084
304369:M 20 Apr 05:32:37.471 # Client id=1768945 addr=10.93.157.16:21854 fd=22 name= age=250 idle=250 flags=S db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=16366 oll=11126 omem=271085384 events=r cmd=psync scheduled to
be closed ASAP for overcoming of output buffer limits.
304369:M 20 Apr 05:32:37.538 # Connection with slave 10.93.157.16:6383 lost.

從日志中我們可以看到在redis主庫在接到從庫要求重新同步數(shù)據(jù)的時候先生成一個rdb文件,再通過psync來做部分同步,可以看到問題就出在部分同步這一塊,由于client-output-buffer-limit值設置太小,導致導數(shù)發(fā)送失敗。失敗后,從庫繼續(xù)發(fā)起數(shù)據(jù)同步的請求,但是每次都失敗,redis主庫反復地生成rdb文件,雖然是有fork一個子進程,但是對redis主庫的吞吐量是有一定影響的。

現(xiàn)在我們來解決這個問題,先看一下目前 client-output-buffer-limit的大?。?br/>127.0.0.1:6385> config get client-output-buffer-limit
1) "client-output-buffer-limit"
2) "normal 0 0 0 slave 268435456 67108864 60 pubsub 33554432 8388608 60"
可以看到,目前的限制是最大256M和60s內(nèi)不超過64M,從我們上面日志信息可以看到psync的數(shù)據(jù)明顯是大于256M的。我們進行如下設置把很限制調(diào)大:
config set client-output-buffer-limit 'slave 1073741824 268435456 60'
調(diào)完后再觀察,發(fā)現(xiàn)從庫的的復制狀態(tài)很快就變成了up。
我們上面的調(diào)整是加大復制輸出緩沖區(qū),還有一個辦法就是關閉復制輸出緩沖區(qū)的限制:
config set client-output-buffer-limit 'slave 0 0 0'

標題名稱:redis重做從庫時報Connectionwithmasterlost錯誤
文章URL:http://m.2m8n56k.cn/article14/pshege.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供建站公司、網(wǎng)站策劃、微信小程序網(wǎng)站排名、自適應網(wǎng)站、網(wǎng)站改版

廣告

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

商城網(wǎng)站建設
主站蜘蛛池模板: 99久热在线精品视频播放6 | 1024香蕉国产在线视频 | 亚洲日本va午夜中文字幕一区 | 久久精品国产影库免费看 | 美女视频黄a视频美女大全 美女视频黄a视频免费全程 | 久久综合给合久久狠狠狠97色69 | 毛片视频免费观看 | 国产国产成人精品久久 | 亚洲在线免费免费观看视频 | 97欧美精品一区二区三区 | 欧美高清一区 | 亚洲精品日韩中文字幕久久久 | 亚洲国产精品综合久久网络 | 正在播放国产大学生情侣 | 无码免费一区二区三区免费播放 | 亚洲网址在线观看 | 国产女人伦码一区二区三区不卡 | 亚洲一级特黄特黄的大片 | 国产日比视频 | 日韩欧美一区二区三区不卡在线 | 午夜看片a福利在线 | 日韩精品观看 | 看真人视频一级毛片 | 一级特黄aaa免费 | 三级黄色毛片网站 | 超清波多野结衣精品一区 | 一男一女的一级毛片 | 亚洲欧美精品中文字幕 | www.亚洲视频 | 国产呦精品一区二区三区网站 | 久久99欧美 | 欧美第一视频 | 自拍偷自拍亚洲精品一区 | 欧美jizzhd极品欧美 | 免费小视频在线观看 | 午夜无遮挡怕怕怕免费视频 | 国产精品日本一区二区在线播放 | 欧美区一区二区三 | 久久手机在线视频 | 在线一区二区观看 | 国产不卡在线播放 |