ClusterHostAndPorts must not be null!

xiaoxiao2025-05-28  34

使用springboot整合redis,启动报错,排查后发现是配置问题,配置集群参数前先要配置集群节点。

错误配置:

spring.redis.host=127.0.0.1 spring.redis.port=6379 spring.redis.password=pass123 spring.redis.timeout=1000 spring.redis.cluster.max-redirects=8

正确配置:

spring.redis.host=127.0.0.1 spring.redis.port=6379 spring.redis.password=pass123 spring.redis.timeout=1000 spring.redis.cluster.nodes=127.0.0.1:6379 spring.redis.cluster.max-redirects=8
转载请注明原文地址: https://www.6miu.com/read-5030844.html

最新回复(0)