pinked

导航

Redis配置文件

Redis配置文件

################################## NETWORK #####################################
bind 127.0.0.1 #绑定的ip
protected-mode yes #保护模式
port 6379 #端口

################################# GENERAL #####################################
daemonize yes #后台运行, 默认是no
pidfile /var/run/redis_6379.pid #后台运行时需要的pid文件

# 日志级别
# Specify the server verbosity level.
# This can be one of:
# debug (a lot of information, useful for development/testing)
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged)
loglevel notice
logfile "" #日志的文件名

databases 16 #默认数据库的数量

################################ SNAPSHOTTING  ################################
# rdb持久化规则
save 900 1 #在900秒内, 至少有1个key发生了变动, 则进行持久化操作
save 300 10
save 60 10000

stop-writes-on-bgsave-error yes #持久化失败后, 是否继续工作

rdbcompression yes #是否压缩rdb文件
rdbchecksum yes #保存rdb文件时, 是否校验
rdb-del-sync-files no #rdb文件是否删除同步锁
dir ./ #drb文件保存目录

################################## SECURITY ###################################
requirepass 123456 #设置密码, 默认无

############################## MEMORY MANAGEMENT ################################
# 在内存达到上限后的处理策略
# volatile-lru:只对设置了过期时间的key进行LRU
# allkeys-lru : 删除lru算法的key   
# volatile-random:随机删除即将过期key   
# allkeys-random:随机删除   
# volatile-ttl : 删除即将过期的   
# noeviction : 永不过期,返回错误
#maxmemory-policy noeviction 默认是noeviction

############################## APPEND ONLY MODE ###############################
# aof持久化规则
appendonly no #是否开启, 默认持久化方式为rdb
appendfilename "appendonly.aof" #aof文件名

# appendfsync always #每次修改同步一次
appendfsync everysec #每秒同步一次
# appendfsync no #从不

posted on 2020-05-17 06:57  pinked  阅读(2017)  评论(0编辑  收藏  举报