master配置以下:(默认6379端口)redis
1 bind 127.0.0.1 2 port 6379 3 timeout 0 4 databases 16
slave1配置以下:(端口6380)ide
1 bind 127.0.0.1 2 port 6380 3 cluster-enabled no 4 slaveof 127.0.0.1 6379 5 timeout 0
slave2配置以下:(端口6381)spa
1 bind 127.0.0.1 2 port 6381 3 cluster-enabled no 4 slaveof 127.0.0.1 6379 5 timeout 0
启动服务:redis-server conf文件路径3d
客户端信息以下:redis-cli -p 端口号 ; info replicationcode
则此时redis cluster的主从配置完毕(其实其余的参数也应该根据实际状况调整,只是此随笔是精简的体现出主从配置重要的参数)server