赞
踩
使用SpringBoot集成Redis的时候出现如下错误:
org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool;
nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to X.X.X.X:6379
。。。
。。。
Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /X.X.X.X:6379
。。。
第一想法是不是配置文件出错,检查发现不是。X.X.X.X 为本人服务器地址。
yml配置如下:
spring:
redis: # redis配置
database: 0 # Redis数据库索引(默认为0)
host: X.X.X.X # Redis服务器地址
password:
port: 6379 # Redis服务器连接端口
timeout: 30000
lettuce:
pool:
max-active: 8
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。