redis鎵鏈夌殑鏁版嵁淇濆瓨鍦ㄥ唴瀛樹腑锛屽鏁版嵁鐨勬洿鏂板皢寮傛鍦颁繚瀛樺湪纭洏涓
redis鍦ㄧ‖鐩樹笂鍒涘缓涓涓簩杩涘埗鐨剅db鏂囦欢锛宺edis鍚姩鏃朵細鎶婅繖涓猺db鏂囦欢杞藉叆鍒板唴瀛樹腑
鑷姩
閫氳繃閰嶇疆鑷姩鐢熸垚RDB鏂囦欢锛岃揪鍒版煇涓潯浠跺氨浼氶氳繃bgsave鐢熸垚RDB浜岃繘鍒舵枃浠
閰嶇疆 | seconds | changes |
---|---|---|
save | 900 | 1 |
save | 300 | 10 |
save | 60 | 10000 |
##涓嶇敤save
dbfilename dump-${port}.rdb
dir /bigdiskpath ##姣旇緝澶х殑纭洏
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecknum yes
鍏ㄩ噺澶嶅埗
debug reload
shutdown
鏃堕棿鎴 | save |
---|---|
t1 | 鎵ц澶氫釜鍐欏懡浠 |
t2 | 婊¤冻RDB鑷姩鍒涘缓鐨勬潯浠 |
t3 | 鍐嶆鎵ц澶氫釜鍐欏懡浠 |
t4 | 瀹曟満 |
灏辨槸姣忔墽琛屼竴涓懡浠わ紝灏卞搴旂殑鍛戒护璁板綍鍒癆OF閲岄潰锛屽鏋滃畷鏈猴紝灏变粠aof閲岄潰鎭㈠
bgrewriteaof
aof閲嶅啓閰嶇疆
閰嶇疆鍚 | 鍚箟 |
---|---|
auto-aof-rewrite-min-size | aof鏂囦欢閲嶅啓闇瑕佺殑灏哄 |
auto-aof-rewrite-percentage | aof鏂囦欢澧為暱鐜 |
缁熻鍚 | 鍚箟 |
---|---|
aof_current_size | aof褰撳墠灏哄(瀛楄妭) |
aof_base_size | aof涓婃鍚姩鍜岄噸鍐欑殑灏哄(瀛楄妭) |
鑷姩瑙﹀彂鏃舵満
aof_current_size > auto-aof-rewrite-min-size
aof_current_size – aof_base_size/aof_base_size>auto-aof-rewrite-percentage
閰嶇疆
appendonly yes
appendfilename "appendonly-${port}.aof"
appendfsync everysec
dir /bigdiskpath
no-appendfsync-on-rewrite yes
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
鍛戒护 | RDB | AOF |
---|---|---|
鍚姩浼樺厛绾 | 浣 | 楂 |
浣撶Н | 灏 | 澶 |
鎭㈠閫熷害 | 蹇 | 鎱 |
鏁版嵁瀹夊叏鎬 | 涓㈡暟鎹 | 鏍规嵁绛栫暐鍐冲畾 |
杞婚噸 | 閲 | 杞 |
鍙戣〃鍥炲