flushdb 没有清除redis 中的所有键? [英] flushdb not clear all keys in redis?

查看:73
本文介绍了flushdb 没有清除redis 中的所有键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我运行 redis SHELL 命令 flushdb 后,似乎还有一些键,

It seems there are still some keys left after i ran redis SHELL command flushdb,

这些键的用途是什么,为什么 flushdb 不起作用?

what are these keys used for and why flushdb does not work?

推荐答案

当 Redis 运行 flushdb 命令时,它会阻止对数据库的任何新写入,并刷新数据库中的所有键.但是,当Redis执行完flushdb命令后,它可以接收新的写入,即其他Redis客户端可以将新的key放入数据库中.

When Redis runs flushdb command, it blocks any new writings to the database, and flushes all keys in the database. However, when Redis finishes the flushdb command, it can receive new writings, i.e. other Redis client can put new keys into the database.

就您而言,我认为还有其他客户端不断写入数据库.因此,在您刷新数据库后,其他客户端会将新密钥放入 Redis.

In your case, I think there're other clients constantly writing to the database. So after you flush the database, new keys are put into Redis by other clients.

如果你想停止任何进一步的写入,你必须关闭Redis服务器.

If you want to stop any further writing, you have to shutdown Redis server.

这篇关于flushdb 没有清除redis 中的所有键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆