搭建redis服务器
修改服务运行参数

常用命令常用命令


创建redis集群
准备做集群的主机,不允许存储数据、不允许设置连接密码
配置服务器:

1、在任意一台redis服务器上都可以执行创建集群的命令。
2、--cluster-replicas 1 给每个master服务器分配1台slave服务器,每个主至少要分配1台slave服务器,不然无法实现redis服务的高可用。
3、创建集群时,会自动创建主从角色,默认把主机列表中的前3台服务器创建为
Master角色的redis服务器,剩下的均配置为slave角色服务器。
4、创建集群时,会自动给master角色的主机分配hash槽 ,通过hash槽实现数据的分布式存储。
查看集群信息
第一列:主服务器ip地址
第二列:主服务器ID
第三列:存储变量个数
第四列:hash槽个数 (hash槽的作用在集群存储工程过程里讲)
第五列:从服务器数量

测试集群

命令行连接


测试数据自动备份

测试服务高可用

搭建网站服务器





