redis的集群搭建
步骤:
1.创建一个放集群的文件cluster01,放在/usr/local下面,
放入集群所需要的文件redis-3.0.0.gem,redis-trib.rb

2.复制redis安装包下面的src包作为集群的redis元素,修改里面redis.conf配置文件
a.切换至redis安装包下

b.make 编译当前文件至 /usr/local/cluster01中去,就会自动生成一个bin文件

c.修改bin中的redis.conf配置文件
修改内容:
集群配置的端口号 port
以及可集群性质 cluster enabled yes

d.将bin文件复制成各个集群文件redis9001,redis9002,...redis9006
3.启动集群的各个redis服务,并且利用cluster文件中的redis-trib.rb进行集群管理启动
a.启动集群的各个redis服务

b.切换目录至cluster目录中去,并且启用集群管理

如果出现错误
[ERR] Node 127.0.0.1:9011 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.
解决方案:
重新去redis源码安装包下去复制src,make编译至/usr/local/cluster01下,自动重新生成bin,再重复进行上述操作
4.启动redis9001客户端

集群成功,多个redis集群服务是以端口不同的形式进行集群的