Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

nikhildaga31_172124 avatar image
nikhildaga31_172124 asked Erick Ramirez answered

Getting NoHostAvailableException from Spark Streaming app

Hi,

I am stream data from application and inserting into Apache Cassandra.While process message getting below error.

Can you suggest what is the cause of this issue ?

Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (no host was tried)
at com.datastax.driver.core.RequestHandler.reportNoMoreHosts(RequestHandler.java:265)
at com.datastax.driver.core.RequestHandler.access$1200(RequestHandler.java:62)
at com.datastax.driver.core.RequestHandler$SpeculativeExecution.findNextHostAndQuery(RequestHandler.java:357)
at com.datastax.driver.core.RequestHandler.startNewExecution(RequestHandler.java:138)
at com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:120)
at com.datastax.driver.core.SessionManager.execute(SessionManager.java:700)
at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:144)
at com.datastax.driver.core.AbstractSession.executeAsync(AbstractSession.java:64)
at com.datastax.driver.core.Cluster$1.apply(Cluster.java:389)
at com.datastax.driver.core.Cluster$1.apply(Cluster.java:386)
at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:211)
at com.google.common.util.concurrent.AbstractTransformFuture$AsyncTransformFuture.doTransform(AbstractTransformFuture.java:200)
at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:130)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:902)
at com.google.common.util.concurrent.AbstractFuture.addListener(AbstractFuture.java:636)
at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.addListener(AbstractFuture.java:100)
at com.google.common.util.concurrent.AbstractTransformFuture.create(AbstractTransformFuture.java:50)
at com.google.common.util.concurrent.Futures.transformAsync(Futures.java:551)
at com.datastax.driver.core.GuavaCompatibility$Version19OrHigher.transformAsync(GuavaCompatibility.java:280)
at com.datastax.driver.core.GuavaCompatibility$Version19OrHigher.transformAsync(GuavaCompatibility.java:272)
at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:384)
at com.datastax.driver.core.Cluster.connect(Cluster.java:332)
spark-cassandra-connector
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

In my experience, the most common cause of the NoHostAvailableException from the driver is that the nodes are overloaded and become unresponsive.

You need to either (a) throttle your application so it doesn't overload the cluster, or (b) increase the capacity on your cluster by adding more nodes. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.