redis鐨勬寔涔呭寲鍜岄夋嫨

鎸佷箙鍖栫殑浣滅敤

浠涔堟槸鎸佷箙鍖

redis鎵鏈夌殑鏁版嵁淇濆瓨鍦ㄥ唴瀛樹腑锛屽鏁版嵁鐨勬洿鏂板皢寮傛鍦颁繚瀛樺湪纭洏涓

鎸佷箙鍖栧湴鏂瑰紡

redis鍦版寔涔呭寲鍦板彇鑸嶅拰閫夋嫨

RDB

浠涔堟槸RDB

redis鍦ㄧ‖鐩樹笂鍒涘缓涓涓簩杩涘埗鐨剅db鏂囦欢锛宺edis鍚姩鏃朵細鎶婅繖涓猺db鏂囦欢杞藉叆鍒板唴瀛樹腑

瑙﹀彂鏈哄埗- 涓昏涓夌鏂瑰紡

閰嶇疆 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

瑙﹀彂鏈哄埗-涓嶅蹇界暐鏂瑰紡

  1. 鍏ㄩ噺澶嶅埗

  2. debug reload

  3. shutdown

AOF

RDB鐨勯棶棰

鏃堕棿鎴 save
t1 鎵ц澶氫釜鍐欏懡浠
t2 婊¤冻RDB鑷姩鍒涘缓鐨勬潯浠
t3 鍐嶆鎵ц澶氫釜鍐欏懡浠
t4 瀹曟満

AOF杩愯鍘熺悊

灏辨槸姣忔墽琛屼竴涓懡浠わ紝灏卞搴旂殑鍛戒护璁板綍鍒癆OF閲岄潰锛屽鏋滃畷鏈猴紝灏变粠aof閲岄潰鎭㈠

AOF鐨勪笁绉嶇瓥鐣

AOF閲嶅啓

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鍜孉OF鐨勬妷鎷

姣旇緝

鍛戒护 RDB AOF
鍚姩浼樺厛绾
浣撶Н
鎭㈠閫熷害
鏁版嵁瀹夊叏鎬 涓㈡暟鎹 鏍规嵁绛栫暐鍐冲畾
杞婚噸

RDB鐨勬渶浣崇瓥鐣

AOF鐨勬渶浣崇瓥鐣

All posts

Other pages

鍙戣〃璇勮

閭鍦板潃涓嶄細琚叕寮銆 蹇呭~椤瑰凡鐢*鏍囨敞