1.安装redis5.x版本
2.配置文件修改,以7001节点为例
bash
bind 127.0.0.1
# 关闭保护模式,可以公网访问
protected-mode no
# 端口号
port 7001
# 启动cluster
cluster-enabled yes
# 当前节点的集群信息
cluster-config-file nodes-7001.conf
# 连接超时
cluster-node-timeout 5000
# 是否在每次更新操作后进行日志记录
appendonly yes
# windows前台启动
daemonize no
# redis节点密码,所有节点应当一样
requirepass 123456
# 连接主节点密码
masterauth 123456
# 目录
dir D:/install/Redis/cluster/7001/
3.启动7001-7006 (替换7001)
redis-server.exe D:\install\Redis\cluster\7001\redis.conf
4.启动集群 注意 -a 是密码
redis-cli --cluster create -a 123456 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006 --cluster-replicas 1
参考
1.https://blog.csdn.net/u013737132/article/details/133410293
2.https://www.cnblogs.com/LiShuaiForAll/p/19145888
3.密码,hash槽出错:https://blog.csdn.net/key_768/article/details/108018584