美文网首页
通过Jedis客户端连接不到redis

通过Jedis客户端连接不到redis

作者: seawish | 来源:发表于2019-10-11 17:22 被阅读0次

    场景描述
    springboot项目用redis解决session共享问题,启动项目报错。
    springboot版本:

    org.springframework.boot
    spring-boot-starter-parent
    1.5.19.RELEASE

    redis版本

    [15332] 12 Mar 15:59:54.307 # Server started, Redis version 2.6.12
    [15332] 12 Mar 15:59:54.308 * The server is now ready to accept connections on port 6379

    异常原因
    redis服务器版本和jar包版本不一致造成的
    maven仓库的 spring-boot-starter-redis1.3.8的只支持2.7.3 的redis

    解决方案
    更换redis服务器版本为springboot兼容的版本。这里更换为3.0。
    [25072] 12 Mar 16:01:52.065 # Server started, Redis version 3.0.501
    [25072] 12 Mar 16:01:52.065 * The server is now ready to accept connections on port 6379
    ————————————————
    版权声明:本文为CSDN博主「清欢ysy」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qq_33840251/article/details/88707803

    
    Caused by: java.net.ConnectException: Connection refused
    
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.8.0_181]
    
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[?:1.8.0_181]
    
    at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327) ~[netty-transport-4.1.29.Final.jar!/:4.1.29.Final]
    
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340) ~[netty-transport-4.1.29.Final.jar!/:4.1.29.Final]
    
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:616) ~[netty-transport-4.1.29.Final.jar!/:4.1.29.Final]
    
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563) ~[netty-transport-4.1.29.Final.jar!/:4.1.29.Final]
    
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480) ~[netty-transport-4.1.29.Final.jar!/:4.1.29.Final]
    
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) ~[netty-transport-4.1.29.Final.jar!/:4.1.29.Final]
    
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) ~[netty-common-4.1.29.Final.jar!/:4.1.29.Final]
    
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.29.Final.jar!/:4.1.29.Final]
    
    at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_181]
    
    

    相关文章

      网友评论

          本文标题:通过Jedis客户端连接不到redis

          本文链接:https://www.haomeiwen.com/subject/hnfxmctx.html