redis中的flushall导致loading the dataset in memory错误
Flushall in redis leads to loading the dataset in memory error
在这种情况下,如何在 Redis 中“FLUSHALL”?
运行 redis via docker on PopOs 21.0.4 如下图docker-compose.yml
version: "2.4"
services:
redis:
image: redis:5-alpine
command: redis-server --save "" --appendonly yes
restart: always
volumes:
- "${PWD}//redis/data:/data"
ports:
- "6379:6379"
连接到 redis-cli 并发出 FLUSHALL(或 FLUSHDB)命令,我收到错误:
127.0.0.1:6379[1]> FLUSHALL
(error) LOADING Redis is loading the dataset in memory
这里是 docker 版本:
Client: Docker Engine - Community
Version: 20.10.10
API version: 1.41
Go version: go1.16.9
Git commit: b485636
Built: Mon Oct 25 07:43:13 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.10
API version: 1.41 (minimum version 1.12)
Go version: go1.16.9
Git commit: e2f740d
Built: Mon Oct 25 07:41:20 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.11
GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
该错误消息表示 Redis 仍在加载数据,即在您的情况下为 AOF 文件。在加载完成之前,您不能 运行 FLUSHALL
。
如果不需要加载数据,可以在启动Redis前删除AOF文件
在这种情况下,如何在 Redis 中“FLUSHALL”?
运行 redis via docker on PopOs 21.0.4 如下图docker-compose.yml
version: "2.4"
services:
redis:
image: redis:5-alpine
command: redis-server --save "" --appendonly yes
restart: always
volumes:
- "${PWD}//redis/data:/data"
ports:
- "6379:6379"
连接到 redis-cli 并发出 FLUSHALL(或 FLUSHDB)命令,我收到错误:
127.0.0.1:6379[1]> FLUSHALL
(error) LOADING Redis is loading the dataset in memory
这里是 docker 版本:
Client: Docker Engine - Community
Version: 20.10.10
API version: 1.41
Go version: go1.16.9
Git commit: b485636
Built: Mon Oct 25 07:43:13 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.10
API version: 1.41 (minimum version 1.12)
Go version: go1.16.9
Git commit: e2f740d
Built: Mon Oct 25 07:41:20 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.11
GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
该错误消息表示 Redis 仍在加载数据,即在您的情况下为 AOF 文件。在加载完成之前,您不能 运行 FLUSHALL
。
如果不需要加载数据,可以在启动Redis前删除AOF文件