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