From 7af22453bad2e5604a46c190c123c4f289b05b54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Tue, 23 Nov 2021 20:19:51 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0=20redis.conf=20?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E7=AD=96=E7=95=A5=20aof=20=E4=B8=8E=20rdb=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/docker/docker-compose.yml | 4 ++-- script/docker/redis/redis.conf | 25 ++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/script/docker/docker-compose.yml b/script/docker/docker-compose.yml index c738a251..37828238 100644 --- a/script/docker/docker-compose.yml +++ b/script/docker/docker-compose.yml @@ -66,8 +66,8 @@ services: # 配置文件 - /docker/redis/conf:/redis/config:rw # 数据文件 - - /docker/redis/data:/redis/data:rw - command: "redis-server /redis/config/redis.conf --appendonly yes" + - /docker/redis/data/:/redis/data/:rw + command: "redis-server /redis/config/redis.conf" privileged: true restart: always networks: diff --git a/script/docker/redis/redis.conf b/script/docker/redis/redis.conf index 213e9ba9..7d550e14 100644 --- a/script/docker/redis/redis.conf +++ b/script/docker/redis/redis.conf @@ -1,2 +1,25 @@ # redis 密码 -# requirepass 123456 \ No newline at end of file +# requirepass ruoyi123 + +# 配置持久化文件存储路径 +dir /redis/data +# 配置rdb +# 15分钟内有至少1个key被更改则进行快照 +save 900 1 +# 5分钟内有至少10个key被更改则进行快照 +save 300 10 +# 1分钟内有至少10000个key被更改则进行快照 +save 60 10000 +# 开启压缩 +rdbcompression yes +# rdb文件名 用默认的即可 +dbfilename dump.rdb + +# 开启aof +appendonly yes +# 文件名 +appendfilename "appendonly.aof" +# 持久化策略,no:不同步,everysec:每秒一次,always:总是同步,速度比较慢 +# appendfsync always +appendfsync everysec +# appendfsync no