k8s部署 Redis Insight k8s部署redis集群_mob6454cc6c6291的技术博客_51CTO博客

redis cluster搭建-LMLPHP

redis cluster搭建-LMLPHP

redis cluster搭建-LMLPHP

占用的内存竟然这么小,才200M左右

随便选个节点进去,看能否连接上其他节点

redis-cli -h redis-cluster-v1-0.redis-cluster.project-gulimall.svc.cluster.local

再创建个redis-trib方便加集群的工具POD,150M

redis cluster搭建-LMLPHP

操作主节点

redis-trib.py create `dig +short redis-cluster-v1-0.redis-cluster.project-gulimall.svc.cluster.local`:6379 `dig +short redis-cluster-v1-1.redis-cluster.project-gulimall.svc.cluster.local`:6379 `dig +short redis-cluster-v1-2.redis-cluster.project-gulimall.svc.cluster.local`:6379

操作从节点

redis-trib.py replicate --master-addr `dig +short redis-cluster-v1-0.redis-cluster.project-gulimall.svc.cluster.local`:6379 --slave-addr `dig +short redis-cluster-v1-3.redis-cluster.project-gulimall.svc.cluster.local`:6379


redis-trib.py replicate --master-addr `dig +short redis-cluster-v1-1.redis-cluster.project-gulimall.svc.cluster.local`:6379 --slave-addr `dig +short redis-cluster-v1-4.redis-cluster.project-gulimall.svc.cluster.local`:6379


redis-trib.py replicate --master-addr `dig +short redis-cluster-v1-2.redis-cluster.project-gulimall.svc.cluster.local`:6379 --slave-addr `dig +short redis-cluster-v1-5.redis-cluster.project-gulimall.svc.cluster.local`:6379

搭建完成

redis cluster搭建-LMLPHP

11-19 08:01