我已经开始使用Redisson Caching
而不是Jedis来使用读取副本。我正在使用bastion服务器连接到AWS的远程示例。
#ssh -f -N [email protected] -L 6379:master.redis-clusterXXXX.amazonaws.com:6379
字符串
Jedis的配置很简单,工作得很好。
JedisConnectionFactory jedisConnectionFactory() {
JedisConnectionFactory jedisConFactory
= new JedisConnectionFactory();
jedisConFactory.setHostName("localhost");
jedisConFactory.setPassword("***");
jedisConFactory.setPort(6379);
jedisConFactory.setUseSsl(true);
return jedisConFactory;
}
型
不幸的是,使用Redisson配置,它永远不会连接,并给出以下跟踪:
2024-01-02 16:25:56.358 INFO [,,] 76194 --- [ main] org.redisson.Version : Redisson 3.25.2
2024-01-02 16:25:56.758 ERROR [,,] 76194 --- [isson-netty-1-3] o.r.client.handler.ErrorsLoggingHandler : Exception occured. Channel: [id: 0xeb016650, L:0.0.0.0/0.0.0.0:57690]
io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching localhost found.
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:499)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching localhost found.
型
AWS Redis示例配置
的数据
有什么线索吗?
1条答案
按热度按时间vybvopom1#
我不得不禁用设置
setSslEnableEndpointIdentification(false)
,以不允许主机名检查器为localhost运行。请注意:因为我使用bastion -这就是为什么它会导致这个问题-人们试图直接访问redis集群应该不会有任何问题