redis cluster启动脚本

# !/bin/sh

rm -fr /usr/local/cluster/7000/appendonly.aof /usr/local/cluster/7000/nodes-6379.conf
rm -fr /usr/local/cluster/7001/appendonly.aof /usr/local/cluster/7001/nodes-6379.conf
rm -fr /usr/local/cluster/7002/appendonly.aof /usr/local/cluster/7002/nodes-6379.conf
rm -fr /usr/local/cluster/7003/appendonly.aof /usr/local/cluster/7003/nodes-6379.conf
rm -fr /usr/local/cluster/7004/appendonly.aof /usr/local/cluster/7004/nodes-6379.conf
rm -fr /usr/local/cluster/7005/appendonly.aof /usr/local/cluster/7005/nodes-6379.conf

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

/data/bin/cluster/expect_redis_start.sh

 

#!/usr/bin/expect
set timeout 20
spawn /usr/local/redis/bin/redis-trib.rb create --replicas 1 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:70
04 127.0.0.1:7005 expect {
 "(type 'yes' to accept):"
  {
        send "yes\n"
  }
}
expect eof
exit

 加入开机启动

update-rc.d redis_cluster.sh defaults 20

 

你可能感兴趣的:(Liunx,NoSQL)