connect timed out
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out
at redis.clients.jedis.Connection.connect(Connection.java:207)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:93)
at redis.clients.jedis.Connection.sendCommand(Connection.java:126)
at redis.clients.jedis.BinaryClient.set(BinaryClient.java:110)
at redis.clients.jedis.Client.set(Client.java:47)
at redis.clients.jedis.Jedis.set(Jedis.java:120)
at redis.clients.jedis.ShardedJedis.set(ShardedJedis.java:43)
at com.snsoft.base.service.impl.JedisClientSrv$1.execute(JedisClientSrv.java:53)
at com.snsoft.base.service.impl.JedisClientSrv$1.execute(JedisClientSrv.java:51)
at com.snsoft.base.service.impl.JedisClientSrv.execute(JedisClientSrv.java:31)
at com.snsoft.base.service.impl.JedisClientSrv.set(JedisClientSrv.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:338)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:197)
1.如果是本地启动时:
报错原因:主要看这剧redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect timed out
中的connect timed out提示链接超时
解决办法:没有打开redis,打开redis就i可以
2.不是本地启动:
出现这个错误连接不上linux的redis,一般就是防火墙问题
转载地址:https://blog.csdn.net/ksdb0468473/article/details/52126474