0

TL; DR - DataStax java cassandraドライバからDataStax cassandraクラスタへの接続に問題があります。最初は接続して正常に動作し、突然接続が失われて再接続しません。この時点ですべてのクエリが失敗します。Cassandra javaドライバの接続エラー

詳細情報 -

だから、私はDataStaxのカサンドラドライバ3.0.0を使用しています、DataStaxカサンドラにCentOSの上の3つのノードのクラスタ2.1を実行していますよ。過去数ヶ月ですごくうまくいったのですが、最近、いくつかのスキーマの変更(つまり、既存のテーブルに列を追加する)とクエリの数の増加など、いくつかのコード変更を導入しました。この時点で切断が開始されました。

私のアプリケーションが上がったとき、それは以下のコードスニペットに示すように、それはクラスタに接続し、単一のクラスタ(およびセッション)オブジェクトを保持します。数時間後、実行されたクエリごとにNoHostAvailableExceptionを受信し始めます。この時点で、私は他のサーバが同じcassandraクラスタでうまく動作しているので、クラスタ自体に何も問題はないことを知っています。サーバーを再起動すると、すべて正常に動作します。

もう少し調査したところで、問題が発生すると、どちらのノードにもアクティブな接続がないことがわかります。 Iv'eはドライバをセットアップしてDEBUGレベルのログを専用のログファイルに記録し、問題が再発するのを待っていました。数時間後、問題が再び発生した、いくつかの点で、ログファイルがこのメッセージを示しています。

Connection[/10.4.116.91:9042-1, inFlight=2, closed=false] connection error 
io.netty.handler.codec.DecoderException: com.datastax.driver.core.exceptions.DriverInternalError: Adjusted frame length exceeds 268435456: 326843398 - discarded 
     at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:418) 
     at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:245) 
     at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292) 
     at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278) 
     at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:962) 
     at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) 
     at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528) 
     at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:485) 
     at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:399) 
     at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:371) 
     at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) 
     at java.lang.Thread.run(Thread.java:745) 
Caused by: com.datastax.driver.core.exceptions.DriverInternalError: Adjusted frame length exceeds 268435456: 326843398 - discarded 
     at com.datastax.driver.core.Frame$Decoder$DecoderForStreamIdSize.decode(Frame.java:239) 
     at com.datastax.driver.core.Frame$Decoder.decode(Frame.java:205) 
     at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:387) 
     ... 11 common frames omitted 

を、右、その後あなたがこれを参照してください。

Connection[/10.4.116.91:9042-1, inFlight=2, closed=false] connection error 
io.netty.handler.codec.DecoderException: com.datastax.driver.core.exceptions.DriverInternalError: Adjusted frame length exceeds 268435456: 326843398 - discarded 
     at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:418) 
     at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:245) 
     at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:292) 
     at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:278) 
     at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:962) 
     at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) 
     at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528) 
     at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:485) 
     at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:399) 
     at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:371) 
     at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) 
     at java.lang.Thread.run(Thread.java:745) 
Caused by: com.datastax.driver.core.exceptions.DriverInternalError: Adjusted frame length exceeds 268435456: 326843398 - discarded 
     at com.datastax.driver.core.Frame$Decoder$DecoderForStreamIdSize.decode(Frame.java:239) 
     at com.datastax.driver.core.Frame$Decoder.decode(Frame.java:205) 
     at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:387) 
     ... 11 common frames omitted 

この時点から、あなただけのタイムアウトを参照してくださいにし、再試行しますが、接続が再確立されません。

// CREATION OF CASSANDRA SESSION 
PoolingOptions poolingOptions = new PoolingOptions(); 
poolingOptions 
    .setPoolTimeoutMillis(0) 
    .setMaxRequestsPerConnection(HostDistance.LOCAL, 32768) 
    .setMaxRequestsPerConnection(HostDistance.REMOTE, 2000); 
cluster = builder.withPoolingOptions(poolingOptions).build(); 
cluster.getConfiguration().getCodecRegistry().register(new EnumNameCodec<>(OnBoardingSlide.Type.class)); 
session = cluster.connect(Global.getServerConfig().CASSANDRA_KEYSPACE_NAME); 
+0

あなたは挿入を行っていますか、または単にcassandraから読んでいますか? – root545

+0

。すべてのクエリが失敗します。 – AvivC

答えて

2

カサンドラ・ノードは> 256 native_transport_max_frame_size_in_mbで構成されており、ドライバーは256メガバイトを超えるフレームを読み込み、それが例外をスローした場合。これは、Javaドライバ

にバグかもしれません: これはドライバを破りますフレームを解析するためのデコーダので、後続のパケットを読み取る能力は、これは3.0.4でで修正されてい

ここで、 静的である詳細はリンクです。

https://datastax-oss.atlassian.net/browse/JAVA-1292

あなたのドライバをアップグレードしてみてくださいことはできますか?

+0

こちらのヒントは https://groups.google.com/a/lists.datastax.com/forum/#!topic/java-driver-user/1cSGl-YOzxE 移行しています今日。私はそれが繰り返されないかどうかを確認するために数日待って、私はここで確認します! ありがとう! – AvivC

+0

新しいバージョンでは繰り返されないようです。 – AvivC

関連する問題