使用heml安装
values.yaml文件下载
https://raw.githubusercontent.com/chenjiangtao/spring-boot-on-kubernetes/master/kubernetes/redis-sentinel/values.yaml

修改values.yaml文件

可修改的master名:
masterSet: mymaster

副本:
replicaCount: 3

开启

sentinel:
    enabled: true

设密码

redis:
	password:

安装

helm install -ndev redis-sentinel bitnami/redis --values values.yaml

查看

看主从关系

kubectl logs redis-sentinel-node-0 sentinel -ndev

看redis主机信息 port is 6379

kubectl exec -i -t redis-sentinel-node-0 -ndev -c redis -- redis-cli -h 10.100.176.247 -p 6379 -a Redis@123 info replication

查看redis sentinel ,port is 26379

kubectl exec -i -t redis-sentinel-node-0 -ndev -c redis -- redis-cli -h 10.100.176.247 -p 26379 -a Redis@123 info
#see the sentinel master info(master name etc. )
kubectl exec -i -t redis-sentinel-node-0 -ndev -c redis -- redis-cli -h 10.100.176.247 -p 26379 -a Redis@123 sentinel masters 

spring boot配置 redis sentinel 参考:

Springboot Redisson 配置

参考:

Deploy a Redis Sentinel Kubernetes cluster using Bitnami Helm charts

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐