From 8d57ff28b5f44b644bad00d7d69aae45e922902a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=A1=E4=BA=BA=E5=9C=A8=E5=AE=B6=E8=AF=B7=E6=8C=89?= =?UTF-8?q?=E9=97=A8=E9=93=83?= <50700061+GAted0@users.noreply.github.com> Date: Mon, 8 Jun 2026 18:59:28 +0800 Subject: [PATCH] Refactor Redis configuration settings --- redis/conf/redis.conf | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/redis/conf/redis.conf b/redis/conf/redis.conf index 0445e57..67fcefb 100644 --- a/redis/conf/redis.conf +++ b/redis/conf/redis.conf @@ -1,30 +1,27 @@ -# Redis 服务端口号 +# 网络 +bind 0.0.0.0 port 6379 -# 绑定的 IP 地址,如果需要公开访问,请设置为 0.0.0.0 -bind 0.0.0.0 + +# 认证 +requirepass YourStrongPassword # 数据目录 -dir /data/ +dir /data -# 设置数据库数量,默认为 16 个数据库 -databases 16 -# 持久化配置 - -# 是否开启持久化,默认为 no +# RDB 快照 save 900 1 save 300 10 save 60 10000 -# 是否开启 AOF 持久化,默认为 no +# AOF 持久化 appendonly yes - -# AOF 文件名 -appendfilename "appendonly.aof" - -# AOF 同步方式 appendfsync everysec + +# 内存限制(按需修改) +maxmemory 2gb +maxmemory-policy allkeys-lru