问题描述
我希望在服务器运行时将 maxmemory
数量和 maxmemory-policy
更改为 allkeys-lru
基于 对此.我将首先通过以下方式执行此操作:
I'm looking to change the maxmemory
amount and the maxmemory-policy
to allkeys-lru
while the server is running based on this. I'm going to do this first via:
$ redis-cli
> SET CONFIG maxmemory xxxxxxxxx
> SET CONFIG maxmemory-policy allkeys-lru
然后在看到它以预期的方式工作后,即驱逐密钥直到它的大小下降到 xxxxxxxxx
字节,我将更改配置文件.当我们在主从配置中运行它时,根据我在主从配置中更改此配置的顺序,是否会出现任何问题?
Then after seeing that it works in an expected way, i.e. evicts keys until it's size drops to xxxxxxxxx
bytes, I will change the config file. When we are running this in a master slave configuration, is there any issues that can occur based on the order I change this config in the master and the slave?
推荐答案
哎哟.也许 rdb-tools 适用于该版本...您可以识别不需要的键并编写删除脚本.无论如何,您确实需要升级您的 Redis 版本并进行一些数据内务处理.
Ouch. Perhaps rdb-tools works with that version... You can identify the keys that you don't need and script a deletion. Regardless, you really need to upgrade your Redis version and do some data housekeeping.
这篇关于Redis - 在主从关系中动态使用 CONFIG SET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!