redis集群启动和关闭脚本

创建startall.sh

/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster/7001/redis.conf
/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster/7002/redis.conf
/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster/7003/redis.conf
/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster/7004/redis.conf
/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster/7005/redis.conf
/usr/local/redis/bin/redis-server /usr/local/redis/redis-cluster/7006/redis.conf

 

创建stopall.sh

/usr/local/redis/bin/redis-cli -c -p 7001 shutdown
/usr/local/redis/bin/redis-cli -c -p 7002 shutdown
/usr/local/redis/bin/redis-cli -c -p 7003 shutdown
/usr/local/redis/bin/redis-cli -c -p 7004 shutdown
/usr/local/redis/bin/redis-cli -c -p 7005 shutdown
/usr/local/redis/bin/redis-cli -c -p 7006 shutdown

 

提示:作为脚本启动,要给脚本指定的权限

 

转载于:https://www.cnblogs.com/116970u/p/11268816.html

你可能感兴趣的:(redis集群启动和关闭脚本)