redis版本:redis-5.0.0
Centos: centos 7 64位
#!/bin/bash
redis_path="/usr/local/cluster/"
cluster_num=`ps aux | grep redis | wc -l`
if [ "${cluster_num}" -le 0 ]
then
echo -e "===== Success: Has killed all cluster progress."
else
pkill -9 redis
fi
cd ${redis_path}
rm -rf ${redis_path}700*/appendonly.aof
rm -rf ${redis_path}700*/dump.rdb
rm -rf ${redis_path}700*/nodes*
rm -rf ${redis_path}nodes*
rm -rf ${redis_path}appendonly.aof
cd /usr/local/cluster/7000/
redis-server /usr/local/cluster/7000/redis.conf
cd /usr/local/cluster/7001/
redis-server /usr/local/cluster/7001/redis.conf
cd /usr/local/cluster/7002/
redis-server /usr/local/cluster/7002/redis.conf
cd /usr/local/cluster/7003/
redis-server /usr/local/cluster/7003/redis.conf
cd /usr/local/cluster/7004/
redis-server /usr/local/cluster/7004/redis.conf
cd /usr/local/cluster/7005/
redis-server /usr/local/cluster/7005/redis.conf
如果在window下编写,建议使用Notepad++保存为UNIX格式
原文地址:https://www.cnblogs.com/isxt/p/9986734.html
时间: 2024-11-05 18:28:55