配置文件
配置文件不区分大小写
# 端口设置
port 6379
# 以守护进程开启(后台运行)
daemonize yes
# 日志级别
# 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
# 日志文件位置
# Specify the log file name. Also the empty string can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
logfile ""
# 数据数量
# Set the number of databases. The default database is DB 0, you can select
# a different one on a per-connection basis using SELECT <dbid> where
# dbid is a number between 0 and 'databases'-1
databases 16
# 密码设置
# IMPORTANT NOTE: starting with Redis 6 "requirepass" is just a compatibility
# layer on top of the new ACL system. The option effect will be just setting
# the password for the default user. Clients will still authenticate using
# AUTH <password> as usually, or more explicitly with AUTH default <password>
# if they follow the new protocol: both will work.
#
# The requirepass is not compatable with aclfile option and the ACL LOAD
# command, these will cause requirepass to be ignored.
#
# requirepass foobared
# 可以使用命令设置
# config set requirepass "123456"
# 查看
# config get requirepass
# 验证权限
# auth 123456
# 最大客户端连接数
# maxclients 10000
# 最大内存值
# maxmemory <bytes>
持久化相关配置
# 如果3600s内进行了1次修改,进行持久化
# save 3600 1
# 如果300s内进行了100次修改,进行持久化
# save 300 100
# 如果60s内进行了10000次修改,进行持久化
# save 60 10000
# 持久化出错,是否需要继续工作
# However if you have setup your proper monitoring of the Redis server
# and persistence, you may want to disable this feature so that Redis will
# continue to work as usual even if there are problems with disk,
# permissions, and so forth.
stop-writes-on-bgsave-error yes
# 是否压缩rdb文档,需要消耗一些CPU资源
# Compress string objects using LZF when dump .rdb databases?
# By default compression is enabled as it's almost always a win.
# If you want to save some CPU in the saving child set it to 'no' but
# the dataset will likely be bigger if you have compressible values or keys.
rdbcompression yes
# 保存rdb文件时进行错误的检查校验
# RDB files created with checksum disabled have a checksum of zero that will
# tell the loading code to skip the check.
rdbchecksum yes
# rdb文件位置
# Note that you must specify a directory here, not a file name.
dir ./