前言
上几节学习完了Redis的常规操作,这节就深入学习一下Redis的配置文件、RDB、AOF、Redis订阅发布内容了,共同加油!
一、redis.conf 配置文件参数
Redis配置文件涉及到的参数很多,如果英文很好的话,配置文件中都有相应的案例,所以不难理解,但是对于我这种英语起步阶段的话,还是需要对一些重点的参数进行一下整理的
# Note on units: when memory size is needed, it is possible to specify
# 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.
# 这个提示了在配置文件中的单位
################################## INCLUDES ###################################
# 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
# 提示了如何引入其他的配置文件
# 网络
bind * # 绑定可以访问的主机ip,默认是bind 127.0.0.1,只有本机可以访问
protected-mode no # 是否开启保护模式,通常和bind配合使用
port 6379 # 设置端口号
# 通用配置
daemonize yes # 是否后台启动redis,