标签:直连 分享 c89 usr ace 脚本 cluster 技术分享 不能
搭建集群脚本
#/bin/bash
/usr/local/bin/redis-server /usr/local/redis-cluster/30001/redis.conf
/usr/local/bin/redis-server /usr/local/redis-cluster/30002/redis.conf
/usr/local/bin/redis-server /usr/local/redis-cluster/30003/redis.conf
/usr/local/bin/redis-server /usr/local/redis-cluster/30004/redis.conf
/usr/local/bin/redis-server /usr/local/redis-cluster/30005/redis.conf
/usr/local/bin/redis-server /usr/local/redis-cluster/30006/redis.conf
/usr/local/redis-4.0.2/src/redis-trib.rb create --replicas 1 127.0.0.1:30001 127.0.0.1:30002 127.0.0.1:30003 127.0.0.1:30004 127.0.0.1:30005 127.0.0.1:30006
新增节点
/usr/local/redis-4.0.2/src/redis-trib.rb add-node 127.0.0.1:30007 127.0.0.1:30001
但还不能使用,要激活
/usr/local/redis-4.0.2/src/redis-trib.rb reshard 127.0.0.1:30001
1、tw是一层代理,对外提供一个VIP;cluster是与后端节点直连
2、tw不可平滑扩容(期间会丢部分key),cluster可以(期间会移动slot,客户端透明无感知);
redis cluster VS tw
标签:直连 分享 c89 usr ace 脚本 cluster 技术分享 不能
原文地址:https://www.cnblogs.com/markwave/p/9133300.html