Linux,Redis中IOException: 远程主机强迫关闭了一个现有的连接。解决方法

x33g5p2x  于2022-08-17 转载在 Linux  
字(0.9k)|赞(0)|评价(0)|浏览(1331)

【现象】

[ERROR] Exception occured. Channel: [id: 0x60dbc204, L:/192.168.0.107:64658 - R:104.115.158.104/104.115.158.104:6379] - 2022-08-09 22:25:28,352 [redisson-netty-2-7] org.redisson.client.handler.CommandsQueue(exceptionCaught,153) 
java.io.IOException: 远程主机强迫关闭了一个现有的连接。
	at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[na:1.8.0_181]
	at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[na:1.8.0_181]
	at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.8.0_181]
	at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[na:1.8.0_181]
	at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380) ~[na:1.8.0_181]
	at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:247) ~[netty-buffer-4.1.38.Final.jar:4.1.38.Final]
	at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1140) ~[netty-buffer-4.1.38.Final.jar:4.1.38.Final]

【解决方法】

tcp-keepalive 300

修改为:

tcp-keepalive 0

相关文章

微信公众号