1、 redis.conf
#分別修改埠為6001…6006
port 6001
#修改繫結ip地址為本機實際網路ip地址,不支援繫結網路
#bind 127.0.0.1
#bind xxxxxx
#啟用叢集模式
cluster-enabled yes
#nodes-6003.conf…nodes-6006.conf
cluster-config-file nodes-6001.conf
cluster-node-timeout 5000
#超時時間appendonly yes
daemonize yes
#後臺執行
protected-mode no
2、啟動
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6001/redis.conf
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6002/redis.conf
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6003/redis.conf
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6004/redis.conf
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6005/redis.conf
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6006/redis.conf
3、建立叢集
/home/app/redis5/src/redis-cli --cluster create 網路ip:6001 網路ip:6002 網路ip:6003 網路ip:6004 網路ip:6005 網路ip:6006 --cluster-replicas 1
4、修改內網ip為網路ip
停止服務,將nodes-6001.conf中存在的內網ip修改為網路ip;
重啟
1、 redis.conf
#分別修改埠為6001…6006
port 6001
#修改繫結ip地址為本機實際網路ip地址,不支援繫結網路
#bind 127.0.0.1
#bind xxxxxx
#啟用叢集模式
cluster-enabled yes
#nodes-6003.conf…nodes-6006.conf
cluster-config-file nodes-6001.conf
cluster-node-timeout 5000
#超時時間appendonly yes
daemonize yes
#後臺執行
protected-mode no
2、啟動
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6001/redis.conf
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6002/redis.conf
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6003/redis.conf
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6004/redis.conf
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6005/redis.conf
/usr/local/redis5/bin/redis-server /usr/local/redis5/redis-cluster-conf/6006/redis.conf
3、建立叢集
/home/app/redis5/src/redis-cli --cluster create 網路ip:6001 網路ip:6002 網路ip:6003 網路ip:6004 網路ip:6005 網路ip:6006 --cluster-replicas 1
4、修改內網ip為網路ip
停止服務,將nodes-6001.conf中存在的內網ip修改為網路ip;
重啟