Redis版本:6.2

配置文件:redis.conf

默认生效配置

# 绑定本机的IP地址,默认bind 127.0.0.1,一个主机多网卡对应多IP
# 只能本机连接,不能绑定本机之外的IP,会导致启动失败,如果注释掉bind 或者 bind 0.0.0.0,则任何IP都可以连接redis
bind 127.0.0.1 -::1

# 保护模式 默认是 yes,用于避免互联网上打开的Redis实例被访问和利用,启用后只允许本机访问
# 启动条件 1.protected-mode yes //开启状态 2.没有bind 配置 3.没有设置密码
protected-mode yes

# 监听端口号,默认是6379
port 6379

# 用于设置客户端等待队列的最大长度
tcp-backlog 511

# 设置客户端闲置多长时间后断开连接,默认为0,表示不超时
timeout 0

# tcp连接保活时长,默认维持300s的长连接。
tcp-keepalive 300

# 是否启用守护进程,启用后可在后台运行,默认是no 不启动,windows版本不支持此功能
daemonize no

# 设置登录密码
requirepass 123456

pidfile /var/run/redis_6379.pid
# 输出的日志等级
loglevel notice
# 要生成的日志文件名称
logfile ""
# 设置的数据库数量,默认是16
databases 16

always-show-logo no
set-proc-title yes
proc-title-template "{title} {listen-addr} {server-mode}"
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
rdb-del-sync-files no
# 设置快照文件和日志文件的存放目录,默认是当前目录
dir ./
replica-serve-stale-data yes
replica-read-only yes
repl-diskless-sync no
repl-diskless-sync-delay 5
repl-diskless-load disabled
repl-disable-tcp-nodelay no
replica-priority 100
acllog-max-len 128
lazyfree-lazy-eviction no
lazyfree-lazy-expire no
lazyfree-lazy-server-del no
replica-lazy-flush no
lazyfree-lazy-user-del no
lazyfree-lazy-user-flush no
oom-score-adj no
oom-score-adj-values 0 200 800
disable-thp yes
appendonly no
appendfilename "appendonly.aof"
appendfsync everysec
no-appendfsync-on-rewrite no
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
stream-node-max-bytes 4096
stream-node-max-entries 100
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit replica 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
dynamic-hz yes
aof-rewrite-incremental-fsync yes
rdb-save-incremental-fsync yes
jemalloc-bg-thread yes

参考文档

redis配置文件redis.conf-CSDN博客

07Redis--config 配置文件_always-show-logo_gh-xiaohe的博客-CSDN博客