需求:将redis内存从1G扩展到3G,不中断服务
1、打开客户端
# redis-cli -p 6391
2、查看当前值
redis 127.0.0.1:6391> config get maxmemory
1) "maxmemory"
2) "1073741824"
3、设置内存为3G
redis 127.0.0.1:6391> config set maxmemory 3221225472
4、查看修改后的值
redis 127.0.0.1:6391> config get maxmemory
1) "maxmemory"
2) "3221225472"
5、修改配置文件,让配置重启有效
# vim /nh/redis/6391/conf/redis.conf
maxmemory 3221225472