# Note on units: when memory size is needed, it is possible to specifiy # it in the usual form of 1k 5GB 4M and so forth: # # 1k => 1000 bytes # 1kb => 1024 bytes # 1m => 1000000 bytes # 1mb => 1024*1024 bytes # 1g => 1000000000 bytes # 1gb => 1024*1024*1024 bytes # # units are case insensitive so 1GB 1Gb 1gB are all the same.
可以使用的单位,不区分大小写
包含
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# Include one or more other config files here. This is useful if you # have a standard template that goes to all Redis servers but also need # to customize a few per-server settings. Include files can include # other files, so use this wisely. # # Note that option "include" won't be rewritten by command "CONFIG REWRITE" # from admin or Redis Sentinel. Since Redis always uses the last processed # line as value of a configuration directive, you'd better put includes # at the beginning of this file to avoid overwriting config change at runtime. # # If instead you are interested in using includes to override configuration # options, it is better to use include as the last line. # # include /path/to/local.conf # include /path/to/other.conf
类似于我们的mybatis和其他的类似于jsp的include标签,目的就是把他们连在一起;
网络配置
1 2 3
bind 127.0.0.1 protected-mode yes port 6379
通用配置
1 2
daemonize no #是否是守护进程 pidfile /var/run/redis_6379.pid #如果是后台进程,那么就需要有这个配置文件
日志配置
1 2 3 4 5 6 7 8 9 10 11
# 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 日志的类型
1 2 3 4 5 6 7 8 9
# 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
对数据进行持久化的一种策略防止数据丢失 save 900 1 #如果再900s内至少有一个key被修改,那么就保存到持久化 save 300 10 #如果再300s内,至少有10个key被修改,他就会进行持久化操作 save 60 10000 #如果再60s内,有10000个key被修改,那么就是进行持久化操作