首先配置linux中的哨兵配置文件
redis原来代码不用变,只需改一下application.properties中的配置
spring.redis.password=root
spring.redis.sentinel.master=mymaster
spring.redis.sentinel.nodes=192.168.137.128:26380,192.168.137.128:26382,192.168.137.128:26384
master中一般默认名为mymaster,如果你没有改
哨兵节点用逗号隔开