#GENERAL daemonize No Tcp-backlog 511 timeout 0 tcp-keepalive 0 loglevel notice databases dir/opt/redis/data s Lave-serve-stale-data Yes #slave只读 slave-read-only Yes #not use default Repl-disable-tcp-nodelay Yes Slave-priority 1 #打开aof持久化 appendonly Yes #每秒一次aof写 appendfsync everysec #关闭在aof Rewrite when the new write operation Fsync No-appendfsync-on-rewrite Yes auto-aof-rewrite-min-size 64mb lua-time-limit #打开redis集群 cluster-enabled Yes #节点互连超时的阀值 Cluster-node-timeo UT 15000 cluster-migration-barrier 1 Slowlog-log-slower-than 10000 slowlog-max-len notify-keyspace-events "" Hash -max-ziplist-entries hash-max-ziplist-value list-max-ziplist-entries List-max-ziplist-value set-max-ints Et-entries zset-max-ziplist-entries zset-max-ziplist-value activerehashing Yes client-output-buffer-limit n Ormal 0 0 0 client-output-buffer-limit slave 256mb 64mb client-output-buffer-limit pubsub 32mb 8mb Hz aof-rew Rite-incremental-fsync yEs
#包含通用配置 include/opt/redis/redis-common.conf #监听tcp端口 Port 6379 #最大可用内存 maxmemory 100m # Obsolete policy used when memory is exhausted: # VOLATILE-LRU, remove the key with a expire set using an LRU algorithm # ALLKEYS-LRU-RE Move any key accordingly to the LRU algorithm # volatile-random, remove a random key with an expire set # All Keys-random, remove a random key, any key # Volatile-ttl, remove the key with the nearest expire time (Mino R TTL) # noeviction, don ' t expire at all, just return a error on write operations Maxmemory-policy AllKeys -lru #aof存储文件 appendfilename "appendonly-6379.aof" #不开启rdb存储, only for adding slave procedures dbfilename Dump-6379.rdb #cluster配置文件 (Start auto-generate) cluster-config-file nodes-6379.conf #部署在同一机器的redis实例, Rub the auto-aof-rewrite, because the memory footprint in the cluster environment is basically the same. #防止同意机器下瞬间fork所有redis进程做aof rewrite, takes up a lot of memory (Ps:cluster must turn on aof) auto-aof-rewrite-percentage 80-100
Redis Configuration parameter Description