码迷,mamicode.com
首页 > 其他好文 > 详细

Redis集群启动脚本

时间:2018-11-20 01:18:28      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:dump   redis   window下   clu   分享图片   dump.rdb   5.0   end   rm -rf   

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格式

Redis集群启动脚本

标签:dump   redis   window下   clu   分享图片   dump.rdb   5.0   end   rm -rf   

原文地址:https://www.cnblogs.com/isxt/p/9986734.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!