正确关闭Redis

1.首先关闭单机版

我的单机版 是放在redis文件夹下面的

首先你要启动你的单机版redis

直接shutdown

quit 退出去

ps aux|grep redis 查看运行的redis

关闭集群我们可以写一个脚本来关闭,而不用一个一个去关闭

[root@localhost redis-cluster]# vim shutdown.sh

redis01/redis-cli -p 7001 shutdownredis02/redis-cli -p 7002 shutdownredis03/redis-cli -p 7003 shutdownredis04/redis-cli -p 7004 shutdownredis05/redis-cli -p 7005 shutdownredis06/redis-cli -p 7006 shutdown~

然后把shoutdowm变成可执行文件

[root@localhost redis-cluster]# chmod +x shutdown.sh[root@localhost redis-cluster]# ll

执行 ./shutdown.sh