性能与可靠性并重,Flexus X 实例助力 Redis 三主三从集群高效运行

电子说

1.3w人已加入

描述

前言

在追求极致性能与可靠性的道路上,Flexus X 实例以卓越的算力与智能调度,为 Redis 三主三从集群的高效运行保驾护航。此架构不仅实现了数据的高可用性,还通过负载均衡提升了整体性能,确保您的业务在海量数据面前依然游刃有余。828 华为云企业上云节,华为云 Flexus X 实例携手 Redis 三主三从集群解决方案,为您带来前所未有的优惠与便捷,开启数据库高效运行的新篇章!

链接直达华为云Flexus云服务器X实例
 

华为云

Redis 集群介绍

Redis 三主三从集群是提升数据库系统可用性、容错性和性能的关键部署模式。它由三个主节点处理读写请求,三个从节点复制主节点数据,确保数据高可用与冗余。通过自动故障转移机制,从节点能在主节点故障时自动接管,保障服务连续性。此外,读写分离与负载均衡策略进一步优化了系统性能,适用于电商、社交网络和实时数据分析等高要求场景。

集群的核心优势在于其高效的数据复制与同步机制,从节点无缝复制主节点数据,不阻塞主节点处理流程。同时,当主节点故障时,系统能迅速自动完成故障转移,无需人工干预,极大提升了系统的稳定性和可靠性。

Redis 三主三从集群以其卓越的高可用性、容错能力和性能优化,成为复杂应用场景下数据存储与访问的首选方案。通过合理配置与部署,它能有效满足各类业务对数据存储的高要求,确保数据的安全、可靠与高效访问。

官方网站:https://redis.io/
 

官方文档:https://redis.io/docs/latest/
 

华为云

环境规划

部署流程

需要了解:

• 采用 docker 方式进行部署 Redis 三主三从集群

• 详细购买配置实例可参考文章: 快速部署华为云Flexus X实例,开启您的云端之旅
 

• 部署 docker 服务请参考文章:华为FlexusX与Docker+Nginx的高效整合之路
 

拉取镜像

拉取镜像并创建网络

[root@flexusx-251f ~]# docker pull redis:6.0.86.0.8: Pulling from library/redisbb79b6b2107f: Pull complete1ed3521a5dcb: Pull complete5999b99cee8f: Pull complete3f806f5245c9: Pull completef8a4497572b2: Pull completeeafe3b6b8d06: Pull completeDigest: sha256:21db12e5ab3cc343e9376d655e8eabbdbe5516801373e95a8a9e66010c5b8819Status: Downloaded newer image for redis:6.0.8docker.io/library/redis:6.0.8[root@flexusx-251f ~]# docker network create redis-cluster-net4d9a413869dd2339ef196cf0b5611fbc6209d586c2c5fd5b2b8b8f02d1dd8203

部署主节点

[root@flexusx-251f ~]# docker run -itd --name redis-master1 --network redis-cluster-net -p 6379:6379 -v /data/redis/share/redis-node-1:/data redis:6.0.8 --cluster-enabled yes  --appendonly yes --port 637904c85ab05c718ace09a8eb56a77220edc9d068a5201125e23b3a222fc898c323[root@flexusx-251f ~]# docker run -itd --name redis-master2 --network redis-cluster-net -p 6380:6379 -v /data/redis/share/redis-node-2:/data redis:6.0.8 --cluster-enabled yes  --appendonly yes --port 6379a900e7ddf6c99313b4f1bfd068d8a6b735a4425ec3b055d5e0616a944bdd44e6[root@flexusx-251f ~]# docker run -itd --name redis-master3 --network redis-cluster-net -p 6381:6379 -v /data/redis/share/redis-node-3:/data redis:6.0.8 --cluster-enabled yes  --appendonly yes --port 6379

部署从节点

[root@flexusx-251f ~]# docker run -itd --name redis-slave1 --network redis-cluster-net -p 6382:6379 -v /data/redis/share/redis-slave-1:/data redis:6.0.8 --cluster-enabled yes  --appendonly yes --port 63797f39daa7c0a7a5ca221db4a3e02ec495c82e69d3131e32b968be2cf7be3a93a4[root@flexusx-251f ~]# docker run -itd --name redis-slave2 --network redis-cluster-net -p 6383:6379 -v /data/redis/share/redis-slave-2:/data  redis:6.0.8 --cluster-enabled yes  --appendonly yes --port 63794e615a412d19072e4dd233f92f062867ab9bc8bf59587aa6252e2c1bc9796690[root@flexusx-251f ~]# docker run -itd --name redis-slave3 --network redis-cluster-net -p 6384:6379 -v /data/redis/share/redis-slave-3:/data  redis:6.0.8 --cluster-enabled yes  --appendonly yes --port 637956693d453988d23f1d477867e4a7b7dba5b2e6b9fd8a80724ae0a14f5c4deead

初始化 redis 集群

放行端口 6379,6380,6381,6382,6383,6384

华为云

查看 Redis 主机 IP 地址

[root@flexusx-251f ~]# docker inspect redis-master1 | grep -i ipadd            "SecondaryIPAddresses": null,            "IPAddress": "",                    "IPAddress": "172.27.0.2",[root@flexusx-251f ~]# docker inspect redis-master2 | grep -i ipadd            "SecondaryIPAddresses": null,            "IPAddress": "",                    "IPAddress": "172.27.0.3",[root@flexusx-251f ~]# docker inspect redis-master3 | grep -i ipadd            "SecondaryIPAddresses": null,            "IPAddress": "",                    "IPAddress": "172.27.0.7",[root@flexusx-251f ~]# docker inspect redis-slave1 | grep -i ipadd            "SecondaryIPAddresses": null,            "IPAddress": "",                    "IPAddress": "172.27.0.6",[root@flexusx-251f ~]# docker inspect redis-slave2 | grep -i ipadd            "SecondaryIPAddresses": null,            "IPAddress": "",                    "IPAddress": "172.27.0.4",[root@flexusx-251f ~]# docker inspect redis-slave3 | grep -i ipadd            "SecondaryIPAddresses": null,            "IPAddress": "",                    "IPAddress": "172.27.0.5",

进入其中一个主节点的容器内部

[root@flexusx-251f ~]# docker exec -it redis-master1 /bin/bash       root@04c85ab05c71:/data# 

注意将 ip 修改为自己的容器 ip,端口对应之前创建的节点 port

• 在使用 redis-cli --cluster create 命令创建 Redis 集群时,Redis 会自动根据提供的节点数量和 --cluster-replicas 1 的参数来分配主节点和从节

[root@flexusx-251f ~]# docker exec -it redis-master1 /bin/bash       root@04c85ab05c71:/data# redis-cli --cluster create       172.27.0.2:6379       172.27.0.3:6379       172.27.0.7:6379       172.27.0.6:6379       172.27.0.4:6379       172.27.0.5:6379       --cluster-replicas 1

当出现提示“Can I set the above configuration? (type 'yes' to accept):”的时候,输入 yes 即可;

>>> Performing hash slots allocation on 6 nodes...Master[0] -> Slots 0 - 5460Master[1] -> Slots 5461 - 10922Master[2] -> Slots 10923 - 16383Adding replica 172.27.0.4:6379 to 172.27.0.2:6379Adding replica 172.27.0.5:6379 to 172.27.0.3:6379Adding replica 172.27.0.6:6379 to 172.27.0.7:6379M: 24b3c498fa142da2e7f49f1c60dde9d7b49c8694 172.27.0.2:6379   slots:[0-5460] (5461 slots) masterM: 31292a53e00a7613e37621404bb3b9fe3da79fac 172.27.0.3:6379   slots:[5461-10922] (5462 slots) masterM: 7921f3f2a93b319f0689f777f108ea871215a8f9 172.27.0.7:6379   slots:[10923-16383] (5461 slots) masterS: ebebfbe22aafda4ab34621e336b87833229fb91b 172.27.0.6:6379   replicates 7921f3f2a93b319f0689f777f108ea871215a8f9S: 0ed3f67915347da7146eece57f4f7d52c1393065 172.27.0.4:6379   replicates 24b3c498fa142da2e7f49f1c60dde9d7b49c8694S: 8c3b43b00509c0a591862ed6ea561b873b0a5edd 172.27.0.5:6379   replicates 31292a53e00a7613e37621404bb3b9fe3da79facCan I set the above configuration? (type 'yes' to accept): yes

这样我们的三主三从就部署成功了

华为云

查看集群状态

第一种方式,任意进入一个容器内部,然后进入 6379 端口的这个客户端,-c 表示以集群的方式进入

[root@flexusx-251f ~]# docker exec -it redis-master1 /bin/bash  root@04c85ab05c71:/data# redis-cli -p 6379 -c127.0.0.1:6379> cluster infocluster_state:ok                     #正常 cluster_slots_assigned:16384cluster_slots_ok:16384cluster_slots_pfail:0cluster_slots_fail:0cluster_known_nodes:6                # 6 节点 cluster_size:3cluster_current_epoch:6cluster_my_epoch:1cluster_stats_messages_ping_sent:269cluster_stats_messages_pong_sent:305cluster_stats_messages_sent:574cluster_stats_messages_ping_received:300cluster_stats_messages_pong_received:269cluster_stats_messages_meet_received:5cluster_stats_messages_received:574

第二种方式,通过 cluster nodes 查看

[root@flexusx-251f ~]# docker exec -it redis-master1 /bin/bash  127.0.0.1:6379> cluster nodes31292a53e00a7613e37621404bb3b9fe3da79fac 172.27.0.3:6379@16379 master - 0 1726211088655 2 connected 5461-1092224b3c498fa142da2e7f49f1c60dde9d7b49c8694 172.27.0.2:6379@16379 myself,master - 0 1726211087000 1 connected 0-54607921f3f2a93b319f0689f777f108ea871215a8f9 172.27.0.7:6379@16379 master - 0 1726211088000 3 connected 10923-16383ebebfbe22aafda4ab34621e336b87833229fb91b 172.27.0.6:6379@16379 slave 7921f3f2a93b319f0689f777f108ea871215a8f9 0 1726211087654 3 connected8c3b43b00509c0a591862ed6ea561b873b0a5edd 172.27.0.5:6379@16379 slave 31292a53e00a7613e37621404bb3b9fe3da79fac 0 1726211087000 2 connected0ed3f67915347da7146eece57f4f7d52c1393065 172.27.0.4:6379@16379 slave 24b3c498fa142da2e7f49f1c60dde9d7b49c8694 0 1726211086000 1 connected

第三种方式,通过 redis-cli --cluster check 172.27.0.2:6379 查看(改成自己的 ip)

[root@flexusx-251f ~]# docker exec -it redis-master1 /bin/bash root@04c85ab05c71:/data# redis-cli -p 6379 -croot@04c85ab05c71:/data# redis-cli --cluster check 172.27.0.2:6379172.27.0.2:6379 (24b3c498...) -> 2 keys | 5461 slots | 1 slaves.172.27.0.3:6379 (31292a53...) -> 0 keys | 5462 slots | 1 slaves.172.27.0.7:6379 (7921f3f2...) -> 0 keys | 5461 slots | 1 slaves.[OK] 2 keys in 3 masters.0.00 keys per slot on average.>>> Performing Cluster Check (using node 172.27.0.2:6379)M: 24b3c498fa142da2e7f49f1c60dde9d7b49c8694 172.27.0.2:6379   slots:[0-5460] (5461 slots) master   1 additional replica(s)M: 31292a53e00a7613e37621404bb3b9fe3da79fac 172.27.0.3:6379   slots:[5461-10922] (5462 slots) master   1 additional replica(s)M: 7921f3f2a93b319f0689f777f108ea871215a8f9 172.27.0.7:6379   slots:[10923-16383] (5461 slots) master   1 additional replica(s)S: ebebfbe22aafda4ab34621e336b87833229fb91b 172.27.0.6:6379   slots: (0 slots) slave   replicates 7921f3f2a93b319f0689f777f108ea871215a8f9S: 8c3b43b00509c0a591862ed6ea561b873b0a5edd 172.27.0.5:6379   slots: (0 slots) slave   replicates 31292a53e00a7613e37621404bb3b9fe3da79facS: 0ed3f67915347da7146eece57f4f7d52c1393065 172.27.0.4:6379   slots: (0 slots) slave   replicates 24b3c498fa142da2e7f49f1c60dde9d7b49c8694[OK] All nodes agree about slots configuration.>>> Check for open slots...>>> Check slots coverage...[OK] All 16384 slots covered.

数据存储测试

在主 master2 节点上存数据

[root@flexusx-251f ~]# docker exec -it redis-master2 /bin/bashroot@a900e7ddf6c9:/data# redis-cli -p 6379 -c127.0.0.1:6379> set name zhangsanOK127.0.0.1:6379> set subject MathOK

在从 slave3 上查看数据

[root@flexusx-251f ~]# docker exec -it redis-slave3 /bin/bashroot@4bc3876d311b:/data# redis-cli -p 6379 -c127.0.0.1:6379> get name-> Redirected to slot [5798] located at 172.27.0.3:6379"zhangsan"172.27.0.3:6379> get subject"Math"

扩容测试

在创建两台节点容器

[root@flexusx-251f ~]# docker run -itd --name redis-master4 --network redis-cluster-net -p 6385:6379 -v /data/redis/share/redis-node-4:/data redis:6.0.8 --cluster-enabled yes  --appendonly yes --port 6379[root@flexusx-251f ~]# docker run -itd --name redis-slave4 --network redis-cluster-net -p 6386:6379 -v /data/redis/share/redis-slave-4:/data  redis:6.0.8 --cluster-enabled yes  --appendonly yes --port 6379

查看节点 ip 地址

[root@flexusx-251f ~]# docker inspect redis-master4 | grep -i ipadd                                       "SecondaryIPAddresses": null,            "IPAddress": "",                    "IPAddress": "172.27.0.8",[root@flexusx-251f ~]# docker inspect redis-slave4 | grep -i ipadd            "SecondaryIPAddresses": null,            "IPAddress": "",                    "IPAddress": "172.27.0.9",

进入 redis-master4 节点,增加节点

[root@flexusx-251f ~]# docker exec -it redis-master4 /bin/bashroot@b77caa384727:/data# redis-cli --cluster  add-node 172.27.0.8:6379 172.27.0.2:6379>>> Adding node 172.27.0.8:6379 to cluster 172.27.0.2:6379>>> Performing Cluster Check (using node 172.27.0.2:6379)M: 24b3c498fa142da2e7f49f1c60dde9d7b49c8694 172.27.0.2:6379   slots:[0-5460] (5461 slots) master   1 additional replica(s)M: 31292a53e00a7613e37621404bb3b9fe3da79fac 172.27.0.3:6379   slots:[5461-10922] (5462 slots) master   1 additional replica(s)M: 7921f3f2a93b319f0689f777f108ea871215a8f9 172.27.0.7:6379   slots:[10923-16383] (5461 slots) master   1 additional replica(s)S: ebebfbe22aafda4ab34621e336b87833229fb91b 172.27.0.6:6379   slots: (0 slots) slave   replicates 7921f3f2a93b319f0689f777f108ea871215a8f9S: 8c3b43b00509c0a591862ed6ea561b873b0a5edd 172.27.0.5:6379   slots: (0 slots) slave   replicates 31292a53e00a7613e37621404bb3b9fe3da79facS: 0ed3f67915347da7146eece57f4f7d52c1393065 172.27.0.4:6379   slots: (0 slots) slave   replicates 24b3c498fa142da2e7f49f1c60dde9d7b49c8694[OK] All nodes agree about slots configuration.>>> Check for open slots...>>> Check slots coverage...[OK] All 16384 slots covered.>>> Send CLUSTER MEET to node 172.27.0.8:6379 to make it join the cluster.[OK] New node added correctly.

查看主从状态

• 可以看到只有主节点,还未分配从节点

root@b77caa384727:/data# redis-cli --cluster check 172.27.0.2:6379172.27.0.2:6379 (24b3c498...) -> 2 keys | 5461 slots | 1 slaves.172.27.0.3:6379 (31292a53...) -> 2 keys | 5462 slots | 1 slaves.172.27.0.7:6379 (7921f3f2...) -> 0 keys | 5461 slots | 1 slaves.172.27.0.8:6379 (290b2aa0...) -> 0 keys | 0 slots | 0 slaves.[OK] 4 keys in 4 masters.0.00 keys per slot on average.>>> Performing Cluster Check (using node 172.27.0.2:6379)M: 24b3c498fa142da2e7f49f1c60dde9d7b49c8694 172.27.0.2:6379   slots:[0-5460] (5461 slots) master   1 additional replica(s)M: 31292a53e00a7613e37621404bb3b9fe3da79fac 172.27.0.3:6379   slots:[5461-10922] (5462 slots) master   1 additional replica(s)M: 7921f3f2a93b319f0689f777f108ea871215a8f9 172.27.0.7:6379   slots:[10923-16383] (5461 slots) master   1 additional replica(s)S: ebebfbe22aafda4ab34621e336b87833229fb91b 172.27.0.6:6379   slots: (0 slots) slave   replicates 7921f3f2a93b319f0689f777f108ea871215a8f9S: 8c3b43b00509c0a591862ed6ea561b873b0a5edd 172.27.0.5:6379   slots: (0 slots) slave   replicates 31292a53e00a7613e37621404bb3b9fe3da79facS: 0ed3f67915347da7146eece57f4f7d52c1393065 172.27.0.4:6379   slots: (0 slots) slave   replicates 24b3c498fa142da2e7f49f1c60dde9d7b49c8694M: 290b2aa0e79a9c9ad5ebdb6aa468176b61513283 172.27.0.8:6379   slots: (0 slots) master[OK] All nodes agree about slots configuration.>>> Check for open slots...>>> Check slots coverage...[OK] All 16384 slots covered.

槽位分配:172.27.0.8:6379 还没有分配槽位

root@b77caa384727:/data# redis-cli --cluster reshard 172.27.0.2:6379>>> Performing Cluster Check (using node 172.27.0.2:6379)M: 24b3c498fa142da2e7f49f1c60dde9d7b49c8694 172.27.0.2:6379   slots:[0-5460] (5461 slots) master   1 additional replica(s)M: 31292a53e00a7613e37621404bb3b9fe3da79fac 172.27.0.3:6379   slots:[5461-10922] (5462 slots) master   1 additional replica(s)M: 7921f3f2a93b319f0689f777f108ea871215a8f9 172.27.0.7:6379   slots:[10923-16383] (5461 slots) master   1 additional replica(s)S: ebebfbe22aafda4ab34621e336b87833229fb91b 172.27.0.6:6379   slots: (0 slots) slave   replicates 7921f3f2a93b319f0689f777f108ea871215a8f9S: 8c3b43b00509c0a591862ed6ea561b873b0a5edd 172.27.0.5:6379   slots: (0 slots) slave   replicates 31292a53e00a7613e37621404bb3b9fe3da79facS: 0ed3f67915347da7146eece57f4f7d52c1393065 172.27.0.4:6379   slots: (0 slots) slave   replicates 24b3c498fa142da2e7f49f1c60dde9d7b49c8694M: 290b2aa0e79a9c9ad5ebdb6aa468176b61513283 172.27.0.8:6379   slots: (0 slots) master[OK] All nodes agree about slots configuration.>>> Check for open slots...>>> Check slots coverage...[OK] All 16384 slots covered.How many slots do you want to move (from 1 to 16384)? 4096What is the receiving node ID? 290b2aa0e79a9c9ad5ebdb6aa468176b61513283Please enter all the source node IDs.  Type 'all' to use all the nodes as source nodes for the hash slots.  Type 'done' once you entered all the source nodes IDs.Source node #1: allReady to move 4096 slots.  Source nodes:    M: 24b3c498fa142da2e7f49f1c60dde9d7b49c8694 172.27.0.2:6379       slots:[0-5460] (5461 slots) master       1 additional replica(s)    M: 31292a53e00a7613e37621404bb3b9fe3da79fac 172.27.0.3:6379       slots:[5461-10922] (5462 slots) master       1 additional replica(s)    M: 7921f3f2a93b319f0689f777f108ea871215a8f9 172.27.0.7:6379       slots:[10923-16383] (5461 slots) master       1 additional replica(s)  Destination node:    M: 290b2aa0e79a9c9ad5ebdb6aa468176b61513283 172.27.0.8:6379       slots: (0 slots) master  Resharding plan:    Moving slot 5461 from 31292a53e00a7613e37621404bb3b9fe3da79fac.............

查看主从状态

root@b77caa384727:/data# redis-cli --cluster check 172.27.0.2:6379172.27.0.2:6379 (24b3c498...) -> 1 keys | 4096 slots | 1 slaves.172.27.0.3:6379 (31292a53...) -> 1 keys | 4096 slots | 1 slaves.172.27.0.7:6379 (7921f3f2...) -> 0 keys | 4096 slots | 1 slaves.172.27.0.8:6379 (290b2aa0...) -> 2 keys | 4096 slots | 0 slaves.[OK] 4 keys in 4 masters.0.00 keys per slot on average.>>> Performing Cluster Check (using node 172.27.0.2:6379)M: 24b3c498fa142da2e7f49f1c60dde9d7b49c8694 172.27.0.2:6379   slots:[1365-5460] (4096 slots) master   1 additional replica(s)M: 31292a53e00a7613e37621404bb3b9fe3da79fac 172.27.0.3:6379   slots:[6827-10922] (4096 slots) master   1 additional replica(s)M: 7921f3f2a93b319f0689f777f108ea871215a8f9 172.27.0.7:6379   slots:[12288-16383] (4096 slots) master   1 additional replica(s)S: ebebfbe22aafda4ab34621e336b87833229fb91b 172.27.0.6:6379   slots: (0 slots) slave   replicates 7921f3f2a93b319f0689f777f108ea871215a8f9S: 8c3b43b00509c0a591862ed6ea561b873b0a5edd 172.27.0.5:6379   slots: (0 slots) slave   replicates 31292a53e00a7613e37621404bb3b9fe3da79facS: 0ed3f67915347da7146eece57f4f7d52c1393065 172.27.0.4:6379   slots: (0 slots) slave   replicates 24b3c498fa142da2e7f49f1c60dde9d7b49c8694M: 290b2aa0e79a9c9ad5ebdb6aa468176b61513283 172.27.0.8:6379   slots:[0-1364],[5461-6826],[10923-12287] (4096 slots) master[OK] All nodes agree about slots configuration.>>> Check for open slots...>>> Check slots coverage...[OK] All 16384 slots covered.

为 172.27.0.8:6379 分配从节点 172.27.0.9:6379

# 172.27.0.8:6379 节点的 IDroot@b77caa384727:/data# redis-cli --cluster add-node 172.27.0.9:6379 172.27.0.8:6379 --cluster-slave --cluster-master-id 290b2aa0e79a9c9ad5ebdb6aa468176b61513283>>> Adding node 172.27.0.9:6379 to cluster 172.27.0.8:6379>>> Performing Cluster Check (using node 172.27.0.8:6379)M: 290b2aa0e79a9c9ad5ebdb6aa468176b61513283 172.27.0.8:6379   slots:[0-1364],[5461-6826],[10923-12287] (4096 slots) masterM: 24b3c498fa142da2e7f49f1c60dde9d7b49c8694 172.27.0.2:6379   slots:[1365-5460] (4096 slots) master   1 additional replica(s)M: 31292a53e00a7613e37621404bb3b9fe3da79fac 172.27.0.3:6379   slots:[6827-10922] (4096 slots) master   1 additional replica(s)M: 7921f3f2a93b319f0689f777f108ea871215a8f9 172.27.0.7:6379   slots:[12288-16383] (4096 slots) master   1 additional replica(s)S: 8c3b43b00509c0a591862ed6ea561b873b0a5edd 172.27.0.5:6379   slots: (0 slots) slave   replicates 31292a53e00a7613e37621404bb3b9fe3da79facS: ebebfbe22aafda4ab34621e336b87833229fb91b 172.27.0.6:6379   slots: (0 slots) slave   replicates 7921f3f2a93b319f0689f777f108ea871215a8f9S: 0ed3f67915347da7146eece57f4f7d52c1393065 172.27.0.4:6379   slots: (0 slots) slave   replicates 24b3c498fa142da2e7f49f1c60dde9d7b49c8694[OK] All nodes agree about slots configuration.>>> Check for open slots...>>> Check slots coverage...[OK] All 16384 slots covered.>>> Send CLUSTER MEET to node 172.27.0.9:6379 to make it join the cluster.Waiting for the cluster to join>>> Configure node as replica of 172.27.0.8:6379.[OK] New node added correctly.

扩容完成

root@b77caa384727:/data# redis-cli --cluster check 172.27.0.2:6379   172.27.0.2:6379 (24b3c498...) -> 1 keys | 4096 slots | 1 slaves.172.27.0.3:6379 (31292a53...) -> 1 keys | 4096 slots | 1 slaves.172.27.0.7:6379 (7921f3f2...) -> 0 keys | 4096 slots | 1 slaves.172.27.0.8:6379 (290b2aa0...) -> 2 keys | 4096 slots | 1 slaves.[OK] 4 keys in 4 masters.0.00 keys per slot on average.>>> Performing Cluster Check (using node 172.27.0.2:6379)M: 24b3c498fa142da2e7f49f1c60dde9d7b49c8694 172.27.0.2:6379   slots:[1365-5460] (4096 slots) master   1 additional replica(s)S: c3abe3fa7ef3103d32e19f17c152250e3392c94f 172.27.0.9:6379   slots: (0 slots) slave   replicates 290b2aa0e79a9c9ad5ebdb6aa468176b61513283M: 31292a53e00a7613e37621404bb3b9fe3da79fac 172.27.0.3:6379   slots:[6827-10922] (4096 slots) master   1 additional replica(s)M: 7921f3f2a93b319f0689f777f108ea871215a8f9 172.27.0.7:6379   slots:[12288-16383] (4096 slots) master   1 additional replica(s)S: ebebfbe22aafda4ab34621e336b87833229fb91b 172.27.0.6:6379   slots: (0 slots) slave   replicates 7921f3f2a93b319f0689f777f108ea871215a8f9S: 8c3b43b00509c0a591862ed6ea561b873b0a5edd 172.27.0.5:6379   slots: (0 slots) slave   replicates 31292a53e00a7613e37621404bb3b9fe3da79facS: 0ed3f67915347da7146eece57f4f7d52c1393065 172.27.0.4:6379   slots: (0 slots) slave   replicates 24b3c498fa142da2e7f49f1c60dde9d7b49c8694M: 290b2aa0e79a9c9ad5ebdb6aa468176b61513283 172.27.0.8:6379   slots:[0-1364],[5461-6826],[10923-12287] (4096 slots) master   1 additional replica(s)[OK] All nodes agree about slots configuration.>>> Check for open slots...>>> Check slots coverage...[OK] All 16384 slots covered.

体验和感受

华为云 Flexus X 实例,以其卓越的算力、灵活的扩展性和智能的运维管理,为 Redis 三主三从集群的高效运行提供了强有力的支撑。Redis 三主三从集群,作为业界公认的高可用、高性能解决方案,通过数据复制、自动故障转移和读写分离机制,确保了数据的安全性、一致性和系统的稳定性。而华为云 Flexus X 实例,凭借其出色的资源调度能力和优化的网络架构,进一步提升了集群的处理能力和响应速度。

在 828 华为云企业上云节,无论您是电商巨头、社交网络先锋,还是实时数据分析领域的探索者,Flexus X 都能助您一臂之力,让数据成为驱动业务增长的核心动力。点击下方链接,立即行动,让 Flexus X 实例携手 Redis 三主三从集群,为您的数字化转型之路加速护航!

产品链接华为云Flexus云服务器X实例直播建站服务器-华为云
 

华为云

审核编辑 黄宇

打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分