Failed to execute Hadoop map jobs with com.datastax.driver.core.exceptions.NoHostAvailableException
I am trying to run analytics using shrinking a memory map stored inside cassandra. For this I am using a class CqlInputFormat
that is available through the maven dependency cassandra-all
. We are currently using this version 2.0.10 in our production environment. Also, we are using caassandra-driver-core
with version 2.1.1.
Now when I submit a simple map cut job to my jobtracker all my cartographer tasks fail with the below exception.
Another important thing to note here is that if I use the CqlPagingInputFormat
one available in 2.0.6 of cassandra-all
, everything works fine. But this input format was removed in later versions.
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: 10.40.242.174:9042 (com.datastax.driver.core.exceptions.DriverException: Timeout while trying to acquire available connection (you may want to increase the driver number of per-host connections)))
at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:65)
at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:258)
at com.datastax.driver.core.Cluster.connect(Cluster.java:267)
at org.apache.cassandra.hadoop.cql3.CqlRecordReader.initialize(CqlRecordReader.java:137)
at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.initialize(MapTask.java:521)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:763)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:364)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:415)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: 10.40.242.174:9042 (com.datastax.driver.core.exceptions.DriverException: Timeout while trying to acquire available connection (you may want to increase the driver number of per-host connections)))
at com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:103)
at com.datastax.driver.core.SessionManager.execute(SessionManager.java:446)
at com.datastax.driver.core.SessionManager.executeQuery(SessionManager.java:482)
at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:88)
at com.datastax.driver.core.AbstractSession.executeAsync(AbstractSession.java:60)
at com.datastax.driver.core.Cluster.connect(Cluster.java:260)
... 9 more
Any inputs are welcome.
I had exactly the same problem when using it cassandra-all-2.0.10
, but the problem was solved with version cassandra-all-2.0.12
.
I think the fix is ββin this commit: Potentially use non-local nodes in CqlConfigHelper