redis 配置文件aof配置:
bind 127.0.0.1 port 6379 daemonize yes dbfilename dump.rdb dir /new_renpeng/redis/ logfile /new_renpeng/redis/redis-server.log appendonly yes appendfsync everysec auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb appendfilename appendonly.aof dir /new_renpeng/redis/ aof-load-truncated yes
# no-appendfsync-on-rewrite參數, 如果該參數設置為no,是最安全的方式,不會丟失數據,但是要忍受阻塞的問題。如果設置為yes呢?這就相當於將appendfsync設置為no,這說明並沒有執行磁盤操作,只是寫入了緩沖區,因此這樣並不會造# 成阻塞(因為沒有競爭磁盤),但是如果這個時候redis掛掉,就會丟失數據。丟失多少數據呢?在linux的操作系統的默認設置下,最多會丟失30s的數據。
no-appendfsync-on-rewrite no