我们正在第一次启动应用程序时在Session对象中获取连接。我们的调度程序使用它将数据插入到Cassandra中。但是有些时候,它获得连接超时,然后重新连接Cassandra和应用程序正常工作。
调度程序经常超时。 (我已将我的IP更改为。。。在此帖子中)
2015-08-19 09:19:36 DEBUG Connection:274 - Defuncting connection to /*.*.*.*:9042
com.datastax.driver.core.TransportException: [/10.0.*.*:9042] Cannot connect
at com.datastax.driver.core.Connection.<init>(Connection.java:104)
at com.datastax.driver.core.Connection$Factory.open(Connection.java:544)
at com.datastax.driver.core.Cluster$Manager$5.tryReconnect(Cluster.java:1652)
at com.datastax.driver.core.AbstractReconnectionHandler.run(AbstractReconnectionHandler.java:124)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.datastax.shaded.netty.channel.ConnectTimeoutException: connection timed out: /*.*.*.*:9042
at com.datastax.shaded.netty.channel.socket.nio.NioClientBoss.processConnectTimeout(NioClientBoss.java:137)
at com.datastax.shaded.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:83)
at com.datastax.shaded.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
at com.datastax.shaded.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)
at com.datastax.shaded.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at com.datastax.shaded.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
... 3 more
2015-08-19 09:19:36 DEBUG Connection:449 - Connection[/*.*.*.*:9042-8, inFlight=0, closed=true] closing connection
2015-08-19 09:19:36 DEBUG Connection:721 - Connection[/*.*.*.*:9042-8, inFlight=0, closed=false] connection error
com.datastax.shaded.netty.channel.ConnectTimeoutException: connection timed out: /*.*.*.*:9042
at com.datastax.shaded.netty.channel.socket.nio.NioClientBoss.processConnectTimeout(NioClientBoss.java:137)
at com.datastax.shaded.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:83)
at com.datastax.shaded.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
at com.datastax.shaded.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)
at com.datastax.shaded.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at com.datastax.shaded.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2015-08-19 09:19:36 DEBUG Cluster:1681 - Failed reconnection to /10.0.1.18:9042 ([/*.*.*.*:9042] Cannot connect), scheduling retry in 128000 milliseconds
2015-08-19 09:19:36 DEBUG Connection:274 - Defuncting connection to /*.*.*.*:9042
com.datastax.driver.core.TransportException: [/*.*.*.*:9042] Unexpected exception triggered (com.datastax.shaded.netty.channel.ConnectTimeoutException: connection timed out: /*.*.*.*:9042)
at com.datastax.driver.core.Connection$Dispatcher.exceptionCaught(Connection.java:727)
at com.datastax.shaded.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:112)
at com.datastax.shaded.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at com.datastax.shaded.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at com.datastax.shaded.netty.handler.codec.oneone.OneToOneDecoder.handleUpstream(OneToOneDecoder.java:60)
at com.datastax.shaded.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at com.datastax.shaded.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
at com.datastax.shaded.netty.handler.codec.frame.FrameDecoder.exceptionCaught(FrameDecoder.java:377)
at com.datastax.shaded.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:112)
at com.datastax.shaded.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at com.datastax.shaded.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at com.datastax.shaded.netty.channel.Channels.fireExceptionCaught(Channels.java:525)
at com.datastax.shaded.netty.channel.socket.nio.NioClientBoss.processConnectTimeout(NioClientBoss.java:141)
at com.datastax.shaded.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:83)
at com.datastax.shaded.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:318)
at com.datastax.shaded.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)
at com.datastax.shaded.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at com.datastax.shaded.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.datastax.shaded.netty.channel.ConnectTimeoutException: connection timed out: /*.*.*.*:9042
at com.datastax.shaded.netty.channel.socket.nio.NioClientBoss.processConnectTimeout(NioClientBoss.java:137)
... 8 more
答案 0 :(得分:2)
看起来你在这里遇到连接超时。关于可能发生的事情的一些想法。
Failed reconnection to /10.0.1.18:9042
)。驱动程序使用rpc_address(如果rpc_address为0.0.0.0,则使用broadcast_rpc_address)连接到cassandra主机。这有可能吗?