bladex2.7.0版本无法连接redis集群

Blade 未结 1 976
ntu820
ntu820 剑圣 2021-04-21 20:05

一、该问题的重现步骤是什么?

  1. 已经完成redis集群部署,3台服务器,3主3从。下面是集群信息

image.png

image.png

2. nacos中redis集群的配置

image.png


二、你期待的结果是什么?实际看到的又是什么?

期待:服务能够连接上redis。

实际:出现无法连接redis集群。

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

bladex 2.7.0 联合版。开发环境:windows10 10.0.17763 暂缺 Build 17763,部署环境:centos7.9

四、请提供详细的错误堆栈信息,这很重要。

2021-04-21 19:39:30.868  INFO [blade-user,b8ab19ea404d7b38,b8ab19ea404d7b38,true] 20996 --- [   async-task-1] o.s.core.launch.StartEventListener       : ---[BLADE-USER]---启动完成,当前使用的端口:[8102],环境变量:[dev]---
2021-04-21 19:39:31.272  INFO [blade-user,,,] 20996 --- [)-192.168.153.1] io.undertow.servlet                      : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-04-21 19:39:31.273  INFO [blade-user,,,] 20996 --- [)-192.168.153.1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2021-04-21 19:39:31.302  INFO [blade-user,,,] 20996 --- [)-192.168.153.1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 29 ms
2021-04-21 19:39:40.422  INFO [blade-user,,,] 20996 --- [oundedElastic-1] io.lettuce.core.EpollProvider            : Starting without optional epoll library
2021-04-21 19:39:40.423  INFO [blade-user,,,] 20996 --- [oundedElastic-1] io.lettuce.core.KqueueProvider           : Starting without optional kqueue library
2021-04-21 19:39:40.995  INFO [blade-user,,,] 20996 --- [ioEventLoop-4-4] io.lettuce.core.protocol.CommandHandler  : null Unexpected exception during request: java.io.IOException: 你的主机中的软件中止了一个已建立的连接。

java.io.IOException: 你的主机中的软件中止了一个已建立的连接。
	at sun.nio.ch.SocketDispatcher.read0(Native Method)
	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
	at sun.nio.ch.IOUtil.read(IOUtil.java:192)
	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1134)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)

2021-04-21 19:39:40.995  INFO [blade-user,,,] 20996 --- [ioEventLoop-4-7] io.lettuce.core.protocol.CommandHandler  : null Unexpected exception during request: java.io.IOException: 你的主机中的软件中止了一个已建立的连接。

java.io.IOException: 你的主机中的软件中止了一个已建立的连接。
	at sun.nio.ch.SocketDispatcher.read0(Native Method)
	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
	at sun.nio.ch.IOUtil.read(IOUtil.java:192)
	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1134)
	at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)

2021-04-21 19:39:41.098  INFO [blade-user,,,] 20996 --- [xecutorLoop-1-7] i.l.core.protocol.ConnectionWatchdog     : Reconnecting, last destination was /192.168.186.62:7001
2021-04-21 19:39:41.098  INFO [blade-user,,,] 20996 --- [xecutorLoop-1-1] i.l.core.protocol.ConnectionWatchdog     : Reconnecting, last destination was /192.168.186.63:7001
2021-04-21 19:39:41.098  INFO [blade-user,,,] 20996 --- [xecutorLoop-1-2] i.l.core.protocol.ConnectionWatchdog     : Reconnecting, last destination was /192.168.186.61:7001
2021-04-21 19:39:41.104  INFO [blade-user,,,] 20996 --- [ioEventLoop-4-8] i.l.core.protocol.ReconnectionHandler    : Reconnected to 192.168.186.62:7001
2021-04-21 19:39:41.105  INFO [blade-user,,,] 20996 --- [ioEventLoop-4-2] i.l.core.protocol.ReconnectionHandler    : Reconnected to 192.168.186.61:7001
2021-04-21 19:39:41.105  INFO [blade-user,,,] 20996 --- [ioEventLoop-4-1] i.l.core.protocol.ReconnectionHandler    : Reconnected to 192.168.186.63:7001
2021-04-21 19:39:41.199  INFO [blade-user,,,] 20996 --- [ioEventLoop-4-3] i.l.core.protocol.ReconnectionHandler    : Reconnected to 192.168.186.61:7001
2021-04-21 19:39:41.199  INFO [blade-user,,,] 20996 --- [ioEventLoop-4-5] i.l.core.protocol.ReconnectionHandler    : Reconnected to 192.168.186.63:7001
2021-04-21 19:39:41.199  INFO [blade-user,,,] 20996 --- [ioEventLoop-4-4] i.l.core.protocol.Re

五:疑惑

1、没有配置7001端口,为什么bladex回去连接7001端口的redis

2、烧饼模式的redis可以进行连接

spring:
redis:
cluster:
nodes:
- 192.168.182.176:6379
- 192.168.182.177:6379
- 192.168.182.178:6379
commandTimeout: 5000
password: 
database: 0
ssl: false
sentinel:
master: mymaster
nodes:
- 192.168.182.176:26379
- 192.168.182.177:26379
- 192.168.182.178:26379


1条回答
  • 2021-04-21 22:20

    整个工程唯一能搜索到7001的就这个地方,你需要去看一下是否有其他地方配置了或者说是端口无法访问变成往后顺延一位。

    这块没有封装,用的就是spring原生的redis配置

    image.png

    作者追问:2021-04-22 08:31

    你的这个【127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003】这三个地址配的都是redis的master地址码?我这边除了有3个master【端口是7000】,还有3个slave的【端口是7001】。而salve上确实是连接不上的,会不会是这个原因?有没有什么办法可以让平台不要去连slave的?

    0 讨论(0)
提交回复