记个链接: https://www.cnblogs.com/ryanzheng/p/8075221.html
用了redis集群,所以不仅要起三个端口的redis服务,还要把三个集群连起来。
1, 起了集群的不能只用一个node,不然报错:
spring.redis.cluster.nodes=localhost:6379
org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis;
Cannot retrieve initial cluster partitions from initial URIs [RedisURI [host='localhost', port=6379]]
Caused by: io.lettuce.core.RedisCommandExecutionException: ERR This instance has cluster support disabled
2, 起了多个端口,但是没级联的报错:
spring.redis.cluster.nodes=localhost